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

Avoid prematurely recording toolstates #73285

Merged
merged 2 commits into from
Jun 16, 2020

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Jun 12, 2020

When we're running with dry_run enabled (i.e. all builds do this initially), we're
guaranteed to save of a toolstate of TestFail for tools that aren't tested. In practice,
we do test tools as well, so for those tools we would initially record them as being
TestPass, and then later on re-record the correct state after actually testing them.
However, this would not work well if the build failed for whatever reason (e.g. panicking
in bootstrap, or as was the case in #73097, clippy failing to test successfully), we would
just go on believing that things passed when they in practice did not.

This commit also adjusts saving toolstate to never record clippy explicitly (otherwise, it
would be recorded when building it); eventually that'll likely move to other tools as well
but not yet. This is deemed simpler than checking everywhere we generically save
toolstate.

We also move clippy out of the "toolstate" no-fail-fast build into a separate x.py
invocation; this should no longer be technically required but provides the nice state of
letting us check toolstate for all tools and only then check clippy (giving full results
on every build).

r? @oli-obk

Supercedes #73275, also fixes #73274

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 12, 2020
@Mark-Simulacrum
Copy link
Member Author

@bors rollup=never p=1

(When this is approved we should get it in quickly, as it will fix toolstate tracking, at least according to local testing).

@oli-obk
Copy link
Contributor

oli-obk commented Jun 12, 2020

After your previous change with the clippy tool, the PR didn't fail even though clippy wasn't testing successfully. Any idea what's up with that?

@oli-obk
Copy link
Contributor

oli-obk commented Jun 12, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jun 12, 2020

📌 Commit 6baf9db8fb09e573b4caf815bf9f0d33b5ca9b56 has been approved by oli-obk

@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 Jun 12, 2020
@Mark-Simulacrum
Copy link
Member Author

I believe that's because clippy was failing the build but that build was explicitly allowed to fail on the tools builder. This moves clippy out of that permissible failure invocation which should fix that bug.

@Mark-Simulacrum
Copy link
Member Author

I think my "technically not required" is still true because we would fail the build with these changes if the checking was left as before too, since the check step now properly verifies that all known tools are present.

@RalfJung
Copy link
Member

we're
guaranteed to save of a toolstate of TestFail for tools that aren't tested. In practice,
we do test tools as well, so for those tools we would initially record them as being
TestPass, and then later on re-record the correct state after actually testing them.

I am very confused. We are guaranteed to save TestFail, and as a consequence they become TestPass? What is happening?^^

@Mark-Simulacrum
Copy link
Member Author

Hm, maybe my wording isn't clear; what I'm trying to get across is that previously in dry_run the tool build and test steps both would save off "all is great" statuses because we don't actually run anything. That meant that e.g. if you ran ./x.py build --dry-run you'd get a toolstate that looked like everything is TestFail. We run ./x.py test --dry-run though (the dry run here is implicit in both cases, it gets run before running any of the normal build steps) and so that saves off the TestPass for all tools.

@RalfJung
Copy link
Member

previously in dry_run the tool build and test steps both would save off "all is great" statuses because we don't actually run anything.
That meant that e.g. if you ran ./x.py build --dry-run you'd get a toolstate that looked like everything is TestFail.

Based on the first sentence, I would have expected the last word in the 2nd sentence to be "TestPass". How can "we always save off all is great" cause a "TestFail" result?

@Mark-Simulacrum
Copy link
Member Author

Because when we check building, and we see that the build succeeded, we call that testfail (it's really build pass, but that doesn't exist AFAIK).

@RalfJung
Copy link
Member

RalfJung commented Jun 13, 2020

Because when we check building, and we see that the build succeeded, we call that testfail (it's really build pass, but that doesn't exist AFAIK).

Oh. That is really confusing naming in this context ("something passed" leads to a state with "fail" in its name), and I think it is what confused be here.

In the final toolstate report, it makes more sense, because there the contrast is test-fail vs test-pass.

@Mark-Simulacrum
Copy link
Member Author

Yep, we could easily add a build-pass state but since we always try to run tests if the build passed it's not currently useful. I guess in the future we might want tools that are built but not tested, in which case it would make more sense as a dedicated state. I'd not personally object to adding a dedicated state now, too, just for easier interpretation, but I myself probably don't have the time to do so :)

@bors
Copy link
Contributor

bors commented Jun 14, 2020

⌛ Testing commit 6baf9db8fb09e573b4caf815bf9f0d33b5ca9b56 with merge 9c548b5ca54e6e887ffff1205453f6335054388f...

@bors
Copy link
Contributor

bors commented Jun 14, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 14, 2020
@RalfJung
Copy link
Member

RalfJung commented Jun 15, 2020

Clippy tests currently actually fail, which is why this can't land.
Maybe it should add || true somewhere for now (to not abort CI on clippy test failure), to at least unbreak the other tooks?

When we're running with dry_run enabled (i.e. all builds do this initially), we're
guaranteed to save of a toolstate of TestFail for tools that aren't tested. In practice,
we do test tools as well, so for those tools we would initially record them as being
TestPass, and then later on re-record the correct state after actually testing them.
However, this would not work well if the build failed for whatever reason (e.g. panicking
in bootstrap, or as was the case in 73097, clippy failing to test successfully), we would
just go on believing that things passed when they in practice did not.

This commit also adjusts saving toolstate to never record clippy explicitly (otherwise, it
would be recorded when building it); eventually that'll likely move to other tools as well
but not yet. This is deemed simpler than checking everywhere we generically save
toolstate.

We also move clippy out of the "toolstate" no-fail-fast build into a separate x.py
invocation; this should no longer be technically required but provides the nice state of
letting us check toolstate for all tools and only then check clippy (giving full results
on every build).
@Mark-Simulacrum
Copy link
Member Author

Okay, I've pushed up an update which'll just no longer run clippy's tests. cc @rust-lang/clippy -- we should try to fix clippy's tests upstream and get a clippy-up done soon which reverts the second commit in this PR (399bf38 as of this writing).

r? @oli-obk

@RalfJung
Copy link
Member

I'll approve this to get toolstate fixed. Clippy is in no worse a condition with this PR than before.

@bors r=RalfJung,oli-obk

@bors
Copy link
Contributor

bors commented Jun 15, 2020

📌 Commit 399bf38 has been approved by RalfJung,oli-obk

@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 Jun 15, 2020
@RalfJung
Copy link
Member

@bors p=2

@bors
Copy link
Contributor

bors commented Jun 15, 2020

⌛ Testing commit 399bf38 with merge f22c5e19c643f301307d6dad6de3f1a90a8aa513...

@bors
Copy link
Contributor

bors commented Jun 16, 2020

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 16, 2020
@RalfJung
Copy link
Member

@bors retry

@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 Jun 16, 2020
@RalfJung
Copy link
Member

Windows i686-mingw-2 took 4h15min, just barely too long. :/

@bors
Copy link
Contributor

bors commented Jun 16, 2020

⌛ Testing commit 399bf38 with merge 435f97c...

@bors
Copy link
Contributor

bors commented Jun 16, 2020

☀️ Test successful - checks-azure
Approved by: RalfJung,oli-obk
Pushing 435f97c to master...

@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #73285!

Tested on commit 435f97c.
Direct link to PR: #73285

💔 miri on windows: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
💔 rls on windows: test-pass → build-fail (cc @Xanewok).
💔 rls on linux: test-pass → build-fail (cc @Xanewok).
💔 rustfmt on windows: test-pass → build-fail (cc @topecongiro).
💔 rustfmt on linux: test-pass → build-fail (cc @topecongiro).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jun 16, 2020
Tested on commit rust-lang/rust@435f97c.
Direct link to PR: <rust-lang/rust#73285>

💔 miri on windows: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
💔 rls on windows: test-pass → build-fail (cc @Xanewok).
💔 rls on linux: test-pass → build-fail (cc @Xanewok).
💔 rustfmt on windows: test-pass → build-fail (cc @topecongiro).
💔 rustfmt on linux: test-pass → build-fail (cc @topecongiro).
@Mark-Simulacrum Mark-Simulacrum deleted the clippy-fail branch June 16, 2020 15:01
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Toolstate tracking is broken
6 participants