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

Add polonius compare mode #51138

Merged
merged 3 commits into from
May 31, 2018
Merged

Conversation

spastorino
Copy link
Member

@spastorino spastorino commented May 28, 2018

This is now ready to review/merge

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(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 May 28, 2018
@nikomatsakis nikomatsakis changed the title Add polonius compare mode [WIP] Add polonius compare mode May 28, 2018
@spastorino spastorino force-pushed the add-polonius-compare-mode branch 2 times, most recently from 1207f82 to 539a6f0 Compare May 28, 2018 22:58
if !path.exists() && self.config.compare_mode.is_some() {
// fallback!

if !path.exists() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is a bit more hard-coded than I expected, but I imagine it does the right thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's not worth making a super general mechanism here, given that we'll hopefully be removing polonius and nll "soon".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I expected was some kind of table where, for each compare-mode, we specify a "parent" mode (which may be None for nll) — and we iterate through modes, walking to their parents (and ultimately to a None mode) — looking for a path that exists.

if let Some(compare_mode) = builder.config.cmd.compare_mode() {
cmd.arg("--compare-mode").arg(compare_mode);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be some very similar logic a few lines below:

https://github.com/spastorino/rust/blob/fb2a51225f26f8acf39e482d916f112265c81d35/src/bootstrap/test.rs#L1136-L1143

It seems like there is a compare_mode that comes from the test directory configuration as well as one (now) that you have added to builder.config.cmd. Perhaps we want to just change this line to something like this:

let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);

(This is giving precedence to the --compare-mode option from the command line, which seems appropriate.)

(Alternatively, we could error if compare-mode is given both in the command line and the test suite definition; I think that the latter (test suite) can only occur when running ./x.py test, in which case the command line probably ought not to be in use.)

@michaelwoerister
Copy link
Member

r? @nikomatsakis

@spastorino
Copy link
Member Author

Have just force pushed this again. Still needs #51133 merged.

@spastorino spastorino changed the title [WIP] Add polonius compare mode Add polonius compare mode May 29, 2018
@rust-lang rust-lang deleted a comment from rust-highfive May 29, 2018
@rust-lang rust-lang deleted a comment from rust-highfive May 29, 2018
@rust-lang rust-lang deleted a comment from rust-highfive May 29, 2018
@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 29, 2018

📌 Commit 74d48ed has been approved by pnkfelix

@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 May 29, 2018
@bors
Copy link
Contributor

bors commented May 30, 2018

🔒 Merge conflict

@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 May 30, 2018
@nikomatsakis
Copy link
Contributor

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented May 30, 2018

📌 Commit a73b4d7 has been approved by pnkfelix

@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 May 30, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:02:03]    Compiling bootstrap v0.0.0 (file:///checkout/src/bootstrap)
[00:02:06] error[E0308]: mismatched types
[00:02:06]     --> bootstrap/test.rs:1004:65
[00:02:06]      |
[00:02:06] 1004 |         let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);
[00:02:06]      |
[00:02:06]      |
[00:02:06]      = note: expected type `std::option::Option<&std::string::String>`
[00:02:06]                 found type `std::option::Option<&'static str>`
[00:02:08] error: aborting due to previous error
[00:02:08] 
[00:02:08] For more information about this error, try `rustc --explain E0308`.
[00:02:08] For more information about this error, try `rustc --explain E0308`.
[00:02:08] error: Could not compile `bootstrap`.
[00:02:08] To learn more, run the command again with --verbose.
[00:02:08] To learn more, run the command again with --verbose.
[00:02:08] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:08] Build completed unsuccessfully in 0:01:09
[00:02:08] make: *** [prepare] Error 1
[00:02:08] Makefile:81: recipe for target 'prepare' failed
[00:02:09]    Compiling bootstrap v0.0.0 (file:///checkout/src/bootstrap)
[00:02:12] error[E0308]: mismatched types
[00:02:12]     --> bootstrap/test.rs:1004:65
[00:02:12]      |
[00:02:12]      |
[00:02:12] 1004 |         let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);
[00:02:12]      |
[00:02:12]      |
[00:02:12]      = note: expected type `std::option::Option<&std::string::String>`
[00:02:12]                 found type `std::option::Option<&'static str>`
[00:02:14] error: aborting due to previous error
[00:02:14] 
[00:02:14] For more information about this error, try `rustc --explain E0308`.
[00:02:14] For more information about this error, try `rustc --explain E0308`.
[00:02:14] error: Could not compile `bootstrap`.
[00:02:14] To learn more, run the command again with --verbose.
[00:02:14] To learn more, run the command again with --verbose.
[00:02:14] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:14] Build completed unsuccessfully in 0:00:04
[00:02:14] Makefile:81: recipe for target 'prepare' failed
[00:02:14] make: *** [prepare] Error 1
[00:02:16]    Compiling bootstrap v0.0.0 (file:///checkout/src/bootstrap)
[00:02:19] error[E0308]: mismatched types
[00:02:19]     --> bootstrap/test.rs:1004:65
[00:02:19]      |
[00:02:19]      |
[00:02:19] 1004 |         let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);
[00:02:19]      |
[00:02:19]      |
[00:02:19]      = note: expected type `std::option::Option<&std::string::String>`
[00:02:19]                 found type `std::option::Option<&'static str>`
[00:02:21] error: aborting due to previous error
[00:02:21] 
[00:02:21] For more information about this error, try `rustc --explain E0308`.
[00:02:21] For more information about this error, try `rustc --explain E0308`.
[00:02:21] error: Could not compile `bootstrap`.
[00:02:21] To learn more, run the command again with --verbose.
[00:02:21] To learn more, run the command again with --verbose.
[00:02:21] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:21] Build completed unsuccessfully in 0:00:05
[00:02:21] make: *** [prepare] Error 1
[00:02:21] Makefile:81: recipe for target 'prepare' failed
[00:02:24]    Compiling bootstrap v0.0.0 (file:///checkout/src/bootstrap)
[00:02:27] error[E0308]: mismatched types
[00:02:27]     --> bootstrap/test.rs:1004:65
[00:02:27]      |
[00:02:27]      |
[00:02:27] 1004 |         let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);
[00:02:27]      |
[00:02:27]      |
[00:02:27]      = note: expected type `std::option::Option<&std::string::String>`
[00:02:27]                 found type `std::option::Option<&'static str>`
[00:02:29] error: aborting due to previous error
[00:02:29] 
[00:02:29] For more information about this error, try `rustc --explain E0308`.
[00:02:29] For more information about this error, try `rustc --explain E0308`.
[00:02:29] error: Could not compile `bootstrap`.
[00:02:29] To learn more, run the command again with --verbose.
[00:02:29] To learn more, run the command again with --verbose.
[00:02:29] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:29] Build completed unsuccessfully in 0:00:05
[00:02:29] make: *** [prepare] Error 1
[00:02:29] Makefile:81: recipe for target 'prepare' failed
[00:02:33]    Compiling bootstrap v0.0.0 (file:///checkout/src/bootstrap)
[00:02:36] error[E0308]: mismatched types
[00:02:36]     --> bootstrap/test.rs:1004:65
[00:02:36]      |
[00:02:36]      |
[00:02:36] 1004 |         let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);
[00:02:36]      |
[00:02:36]      |
[00:02:36]      = note: expected type `std::option::Option<&std::string::String>`
[00:02:36]                 found type `std::option::Option<&'static str>`
[00:02:38] error: aborting due to previous error
[00:02:38] 
[00:02:38] For more information about this error, try `rustc --explain E0308`.
[00:02:38] For more information about this error, try `rustc --explain E0308`.
[00:02:39] error: Could not compile `bootstrap`.
[00:02:39] To learn more, run the command again with --verbose.
[00:02:39] To learn more, run the command again with --verbose.
[00:02:39] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:39] Build completed unsuccessfully in 0:00:05
[00:02:39] Makefile:81: recipe for target 'prepare' failed
[00:02:39] make: *** [prepare] Error 1
[00:02:39] The command has failed after 5 attempts.
odules/src/jemalloc/objects
7796 ./.git/modules/src/jemalloc/objects/pack
7304 ./src/llvm/test/CodeGen/ARM
7096 ./src/llvm-emscripten/lib/Transforms
6916 ./src/llvm/test/tools/sancov
6912 ./src/llvm-emscripten/test/tools/sancov

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nikomatsakis
Copy link
Contributor

@bors r-

@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 May 30, 2018
@nikomatsakis
Copy link
Contributor

(Travis failure)

@nikomatsakis
Copy link
Contributor

nikomatsakis commented May 30, 2018

@bosr r=pnkfelix

sorry @bosr =)

@nikomatsakis
Copy link
Contributor

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented May 30, 2018

📌 Commit b39a1d6 has been approved by pnkfelix

@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 May 30, 2018
@bors
Copy link
Contributor

bors commented May 30, 2018

⌛ Testing commit b39a1d6 with merge e1eed38...

bors added a commit that referenced this pull request May 30, 2018
Add polonius compare mode

**This is now ready to review/merge**
@bors
Copy link
Contributor

bors commented May 31, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pnkfelix
Pushing e1eed38 to master...

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