-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Static variables are not exported when targeting wasm32-unknown-unknown
#88092
Comments
wasm32-unknown-unknown
wasm32-unknown-unknown
@Jake-Shadle I feel/hope #88032 will fix it. It should be in the next nightly, so please test it out and let us know :) |
Hah yes, indeed, I'll close this now, but I guess I am a bit concerned about how this regression could occur since the original PR #67975 included a test specifically for this case, which is still present https://github.com/rust-lang/rust/blob/master/src/test/run-make/wasm-export-all-symbols/verify.js |
@Jake-Shadle As anecdote, this issue was noticed not because of the wasm tests, but because of miri's tests: they are executed after PRs land (except during "no breaking the tools"-week before release) because a tool can similarly be temporarily broken, but people are notified when its tests fail. |
Ahh right, sorry, forgot wasm32 was still a tier 2, thanks for noticing this and linking the fix! |
It appears that #67453 has regressed in nightly, The last working nightly we used was
rustc 1.56.0-nightly (0fa319039 2021-08-12)
, every nightly fromrustc 1.56.0-nightly (5a19ffe1c 2021-08-13)
to the present has failed.I tried this code:
I expected to see this happen:
cargo build --release --target wasm32-unknown-unknown && wasm2wat target/wasm32-unknown-unknown/release/missing_symbols.wasm
In
rustc 1.54.0 (a178d0322 2021-07-26)
, this properly exports theFOO
static.Instead, this happened:
cargo +nightly build --release --target wasm32-unknown-unknown && wasm2wat target/wasm32-unknown-unknown/release/missing_symbols.wasm
In
rustc 1.56.0-nightly (2d2bc94c8 2021-08-15)
,FOO
is not exported.Note that unlike in the previous bug reported in #67453, using
-C link-dead-code
does not exportFOO
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: