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

Ensure edition lints and internal lints are enabled with deny-warnings=false #64098

Merged
merged 2 commits into from
Sep 7, 2019

Conversation

Mark-Simulacrum
Copy link
Member

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes --warnings=allow to --warnings=warn which is what that flag actually did; we don't have an allow warnings mode.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(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 Sep 2, 2019
@alexcrichton
Copy link
Member

While you're touching this code, would you be up for tweaking how this is handled? Ideally this would be removed from bin/rustc.rs entirely and just moved to RUSTFLAGS when we invoke Cargo, and I think that would work?

@Mark-Simulacrum
Copy link
Member Author

We don't set this for external tools (submodules) and I'd rather not thread that information through into Builder::cargo since it's a bit out there so it'd be somewhat hard I think to do that in a good way, but happy to implement something if you have good ideas.

@Mark-Simulacrum
Copy link
Member Author

It also looks like RUSTFLAGS might be somewhat a poor fit for us since Cargo will AFAICT only pass that to non-build-scripts (and presumably non-proc-macros; though not sure there) due to us passing --target unless I've misinterpreted something.

src/bootstrap/bin/rustc.rs Outdated Show resolved Hide resolved
@Mark-Simulacrum Mark-Simulacrum force-pushed the always-warn branch 2 times, most recently from 1dbc772 to 6f959fa Compare September 4, 2019 13:09
@alexcrichton
Copy link
Member

We already have a mode in Builder::cargo, and we can presumably only enable this for non-Tool builds?

@Mark-Simulacrum
Copy link
Member Author

Yeah, I think it might be easiest to just add the tool type (submodule or not) to the Mode enum; I do think it makes some sense to try to deny warnings for the in-tree tools. I'll take a look at that in a bit.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 4, 2019
@Mark-Simulacrum
Copy link
Member Author

Okay, moved most of the warning code out. Some of it is dependent on the specific crate we're compiling which means we can't actually move it out unfortunately, not sure if we can do anything about that though :/

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 4, 2019
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 4, 2019

📌 Commit a2384cb has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 4, 2019
Centril added a commit to Centril/rust that referenced this pull request Sep 5, 2019
…crichton

Ensure edition lints and internal lints are enabled with deny-warnings=false

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes `--warnings=allow` to `--warnings=warn` which is what that flag actually did; we don't have an allow warnings mode.
Centril added a commit to Centril/rust that referenced this pull request Sep 5, 2019
…crichton

Ensure edition lints and internal lints are enabled with deny-warnings=false

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes `--warnings=allow` to `--warnings=warn` which is what that flag actually did; we don't have an allow warnings mode.
@Centril
Copy link
Contributor

Centril commented Sep 5, 2019

Failed in #64168 (comment), @bors r-

@bors
Copy link
Contributor

bors commented Sep 5, 2019

📌 Commit c6f868f has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 5, 2019
Centril added a commit to Centril/rust that referenced this pull request Sep 6, 2019
…crichton

Ensure edition lints and internal lints are enabled with deny-warnings=false

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes `--warnings=allow` to `--warnings=warn` which is what that flag actually did; we don't have an allow warnings mode.
bors added a commit that referenced this pull request Sep 6, 2019
Rollup of 9 pull requests

Successful merges:

 - #64067 (Remove no-prefer-dynamic from valgrind tests)
 - #64078 (compiletest: disable -Aunused for run-pass tests)
 - #64096 (Fix regex replacement in theme detection)
 - #64098 (Ensure edition lints and internal lints are enabled with deny-warnings=false)
 - #64166 (Better way of conditioning the sanitizer builds)
 - #64189 (annotate-snippet emitter: Deal with multispans from macros, too)
 - #64202 (Fixed grammar/style in some error messages)
 - #64206 (annotate-snippet emitter: Update an issue number)
 - #64208 (it's more pythonic to use 'is not None' in python files)

Failed merges:

r? @ghost
@Centril
Copy link
Contributor

Centril commented Sep 6, 2019

@bors p=50

Want to eliminate this PR as the cause of failure in #64164 and #64216.

@Centril
Copy link
Contributor

Centril commented Sep 6, 2019

@bors rollup=never

bors added a commit that referenced this pull request Sep 6, 2019
[WIP] Verify if #64098 causes link errors

cc @Centril for `try` command
@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 6, 2019
@Mark-Simulacrum
Copy link
Member Author

Determined the cause of the problem. The dist-various-2 builder uses CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS (among others) to pass some linker arguments into rustc for that target, which Cargo will ignore if RUSTFLAGS is set in the environment. I don't think this PR is the right place to try and refactor our handling of rustflags and how to correctly pull in, so I've dropped the last two commits.

r? @alexcrichton on this decision

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 6, 2019
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 6, 2019

📌 Commit fda251b has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 6, 2019
Centril added a commit to Centril/rust that referenced this pull request Sep 7, 2019
…crichton

Ensure edition lints and internal lints are enabled with deny-warnings=false

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes `--warnings=allow` to `--warnings=warn` which is what that flag actually did; we don't have an allow warnings mode.
Centril added a commit to Centril/rust that referenced this pull request Sep 7, 2019
…crichton

Ensure edition lints and internal lints are enabled with deny-warnings=false

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes `--warnings=allow` to `--warnings=warn` which is what that flag actually did; we don't have an allow warnings mode.
Centril added a commit to Centril/rust that referenced this pull request Sep 7, 2019
…crichton

Ensure edition lints and internal lints are enabled with deny-warnings=false

Previously we only passed the deny command line flags if deny-warnings was enabled, but now we either pass -W... or -D... for each of the flags as appropriate.

This is also a breaking change to x.py as it changes `--warnings=allow` to `--warnings=warn` which is what that flag actually did; we don't have an allow warnings mode.
bors added a commit that referenced this pull request Sep 7, 2019
Rollup of 7 pull requests

Successful merges:

 - #64023 (libstd fuchsia fixes)
 - #64098 (Ensure edition lints and internal lints are enabled with deny-warnings=false)
 - #64139 (Migrate internal diagnostic registration to macro_rules)
 - #64226 (Aggregation of cosmetic changes made during work on REPL PRs: libsyntax)
 - #64227 (Aggregation of cosmetic changes made during work on REPL PRs: librustc)
 - #64235 (Upgrade env_logger to 0.6)
 - #64258 (compiletest: Match suffixed environments)

Failed merges:

r? @ghost
@bors bors merged commit fda251b into rust-lang:master Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants