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

x.py build --warnings deny does not fail despite warnings #62402

Closed
RalfJung opened this issue Jul 5, 2019 · 2 comments · Fixed by #62406
Closed

x.py build --warnings deny does not fail despite warnings #62402

RalfJung opened this issue Jul 5, 2019 · 2 comments · Fixed by #62406
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Jul 5, 2019

I patched libstd and wanted to be sure it builds without warnings, so I did:

$ ./x.py build --stage 0 src/libstd --warnings deny

However, this build succeeded despite there being warnings:

Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
warning: /home/r/src/rust/rustc.3/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
   Compiling cc v1.0.35
   Compiling core v0.0.0 (/home/r/src/rust/rustc.3/src/libcore)
   Compiling build_helper v0.1.0 (/home/r/src/rust/rustc.3/src/build_helper)
   Compiling autocfg v0.1.4
   Compiling backtrace v0.3.29
   Compiling compiler_builtins v0.1.16
   Compiling backtrace-sys v0.1.27
   Compiling cmake v0.1.38
   Compiling std v0.0.0 (/home/r/src/rust/rustc.3/src/libstd)
   Compiling rustc_msan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_msan)
   Compiling rustc_lsan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_lsan)
   Compiling rustc_asan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_asan)
   Compiling rustc_tsan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_tsan)
   Compiling unwind v0.0.0 (/home/r/src/rust/rustc.3/src/libunwind)
   Compiling rustc-std-workspace-core v1.0.0 (/home/r/src/rust/rustc.3/src/tools/rustc-std-workspace-core)
   Compiling libc v0.2.54
   Compiling alloc v0.0.0 (/home/r/src/rust/rustc.3/src/liballoc)
   Compiling cfg-if v0.1.8
   Compiling rustc-demangle v0.1.15
   Compiling panic_abort v0.0.0 (/home/r/src/rust/rustc.3/src/libpanic_abort)
   Compiling rustc-std-workspace-alloc v1.0.0 (/home/r/src/rust/rustc.3/src/tools/rustc-std-workspace-alloc)
   Compiling panic_unwind v0.0.0 (/home/r/src/rust/rustc.3/src/libpanic_unwind)
   Compiling hashbrown v0.4.0
warning: use of item 'core::mem::uninitialized' that will be deprecated in future version 1.38.0: use `mem::MaybeUninit` instead
  --> src/libstd/io/util.rs:48:54
   |
48 |         let mut buf: [u8; super::DEFAULT_BUF_SIZE] = mem::uninitialized();
   |                                                      ^^^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> src/libstd/lib.rs:208:9
   |
208| #![warn(deprecated_in_future)]
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of item 'sync::once::ONCE_INIT' that will be deprecated in future version 1.38.0: the `new` function is now preferred
   --> src/libstd/sync/mod.rs:167:39
    |
167 | pub use self::once::{Once, OnceState, ONCE_INIT};
    |                                       ^^^^^^^^^

    Finished release [optimized] target(s) in 31.86s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Build completed successfully in 0:00:32

I have deny-warnings = false in my config.toml, but that shouldn't render --warnings unusable (at least, the help for --warnings does not say anything like that). In fact, it seems like the flag would be a NOP anyway with deny-warnings = true?

Also, --warnings denyyyy just builds fine, so it seems like there is no input sensitization going on.

@pnkfelix pnkfelix added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 5, 2019
@Mark-Simulacrum
Copy link
Member

Fixed in #62406

@RalfJung
Copy link
Member Author

RalfJung commented Jul 5, 2019

Wow, so fast. :-)

Centril added a commit to Centril/rust that referenced this issue Jul 5, 2019
…lfJung

Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

Fixes rust-lang#62402

r? @RalfJung
Centril added a commit to Centril/rust that referenced this issue Jul 5, 2019
…lfJung

Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

Fixes rust-lang#62402

r? @RalfJung
Centril added a commit to Centril/rust that referenced this issue Jul 5, 2019
…lfJung

Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

Fixes rust-lang#62402

r? @RalfJung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants