Skip to content
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

error when compiling with --allow warnings and --target wasm32-unknown-unknown #8010

Open
dakom opened this issue Mar 17, 2020 · 3 comments
Open
Labels
A-rustflags Area: rustflags C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@dakom
Copy link

dakom commented Mar 17, 2020

When I set RUSTFLAGS="--allow warnings" and try to cargo build --target wasm32-unknown-unknown I get the following error:

error: output of --print=file-names has changed in the compiler, cannot parse
command was: `rustc - --crate-name ___ --print=file-names --allow warnings --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`

rustc 1.43.0-nightly (564758c4c 2020-03-08)
cargo 1.43.0-nightly (bda5051 2020-03-02)

originally filed here: rust-lang/rust#70070

@dakom dakom added the C-bug Category: bug label Mar 17, 2020
@ehuss
Copy link
Contributor

ehuss commented Mar 17, 2020

Hm, that's a tricky one. The --allow warnings prevents these lines from being printed:

warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`
warning: dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`

This is required by Cargo in order to know which crate types are valid (and what their output names are).

I don't have any good ideas on how to accommodate this. Some bad ones:

  • Filter RUSTFLAGS to remove things like "--allow".
  • Filter RUSTFLAGS with an allowed list of flags. (Occasionally certain rustc flags cause problems with this code that queries rustc with the --print flag.)
  • Make a better interface in rustc for querying this information (maybe like a more structured format like JSON).
    • Or a similar option would be for rustc to print some kind of separator between the different groups of output.

@ehuss ehuss added the A-rustflags Area: rustflags label Apr 15, 2020
Anton-4 added a commit to roc-lang/roc that referenced this issue May 20, 2022
see rust-lang/cargo#8010 on why I removed RUSTFLAGS="-Awarnings"
@epage
Copy link
Contributor

epage commented Nov 3, 2023

If we had #8424, I wonder if we could still show that warning.

@epage epage added the S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. label Nov 3, 2023
@ia0
Copy link

ia0 commented Nov 10, 2023

This bug is quite annoying because I'm not sure how to work around it right now. Even when specifying the crate type I get the error:

RUSTFLAGS=--allow=warnings cargo rustc --crate-type=cdylib --target=wasm32-unknown-unknown

The best I found so far is to just ignore all the output:

cargo check --target=wasm32-unknown-unknown 2>/dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustflags Area: rustflags C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

4 participants