-
Notifications
You must be signed in to change notification settings - Fork 165
fix: propagate unwind safety to user callbacks across all gloo crates #562
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
Changes from 1 commit
82b17da
d73276e
c2175a1
0ad3861
17111d0
af0f977
e3def81
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 |
|---|---|---|
|
|
@@ -119,6 +119,43 @@ jobs: | |
| wasm-pack test --node crates/$x --no-default-features | ||
| done | ||
|
|
||
| panic_unwind_build: | ||
| name: Build with -Cpanic=unwind | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| # Recent Rust nightlies with LLVM 22 are temporarily broken with | ||
| # `panic=unwind` (see wasm-bindgen/wasm-bindgen#4929). Pin to a known-good | ||
| # nightly to avoid flapping. | ||
| - uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: nightly-2026-01-28 | ||
| target: wasm32-unknown-unknown | ||
| components: rust-src | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: cargo-${{ runner.os }}-panic-unwind-${{ hashFiles('**/Cargo.toml') }} | ||
| restore-keys: | | ||
| cargo-${{ runner.os }}-panic-unwind- | ||
| cargo-${{ runner.os }}- | ||
|
|
||
| # Verify gloo-timers (and any other crate that hosts user closures via | ||
| # `Closure::wrap` / `Closure::once`) still builds cleanly under | ||
| # `panic = "unwind"` against the new `MaybeUnwindSafe` bounds added in | ||
| # wasm-bindgen 0.2.117+. Catches downstream regressions like | ||
| # https://github.com/MattiasBuelens/wasm-streams/pull/35 from creeping in. | ||
|
Collaborator
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.
doesn't this step only test the gloo-timers crate?
Contributor
Author
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 point, I've gone and expanded this to all the crates.
Contributor
Author
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. Updated: the CI step now builds every crate that hosts wasm-bindgen closures (gloo-timers default + futures, gloo-events, gloo-render, gloo-net, gloo-worker) under panic=unwind, and the misleading parenthetical is gone. Also fixed all four sibling crates as part of this PR — see the new commit |
||
| - name: Build crates with panic=unwind | ||
| env: | ||
| RUSTFLAGS: '-Cpanic=unwind' | ||
| run: | | ||
| cargo build -p gloo-timers --target wasm32-unknown-unknown -Zbuild-std=std,panic_unwind | ||
|
|
||
| test-history-wasi: | ||
| name: Test gloo-history WASI | ||
| runs-on: ubuntu-latest | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ rust-version = { workspace = true } | |
| features = ["futures"] | ||
|
|
||
| [dependencies] | ||
| wasm-bindgen = "0.2" | ||
| wasm-bindgen = "0.2.117" | ||
|
Collaborator
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.
But I don't see the problem of being a bit more forward compatible.
Contributor
Author
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. I have guarded all unwind checks with the |
||
| js-sys = { workspace = true } | ||
| futures-core = { version = "0.3", optional = true } | ||
| futures-channel = { version = "0.3", optional = true } | ||
|
|
||
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.
is there an issue for this? An unblocking condition for future maintainers would be good