Skip to content

rustc: Stabilize #[wasm_import_module] #52441

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

Closed

Conversation

alexcrichton
Copy link
Member

This commit stabilizes the #[wasm_import_module] attribute. Tracked by #52090
this issue can be attached to foreign modules (extern { ... } blocks) and is
used to configured the module name that the imports are listed with. The
WebAssembly specification indicates two utf-8 names are associated with all
imported items, one for the module the item comes from and one for the item
itself. The item itself is configurable in Rust via its identifier or
#[link_name = "..."], but the module name was previously not configurable and
defaulted to "env". This commit ensures that this is also configurable.

Closes #52090

@rust-highfive
Copy link
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2018
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:06:06] Caused by:
[00:06:06]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name syntax libsyntax/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=4f33c70c5f92f8b7 -C extra-filename=-4f33c70c5f92f8b7 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-693c666d349ae1b6.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-96863e4e4a7d8742.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-7b2393552f7c05ab.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-5a587f583bd26ea0.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-5aa06a687b1a439d.so --extern scoped_tls=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-2d0488f0587a9fe8.rlib --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5615a04cb21f88e7.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5615a04cb21f88e7.rlib --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-4e87684380615cae.so` (exit code: 101)
[00:06:06] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:06:06] expected success, got: exit code: 101
[00:06:06] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1119:9
[00:06:06] travis_fold:end:stage0-rustc

[00:06:06] travis_time:end:stage0-rustc:start=1531766435187700947,finish=1531766505809785576,duration=70622084629


[00:06:06] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:06:06] Build completed unsuccessfully in 0:02:12
[00:06:06] Makefile:28: recipe for target 'all' failed
[00:06:06] make: *** [all] Error 1

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

This commit stabilizes the `#[wasm_import_module]` attribute. Tracked by rust-lang#52090
this issue can be attached to foreign modules (`extern { ... }` blocks) and is
used to configured the module name that the imports are listed with. The
WebAssembly specification indicates two utf-8 names are associated with all
imported items, one for the module the item comes from and one for the item
itself. The item itself is configurable in Rust via its identifier or
`#[link_name = "..."]`, but the module name was previously not configurable and
defaulted to `"env"`. This commit ensures that this is also configurable.

Closes rust-lang#52090
@petrochenkov
Copy link
Contributor

Looks like the sentiment in #52090 (comment) was to make it a modifier on #[link].

@alexcrichton
Copy link
Member Author

Er argh yes, forgot about that! Thanks for the reminder, I'll make a new PR soon

@alexcrichton
Copy link
Member Author

New PR is at #52445

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants