Add -Zwasm-proc-macros flag - #160854
Conversation
|
Some changes occurred in src/tools/compiletest cc @jieyouxu
This PR modifies If appropriate, please update This PR modifies If appropriate, please update |
| # | ||
| # The implementation for this has not finished landing, so you probably don't | ||
| # want to enable this right now. | ||
| #rust.wasm-proc-macro = false |
There was a problem hiding this comment.
Maybe use plural macros here?
There was a problem hiding this comment.
Hm, do you think we should do the same for the -Z flag? I feel like it's nice for those to be consistent. I don't have a super strong opinion here either way though.
There was a problem hiding this comment.
The flag already uses plural, right?
There was a problem hiding this comment.
Oh, so it does. I didn't realize :) I guess the compiletest flag must be what I remembered.
I'll go ahead and rename to plural form everywhere then.
There was a problem hiding this comment.
Or you remembered the PR title, as that incorrectly has the flag as singular.
| // | ||
| // wasm32-wasip2 should in principle always be able to link with wasm-component-ld + | ||
| // wasm-ld. This does mean that rust.lld needs to be enabled to build wasm-ld wrapper | ||
| // around rust-lld. |
There was a problem hiding this comment.
@jieyouxu do you know if there is a better way to force usage of the default linker or at least use the linker set for the wasm32-wasip2 target rather than the target that gets tested?
There was a problem hiding this comment.
Hm, I'm afraid I don't recall existing mechanisms to force reusing the "host" linker for the target-being-tested (cross-compile in compiletest was always a bit fishy)
This comment has been minimized.
This comment has been minimized.
This is currently not really implemented, but partial support for it is added in various places across the tree. This is a patch extracted from the wider set of work to make review easier, which wires up: * Unstable flag in rustc * Bootstrap flag to enable using wasm-proc-macros (this needs an extra std compilation, wiring into compiletest) * Partial compiletest support for the flag (mostly just CLI side of things)
9154741 to
6408d38
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| if is_proc_macro_crate && sess.target.is_like_wasm && !sess.opts.unstable_opts.wasm_proc_macros | ||
| { | ||
| sess.dcx().emit_err(diagnostics::UnstableWasmProcMacro); | ||
| } |
There was a problem hiding this comment.
Doesn't have to be in this PR, but we should suppress the panic=abort warning below for wasm proc-macros.
There was a problem hiding this comment.
Yeah, I intentionally left that out to keep this more minimal and not really changing behavior (just plumbing).
There was a problem hiding this comment.
r=me if @jieyouxu agrees with the compiletest changes
There was a problem hiding this comment.
This is reasonable to get us started; the compiletest problem is more general (AFAIK the dual under-test toolchain is its own rabbit hole; tracking in #160917) and isn't worth blocking this over.
|
@bors r=bjorn3,jieyouxu |
…, r=bjorn3,jieyouxu Add -Zwasm-proc-macros flag This is currently not really implemented, but partial support for it is added in various places across the tree. This is a patch extracted from the wider set of work to make review easier, which wires up: * Unstable flag in rustc * Bootstrap flag to enable using wasm-proc-macros (this needs an extra std compilation, wiring into compiletest) * Partial compiletest support for the flag (mostly just CLI side of things) * I suspect this will not work across all platforms but based on success with the full patch it should be enough for Linux, I think. I'd rather get them working on at least one platform and then iterate from there, unless we have clear ideas for improvements now. cc rust-lang#160389 (tracking issue) cc rust-lang#157590 (more complete implementation) r? @bjorn3
…uwer Rollup of 10 pull requests Successful merges: - #160620 (Do not pass `-no-pie` on Windows) - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion) - #160760 (Miri: give the incremental session a chance to finish) - #160854 (Add -Zwasm-proc-macros flag) - #160868 (std: Adjust cfgs again for TLS on WASI) - #160894 (Allow running an arbitrary number of try jobs per PR) - #160790 (rustc-book: update sys-v abi link) - #160878 (Add rust_analyzer to check-cfg names) - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency) - #160920 (No longer mention the removed generic)
…, r=bjorn3,jieyouxu Add -Zwasm-proc-macros flag This is currently not really implemented, but partial support for it is added in various places across the tree. This is a patch extracted from the wider set of work to make review easier, which wires up: * Unstable flag in rustc * Bootstrap flag to enable using wasm-proc-macros (this needs an extra std compilation, wiring into compiletest) * Partial compiletest support for the flag (mostly just CLI side of things) * I suspect this will not work across all platforms but based on success with the full patch it should be enough for Linux, I think. I'd rather get them working on at least one platform and then iterate from there, unless we have clear ideas for improvements now. cc rust-lang#160389 (tracking issue) cc rust-lang#157590 (more complete implementation) r? @bjorn3
…, r=bjorn3,jieyouxu Add -Zwasm-proc-macros flag This is currently not really implemented, but partial support for it is added in various places across the tree. This is a patch extracted from the wider set of work to make review easier, which wires up: * Unstable flag in rustc * Bootstrap flag to enable using wasm-proc-macros (this needs an extra std compilation, wiring into compiletest) * Partial compiletest support for the flag (mostly just CLI side of things) * I suspect this will not work across all platforms but based on success with the full patch it should be enough for Linux, I think. I'd rather get them working on at least one platform and then iterate from there, unless we have clear ideas for improvements now. cc rust-lang#160389 (tracking issue) cc rust-lang#157590 (more complete implementation) r? @bjorn3
…uwer Rollup of 14 pull requests Successful merges: - #160620 (Do not pass `-no-pie` on Windows) - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion) - #160760 (Miri: give the incremental session a chance to finish) - #160854 (Add -Zwasm-proc-macros flag) - #160868 (std: Adjust cfgs again for TLS on WASI) - #160894 (Allow running an arbitrary number of try jobs per PR) - #160790 (rustc-book: update sys-v abi link) - #160878 (Add rust_analyzer to check-cfg names) - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency) - #160920 (No longer mention the removed generic) - #160921 (rustdoc: Fix invalid CSS classes generated for notable items) - #160924 (split up `rustc_session`) - #160934 (Ensure TLS accesses don't call the global allocator through panic) - #160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
…, r=bjorn3,jieyouxu Add -Zwasm-proc-macros flag This is currently not really implemented, but partial support for it is added in various places across the tree. This is a patch extracted from the wider set of work to make review easier, which wires up: * Unstable flag in rustc * Bootstrap flag to enable using wasm-proc-macros (this needs an extra std compilation, wiring into compiletest) * Partial compiletest support for the flag (mostly just CLI side of things) * I suspect this will not work across all platforms but based on success with the full patch it should be enough for Linux, I think. I'd rather get them working on at least one platform and then iterate from there, unless we have clear ideas for improvements now. cc rust-lang#160389 (tracking issue) cc rust-lang#157590 (more complete implementation) r? @bjorn3
Rollup of 14 pull requests Successful merges: - #160620 (Do not pass `-no-pie` on Windows) - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion) - #160854 (Add -Zwasm-proc-macros flag) - #160868 (std: Adjust cfgs again for TLS on WASI) - #160882 (Add basic `splat` support to `rustdoc`) - #160894 (Allow running an arbitrary number of try jobs per PR) - #160790 (rustc-book: update sys-v abi link) - #160878 (Add rust_analyzer to check-cfg names) - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency) - #160920 (No longer mention the removed generic) - #160921 (rustdoc: Fix invalid CSS classes generated for notable items) - #160924 (split up `rustc_session`) - #160934 (Ensure TLS accesses don't call the global allocator through panic) - #160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
This is currently not really implemented, but partial support for it is added in various places across the tree. This is a patch extracted from the wider set of work to make review easier, which wires up:
cc #160389 (tracking issue)
cc #157590 (more complete implementation)
r? @bjorn3