-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add features for dev and prod wasmer configurations #120
Changes from 1 commit
4d4618d
8c6751e
723295d
abff424
0d499c8
f9d4542
1f6cb88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
matrix: | ||
script: ["test", "bench"] | ||
os: ["ubuntu-latest", "macos-latest"] | ||
wasmer-feature: ["wasmer_sys", "wasmer_wamr"] | ||
wasmer-feature: ["wasmer_sys_dev", "wasmer_sys_prod", "wasmer_wamr"] | ||
exclude: | ||
# TODO bench suite on macos-latest is killed by system due to running out of swap space | ||
# All benches run fine individually | ||
|
@@ -33,9 +33,9 @@ jobs: | |
size: 15G | ||
- uses: actions/checkout@v4 | ||
- name: Install nix | ||
uses: cachix/install-nix-action@v26 | ||
uses: cachix/install-nix-action@v30 | ||
- name: Setup cachix | ||
uses: cachix/cachix-action@v14 | ||
uses: cachix/cachix-action@v15 | ||
if: ${{ ! contains(matrix.platform.runs-on, 'self-hosted') }} | ||
with: | ||
name: holochain-ci | ||
|
@@ -47,7 +47,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
wasmer-feature: | ||
- "wasmer_sys" | ||
- "wasmer_sys_dev" | ||
- "wasmer_sys_prod" | ||
# TODO Building with wasmer_wamr feature flag on windows is not currently working. | ||
# See https://github.com/holochain/holochain-wasmer/issues/117 | ||
# - "wasmer_wamr" | ||
|
@@ -57,7 +58,21 @@ jobs: | |
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: wasm32-unknown-unknown | ||
- name: Install LLVM | ||
env: | ||
LLVM_DIR: .llvm | ||
shell: bash | ||
run: | | ||
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} | ||
mkdir -p ${LLVM_DIR} | ||
curl --proto '=https' --tlsv1.2 -sSf "https://github.com/wasmerio/llvm-custom-builds/releases/download/15.x/llvm-windows-amd64.tar.xz" -L -o - | tar xJv -C ${LLVM_DIR} | ||
- name: test root | ||
run: cargo test --release --no-default-features --features error_as_host,${{ matrix.wasmer-feature }} -- --nocapture | ||
shell: pwsh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PowerShell? Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this is running on Windows only and because its easier to work with than batch on Windows. With the distinction between traditional powershell and powershell core (pwsh), there is now a cross-platform and very capable scripting language option for Windows. |
||
run: | | ||
$env:LLVM_SYS_150_PREFIX="$(pwd)/.llvm" | ||
cargo test --release --no-default-features --features error_as_host,${{ matrix.wasmer-feature }} -- --nocapture | ||
- name: test | ||
run: cargo test --release --manifest-path test/Cargo.toml --no-default-features --features ${{ matrix.wasmer-feature }} -- --nocapture | ||
shell: pwsh | ||
run: | | ||
$env:LLVM_SYS_150_PREFIX="$(pwd)/.llvm" | ||
cargo test --release --manifest-path test/Cargo.toml --no-default-features --features ${{ matrix.wasmer-feature }} -- --nocapture |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ authors = ["thedavidmeister", "[email protected]"] | |
edition = "2021" | ||
|
||
[dependencies] | ||
wasmer = { version = "=4.3.6", optional = true, default-feature = false } | ||
wasmer-middlewares = { version = "=4.3.6", optional = true, default-feature = false } | ||
wasmer = { version = "=4.3.6", optional = true, default-features = false } | ||
wasmer-middlewares = { version = "=4.3.6", optional = true, default-features = false } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This took me way too long to find. This is a horrible little mistake to catch! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does cargo check not catch that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question! Just put this back and ran I guess Cargo is ignoring unknown fields? Which is something I hate with a passion. If people want custom properties, make them use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oof my bad! 😬 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All good, I blame Cargo, not the typo :) |
||
|
||
# Temporarily include a fork of wasmer from the git branch 'wamr', until it is officially released in wasmer v5 | ||
hc-wasmer = { version="=4.3.6-hc.1", optional = true, default-features = false } | ||
|
@@ -30,14 +30,22 @@ crate-type = ["cdylib", "rlib"] | |
path = "src/lib.rs" | ||
|
||
[features] | ||
default = ["error_as_host", "wasmer_sys"] | ||
default = ["error_as_host", "wasmer_sys_dev"] | ||
debug_memory = [] | ||
error_as_host = ["holochain_wasmer_common/error_as_host"] | ||
wasmer_sys = [ | ||
"dep:wasmer", | ||
"dep:wasmer-middlewares", | ||
"wasmer/sys", | ||
] | ||
wasmer_sys_dev = [ | ||
"wasmer_sys", | ||
"wasmer/default", | ||
] | ||
wasmer_sys_prod = [ | ||
"wasmer_sys", | ||
"wasmer/llvm", | ||
] | ||
wasmer_wamr = [ | ||
"dep:hc-wasmer", | ||
"hc-wasmer/wamr" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also be powershell like the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would involve me figuring out the black magic bash command that I copied from the wasmer project's CI :)
Given that we're pulling their prebuilt binary, I'd prefer to just use their command to unpack it too
https://github.com/wasmerio/wasmer/blob/main/.github/workflows/build.yml#L270