-
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
Support downloading bootstrap from CI in shell scripts #102282
Conversation
0c8350d
to
366399a
Compare
This comment has been minimized.
This comment has been minimized.
366399a
to
821d3b3
Compare
huh, that worked quicker than I expected |
I'm feeling like maybe we really should have a shim that manages much of the complexity here. I feel like my envisioning is that our shell scripts should be:
I think a reasonable alternative is that we expect a working Rust installation (not necessarily through rustup) and use that to compile a cargo-less src/bootstrap/entrypoint.rs that can be a shared executable and frankly is much nicer than shell or powershell (at least to my eyes), even without dependencies. I am feeling like we ought to have a living document which we put our plan into and link from all of these PRs, because it seems to me that we are constantly re-debating these points and given my limited time I definitely am reinventing wheels since I can't keep all the context in my head. |
This would indeed be pretty annoying :( A solution that doesn't involve
|
☔ The latest upstream changes (presumably #100557) made this pull request unmergeable. Please resolve the merge conflicts. |
x
Outdated
fi | ||
|
||
latest_commit=$(git rev-list HEAD [email protected] --max-count 1) | ||
if git diff-index --quiet $latest_commit -- src/bootstrap; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be conditional on a config.toml config? A distro probably doesn't want to trigger this logic even if according to git they didn't change bootstrap.
Sorry I keep changing the plan here. I've written up a short document with your If it helps, I think this should be the last PR where we ever have to rehash these details :) after this, the only steps left are to support downloadable bootstrap in python and update the documentation.
Can you talk about this some more? This is the first time I've heard the suggestion - I think it would be somewhat limiting since it would mean we can't use |
I realized that sharing the code between the shim and the main binary without compiling it twice will be annoying; I've updated the hackmd (https://hackmd.io/j-XXBeYERuajJknd6zErPA) with a plan for doing that. |
Did you see the comments I left on that hackmd? |
I didn't, thank you! Left a few responses :) |
Left a comment on the HackMD -- but probably the plan seems broadly good. |
…Simulacrum Make all download functions need only Config, not Builder This also adds a new `mod download` instead of scattering the download code across `config.rs` and `native.rs`. This is the simplest and also most bit-rotty part of rust-lang#102282. Opening it earlier so it's not mixed in with behavior changes and to avoid rebase hell. cc rust-lang#94829 (which nows has the hackmd linked). r? `@Mark-Simulacrum`
9929975
to
6770406
Compare
@bors try (there was a bug in the previous code that the latest commit fixes, the previous try build won't have |
⌛ Trying commit 443bbf085617bcbe313698940066e9d2d9622004 with merge 18b165dc185211a6c919bf0459866c88c35a6ca0... |
0c8cd46
to
3ae67c5
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #103019) made this pull request unmergeable. Please resolve the merge conflicts. |
Here is the commitment for How do you want to handle this PR? @jyn514 You can cherry-pick that commit if you want(I guess this looks better way to deal with), or I can open another PR. |
@ozkanonur I'm happy for you to take over this PR :) I think I would prefer that to a new PR so the previous discussion is easy to find. |
Could you please squash your commist in this PR? 🙂 I will reset my git history with your commit again (so we will have 2 commits(1 for your work, 1 for my) for the PR rather than 9 commits) |
This is needed for when the shell scripts bypass python altogether and run the downloaded bootstrap directly
- Pass `dist bootstrap-shim` explicitly in CI This makes it possible to run `dist bootstrap` without also building bootstrap-shim, and more importantly works around a bug where currently two steps aren't allowed to have the same path. - Add `check::BootstrapShim` - [wip] start unifying parsing for Config and MinimalConfig
3ae67c5
to
bc84983
Compare
@ozkanonur done :) I left the first commit separate because it will also be needed if the python script starts downloading bootstrap, and I want to be able to extract it out into a different PR if necessary. |
fd1bedf
to
fedc51a
Compare
Ok, some more thoughts on the current state: Long-term planI am not sure if downloading bootstrap-shim from CI is the best approach. It seems silly to download two binaries one after the other, and not too hard to run @Mark-Simulacrum do you have thoughts on the right approach here? I know this isn't the plan in the hackmd :( ... I can update it there if that's easier for you. Another thing we can do to avoid this PR bitrotting further is to merge this PR without changes to either the shell-scripts or CI, and have people use Bugs
This is non-trivial to fix with the current arg-parsing setup: either we'd have to share Long-term bugsThese don't have to be fixed right away, but I think we should fix them before turning this on by default.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozkanonur I see you made a partial start on unifying the parsing, but there's still some more logic I'd like to avoid duplicating - in particular, any option on MinimalConfig
should only be set in min_config.rs, not config.rs. I see all the flags still being set in config.rs
.
☔ The latest upstream changes (presumably #108096) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing in favor of #107812 |
Download the beta compiler toolchain in bootstrap if it doesn't yet exist
This is needed for when the shell scripts bypass python altogether and run the downloaded bootstrap directly
Add a new
bootstrap-shim
program and distribute it on nightlySupport downloading bootstrap from CI in the shell script entrypoints
This completely bypasses the python scripts when bootstrap hasn't been modified.
I think we're going to need a way to opt-out of this, probably a new option in config.toml.
Helps with #94829.
r? @Mark-Simulacrum