-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Refactor dist tarballs generation #79788
Conversation
I'm probably not going to get a chance to review this until the weekend at the earliest -- is this blocking some work? If so I could potentially fit it in but it'd be a bit rough. |
It's not blocking any work, the next task for me on this project is to change |
This looks amazing to me -- I noted one typo, and I'm sure I might've missed others, but I don't think that should block (we can patch things up if we notice them later). It seems good to get this landed quickly so we're not landing it around the release (so we can fix things on master without worrying about backports). r=me with typo fixed -- up to you on @Keruspe's comment. |
@bors r=Mark-Simulacrum |
📌 Commit 272838e3f60487a40e25363e6f681dfd011234dc has been approved by |
⌛ Testing commit 272838e3f60487a40e25363e6f681dfd011234dc with merge de7ce5c3f8869f3288d1fb9480fdcd985362f15a... |
💔 Test failed - checks-actions |
@bors try |
⌛ Trying commit 272838e3f60487a40e25363e6f681dfd011234dc with merge 80acf4fa64fccb397fb4cec1d663dd473f492507... |
FWIW I think git absorb or similar should make it easy to avoid the "fix review comments" commit, but since this would still have 21 commits - which seems right - I am not going to block on that. |
💔 Test failed - checks-actions |
272838e
to
6a66aa4
Compare
Ok should've fixed the CI failure (I also amended the commit history). @bors try |
⌛ Trying commit 6a66aa4a263a3cd7586b723ec589c2f739e233ef with merge bf52e3fae8d78a18529a0c726ce78238217c20e8... |
☀️ Try build successful - checks-actions |
@bors r+ |
📌 Commit 8736731 has been approved by |
☀️ Test successful - checks-actions |
if I didn't mess myself, with this PR, the current nightly tarball extracts inside does such name will stick on release too (instead of |
Yeah, at least rustc-nightly-src changed. Looking into a fix now. |
This fixes a bug introduced by rust-lang#79788.
Fix should be up in #80397, and seems to work locally. |
…ietroalbini Use package name for top-level directory in bare tarballs This fixes a bug introduced by rust-lang#79788. r? `@pietroalbini`
Sorry about that! |
…mulacrum Fix broken ./x.py install During my tarball refactorings in rust-lang#79788 I changed the directory layout used by the tarball generation code, and that broke the other parts of rustbuild which hardcoded the paths of those directories. Namely, `./x.py install` relied on the uncompressed copy of the tarball left behind by `fabricate`/`rust-installer`, causing rust-lang#80494. While the easy fix for rust-lang#80494 would've been to just update the hardcoded paths to match the new structure, that fix would leave us in the same situation if we were to change the directory layout again in the future. Instead I refactored the code to return a `GeneratedTarball` struct as the output of all the dist steps, and I put all the paths the rest of rustbuild needs to care about in its fields. That way, future changes to `src/bootstrap/tarball.rs` will not break other stuff. This PR is best reviewed commit-by-commit. r? `@Mark-Simulacrum` `@rustbot` modify labels: beta-nominated beta-accepted T-release
This fixes a bug introduced by rust-lang#79788.
…mulacrum Fix broken ./x.py install During my tarball refactorings in rust-lang#79788 I changed the directory layout used by the tarball generation code, and that broke the other parts of rustbuild which hardcoded the paths of those directories. Namely, `./x.py install` relied on the uncompressed copy of the tarball left behind by `fabricate`/`rust-installer`, causing rust-lang#80494. While the easy fix for rust-lang#80494 would've been to just update the hardcoded paths to match the new structure, that fix would leave us in the same situation if we were to change the directory layout again in the future. Instead I refactored the code to return a `GeneratedTarball` struct as the output of all the dist steps, and I put all the paths the rest of rustbuild needs to care about in its fields. That way, future changes to `src/bootstrap/tarball.rs` will not break other stuff. This PR is best reviewed commit-by-commit. r? `@Mark-Simulacrum` `@rustbot` modify labels: beta-nominated beta-accepted T-release
The --bulk-dirs argument was removed for rust-docs in commit c768ce1 and rustc-docs in commit 8ca46fc (rust-lang#79788), presumably by mistake; that slowed down installation of rust-docs from under a second to some twenty *minutes*. Restoring --bulk-dirs reverses this slowdown. Fixes rust-lang#80684. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
…mulacrum bootstrap: Restore missing --bulk-dirs for rust-docs, rustc-docs The `--bulk-dirs` argument was removed for rust-docs in commit c768ce1 and rustc-docs in commit 8ca46fc (rust-lang#79788), presumably by mistake; that slowed down installation of rust-docs from under a second to some twenty *minutes*. Restoring `--bulk-dirs` reverses this slowdown. Fixes rust-lang#80684. Cc `@pietroalbini.`
Before this PR, each tarball we ship as part of a release was generated by manually creating the directory structure and invoking
rust-installer generate
. This means each tarball was slightly different, adding new ones meant copy-pasting the code generating another tarball and removing the useless parts, and more importantly refactoring how tarballs are generated is extremely time-consuming.This PR introduces a new abstraction in rustbuild,
Tarball
. TheTarball
struct provides a trivial API to generate simple tarballs, and can get out of the way when more complex tarballs have to generate. For example, the whole code to generate thebuild-manifest
tarball is now the following:One notable change between the old tarballs and the new ones is that the "overlay" (README.md, COPYRIGHT, LICENSE-APACHE and LICENSE-MIT) is now available in every produced tarball, while before each tarball inconsistently had or didn't have those files. Tarballs that need a different overlay have a way to change which files to include (with the
set_overlay
method):The PR should be reviewed commit-by-commit, as each commit migrated a separate tarball to use
Tarball
. During development i made sure every tarball can still be generated, and for the most compex tarballs I manually ensured the list of files between the old and new tarballs did not have unexpected changes.r? @Mark-Simulacrum