Skip to content

cargo relies on unknown crate type warnings to detect if a target supports crate types, which can be suppressed by -Awarnings and thus break cargo's detection #116626

Closed
@cybersoulK

Description

@cybersoulK

When compiling a Rust project for the wasm32-unknown-unknown target with the -Awarnings flag, the following error is encountered:

error: output of --print=file-names missing when learning about target-specific information from rustc
command was: `.../.rustup/toolchains/nightly-2023-07-12-aarch64-apple-darwin/bin/rustc - --crate-name ___ --print=file-names -Awarnings --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=split-debuginfo --print=crate-name --print=cfg`

Steps To Reproduce:

Create blank project
Set RUSTFLAGS to "-Awarnings"
Run the command: cargo build --target wasm32-unknown-unknown

(Tested on Latest Stable as well)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: Command-line interface (CLI) to the compilerC-bugCategory: This is a bug.T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions