Skip to content

Commit

Permalink
Add linux build (#89)
Browse files Browse the repository at this point in the history
* Run native build

* Add llvm-objdump

* Tree target to find release

* Optimize for size

* FIx Cargo.toml

* Change profile name

* Add inherits release to compact profile

* Add new line

* Revert wasm build section

* Fix output direcotry
  • Loading branch information
MrDobi authored Jun 26, 2024
1 parent 17ab559 commit ec4a2fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
sudo ln -s /usr/bin/llvm-ar-15 /usr/bin/llvm-ar
sudo ln -s /usr/bin/llvm-nm-15 /usr/bin/llvm-nm
sudo ln -s /usr/bin/llvm-ranlib-15 /usr/bin/llvm-ranlib
sudo ln -s /usr/bin/llvm-objdump-15 /usr/bin/llvm-objdump
- name: Tool Versions
run: |
Expand Down Expand Up @@ -89,7 +90,16 @@ jobs:
chmod +x lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/*
rustup toolchain link wasix .
- name: Build
- name: Build native
run: cargo build --profile release-compact

- name: Archive build native output
uses: actions/upload-artifact@v3
with:
name: winterjs-linux
path: target/release-compact/winterjs

- name: Build wasm
run: |
export WASI_SYSROOT=$(pwd)/sysroot/wasix-libc/sysroot32
bash build.sh
Expand All @@ -109,7 +119,7 @@ jobs:
"sleep 10 && cd test-suite && cargo run"
echo All tests are passing! 🎉
- name: Archive build output
- name: Archive build wasm output
uses: actions/upload-artifact@v3
with:
name: winterjs-wasm
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ tokio = { git = "https://github.com/wasix-org/tokio.git", branch = "wasix-1.35.1
rustls = { git = "https://github.com/wasix-org/rustls.git", branch = "v0.22.2" }
hyper = { git = "https://github.com/wasix-org/hyper.git", branch = "v0.14.28" }
h2 = { git = "https://github.com/wasix-org/h2", branch = "v0.3.23" }

[profile.release-compact]
inherits = "release"
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true

0 comments on commit ec4a2fa

Please sign in to comment.