Skip to content

Commit

Permalink
Test the .wasm output for external dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus23 committed Feb 13, 2025
1 parent ec35885 commit 0c27537
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,20 @@ jobs:
- name: wasm32 build (iroh-relay)
run: cargo build --target wasm32-unknown-unknown -p iroh-relay --no-default-features

- name: wasm32 build (iroh-net-report)
run: cargo build --target wasm32-unknown-unknown -p iroh-net-report --no-default-features

# If the Wasm file contains any 'import "env"' declarations, then
# some non-Wasm-compatible code made it into the final code.
- name: Ensure no 'import "env"' in iroh-relay Wasm
run: |
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_relay.wasm | grep 'import "env"'
# If the Wasm file contains any 'import "env"' declarations, then
# some non-Wasm-compatible code made it into the final code.
- name: Ensure no 'import "env"' in iroh-net-report Wasm
run: |
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_net_report.wasm | grep 'import "env"'

check_semver:
Expand Down
3 changes: 3 additions & 0 deletions iroh-net-report/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ keywords = ["networking"]
# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.81"

[lib]
crate-type = ["lib", "cdylib"] # cdylib is needed for Wasm support

[lints]
workspace = true

Expand Down
3 changes: 3 additions & 0 deletions iroh-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository = "https://github.com/n0-computer/iroh"
keywords = ["networking", "holepunching", "p2p"]
rust-version = "1.81"

[lib]
crate-type = ["lib", "cdylib"] # cdylib is needed for Wasm support

[lints]
workspace = true

Expand Down

0 comments on commit 0c27537

Please sign in to comment.