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

Move locking from bootstrap.py to rust bootstrap, using fd-lock #98373

Merged
merged 2 commits into from
Jul 3, 2022

Conversation

joshtriplett
Copy link
Member

@joshtriplett joshtriplett commented Jun 22, 2022

Helps with #94829.

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(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 Jun 22, 2022
@jyn514 jyn514 assigned jyn514 and unassigned Mark-Simulacrum Jun 22, 2022
@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 22, 2022
src/bootstrap/bin/main.rs Outdated Show resolved Hide resolved
src/bootstrap/bin/main.rs Show resolved Hide resolved
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

This is great, thanks! I have a bad feeling CI will fail because of the new dependencies, but r=me otherwise. If it does fail, we should probably have a discussion with Mark / infra team about whether the dependencies are ok.

@jyn514
Copy link
Member

jyn514 commented Jun 22, 2022

Oh, last thing - can you see what the compile times for bootstrap before and after this PR? You can clear only the bootstrap artifacts (and not the stage0 toolchain) with rm -rf build/bootstrap.

@joshtriplett
Copy link
Member Author

On my system, 16.39s before, 16.83s after. I think the new dependencies build almost entirely in parallel with other things.

@Mark-Simulacrum
Copy link
Member

I'm sad we need this many dependencies added, but I suppose they're all fast to compile.

I am a little worried that this is moving the locking into rustbuild, which means that (for example) submodule management is no longer covered by it -- probably amongst several other similar things. Are we confident those behave well when racing two different builds?

@jyn514
Copy link
Member

jyn514 commented Jun 22, 2022

submodule management is no longer covered by it -- probably amongst several other similar things. Are we confident those behave well when racing two different builds

Submodule handling is being moved out of python in #97513, happy to wait until that's merged to land this. The only other major things are downloading the bootstrap toolchain and building rustbuild.

Downloading the toolchain is mostly atomic: we download the files to a temporary directory, then atomically rename them to somewhere in build/cache. Extracting is not atomic but the chance you try and extract the same destination file at once seems vanishingly small - IMO the worst scenario in practice for both of these is doing extra work, which seems ~fine given that this is already best effort.

Cargo already has its own locks for building rustbuild, I'm not worried about that.

@bors
Copy link
Contributor

bors commented Jun 26, 2022

☔ The latest upstream changes (presumably #97513) made this pull request unmergeable. Please resolve the merge conflicts.

@jyn514 jyn514 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 Jun 26, 2022
@joshtriplett
Copy link
Member Author

Rebased.

@jyn514
Copy link
Member

jyn514 commented Jun 30, 2022

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Jun 30, 2022

📌 Commit 5a30316 has been approved by jyn514

@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 Jun 30, 2022
@bors
Copy link
Contributor

bors commented Jul 3, 2022

⌛ Testing commit 5a30316 with merge 0e21a27...

@bors
Copy link
Contributor

bors commented Jul 3, 2022

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing 0e21a27 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 3, 2022
@bors bors merged commit 0e21a27 into rust-lang:master Jul 3, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 3, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0e21a27): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-1.0% -1.0% 2
Improvements 🎉
(secondary)
-2.1% -2.4% 6
All 😿🎉 (primary) -1.0% -1.0% 2

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.9% 3.9% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
2.4% 2.4% 1
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-3.0% -3.2% 3
All 😿🎉 (primary) 2.4% 2.4% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants