-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Running "x.py check" and "x.py test" in parallel leads to errors #76661
Comments
So there's several solutions to this:
I am interested in hearing which you think would be preferable. Cc @spastorino |
If they could run truly in parallel that would be great. However, a separate build dir also means the bootstrap rustc is downloaded again, right? That would not be great. |
Yes, option 1 would duplicate the stage0 rustc downloads. Option 3, though, would not - it's probably the right choice I think since x.py check is somewhat unique in being the most likely to be invoked in parallel. |
@Mark-Simulacrum in an ideal world, would fixing #65427 also fix this? |
Not really. It might even make things worse. rustbuild uses the same stamps for both check and build steps (and sysroots etc) so when both are running simultaneously we will stomp all over the other, which is going to lead to incorrect behavior. |
I was not able to replicate this. On my machine running both in parallel gives
|
Ok, I figured out when this happens: you need one terminal to be building the compiler while the other is building libstd. If both are building libstd this error doesn't show up. |
I think this can also lead to losing the build cache... at least I just had a case where after showing this error, it then (on the next attempt) proceeded to rebuild the crate graph rustc depends on, instead of just the crate that I changed. |
FYI option 3 was seen as too big a hammer in #77779 (comment); the proposed fix was to use a build lock on the sysroot instead, the same way cargo has a build lock for |
I think that's not quite accurate, in #77779 the specialization was too specific (i.e., the problem is more widespread, any two x.py runs can touch shared files currently). "Insufficiently big hammer" is probably the right description of option 3. |
@rustbot claim |
…Simulacrum Lock bootstrap (x.py) build directory Closes rust-lang#76661, closes rust-lang#80849, `x.py` creates a lock file at `project_root/lock.db` r? `@jyn514` , because he was one that told me about this~
…Simulacrum Lock bootstrap (x.py) build directory Closes rust-lang#76661, closes rust-lang#80849, `x.py` creates a lock file at `project_root/lock.db` r? ``@jyn514`` , because he was one that told me about this~
I am afraid this is still not working properly: when I run
but once vscode is done, all that happens is that the |
Ah: https://github.com/rust-lang/rust/pull/88310/files#diff-9e25a089f077eae8c8cefe9586cc07498e64cd950be4c954cb90e4245e5f9fc3R42-R46 looks like it missed actually breaking out of that loop -- happy to accept a PR to do so. |
@worldeva is that something you could take a look at? |
…lacrum Break the loop A missing break statement lead to an infinite loop in bootstrap.py. I also added a short sleep so it's not constantly running at 100%. But I can remove that if it's not wanted. Fixes rust-lang#76661
…lacrum Break the loop A missing break statement lead to an infinite loop in bootstrap.py. I also added a short sleep so it's not constantly running at 100%. But I can remove that if it's not wanted. Fixes rust-lang#76661
…lacrum Break the loop A missing break statement lead to an infinite loop in bootstrap.py. I also added a short sleep so it's not constantly running at 100%. But I can remove that if it's not wanted. Fixes rust-lang#76661
Since I started using vscode, it is now often the case that the
./x.py check library/std
which vscode runs is still not done when I alt-tab back to my terminal to do (for example)./x.py test --stage 0 library/core --test-args slice
. That regularly leads to errors like this:In those cases, just running
x.py test
again solves the problem -- but it would still be better if having vscode run in background would not break what I do in the terminal.Cc @Mark-Simulacrum
The text was updated successfully, but these errors were encountered: