-
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
Produce source package in rust-installer format #34366
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks! Could you also update |
The rustbuild system doesn't seem to produce a source tarball at all right now - should I make it produce the vanilla tarball in addition to the |
Oh whoops! Eh it's fine to not do that as part of this PR if you'd prefer, but if you wanna throw it in I'm also fine with that! |
$(Q)$(S)src/rust-installer/gen-installer.sh \ | ||
--product-name=Rust \ | ||
--rel-manifest-dir=rustlib \ | ||
--success-message=Awesome-Source. \ |
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.
lol
cc #19535 |
So after installation of the We've also discussed about the potential to need other source installations, but without concrete use cases. You might imagine that cc @phildawes @alexreg @MarkSwanson this PR is deciding the scheme for storing the installed Rust source on disk. Once we deploy it it will be very hard to change. |
It might also be worth considering the impact on side-by-side installation. Right now it's in theory vaguely possible to install multiple Rust's right on top of each other because of the disambiguated crate names, though in practice there are artifacts in rustlib that are not disambiguated. Putting a single copy of the source at a known location in rustlib means that only one can exist at a time. This is fine for rustup, but not fine for e.g. Linux distros. I think I'm kinda fine just saying that every |
cc @jauhien @vadimcn @sylvestre packaging people. This PR is trying to finalize the storage location for the Rust source code (#19535), for use by various tools, and I want to check what impact it might have on packagers. In rustup it'll be an optional package called The concern I have regarding distro packaging is the impact on side-by-side installation. In particular, if SxS is achieved by just installing multiple revisions of Rust directly on top of each other then this src location doesn't work because multiple revisions will want to put the source there. From previous conversations with @jauhien my impression was that at least Gentoo had a more sophisticated SxS installation scheme of their own. What I would like to do for simplicity is abandon any pretense that Of course distros may not want to use our scheme for installing the source at all, but then they are going to have to deal with the integration with tools separately. |
I've updated rustbuild to produce the two source distributions, and fixed the typo in rustlib. |
@@ -287,6 +289,97 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) { | |||
t!(fs::remove_dir_all(&image)); | |||
} | |||
|
|||
/// Creates the `rust-std` installer component as compiled by `compiler` for the | |||
/// target `target`. |
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.
copy-pasted comment?
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.
Oops
I'd personally lean a bit towards |
I'm glad this is being worked on! |
Let's go with |
Sorry for the dumb question but what is SxS ? |
@sylvestre side-by-side installation, in other words having more than one version of rust (e.g. nightly and stable) installed and usable on the same machine at the same time |
☔ The latest upstream changes (presumably #34611) made this pull request unmergeable. Please resolve the merge conflicts. |
Something to consider re the std-aware cargo RFC: in order to teach cargo how to build std, we're most likely going to end up having cargo look in the sysroot for the source - that is, the source we're packaging in this PR. So far we've not made any particular commitments about what the 'shape' of that source will like, we're just dumping the source tree into ISTM there's also some overlap here with the idea of 'local crates.io mirrors' as well. @alexcrichton does it make sense for Cargo to treat part of the sysroot as a standard local crates.io mirror? I guess I see a few options here:
For the sake of expediency I think I'm inclined to just keep going forward with this patch and force tools like Cargo to do their bust to locate the crates in the source tree. cc @Ericson2314 |
@Diggsey what are the prospects for whipping this patch back into shape? |
Just need to fix the merge conflicts then in that case. |
@brson: Personally, I'd prefer option 3 - roll this out as is, but plan on adding structure. In the end, that results in the same two-phase lookup being written into tools, but rather than privileging rustc (and making every other compiler implementation take a perf hit unless they mimic a historical accident, and one that may change in the future if rustc's repo changes anything), it makes the fallback less and less frequently-hit over time. It's just as expedient for Rust (no extra work before rollout), more expedient for Cargo (implement only the "look for Cargo.toml" path now), and doesn't privilege rustc over future implementations (at least one is already being written as mrustc.) |
@brson this is basically already in the shape of a "path source" that Cargo expects today (or a git repository), so it should interoperate regardless. If we want to work with a local registry or vendored directory then we'd probably want more structure, but as you say I'm fine adding that later. |
Fixed conflicts. |
Failure looks to be spurious, and was caused by |
@bors retry |
⌛ Testing commit 777bd6f with merge 0eefd73... |
💔 Test failed - auto-mac-64-opt-rustbuild |
Ugh... That should fix it for mac. 🍎 🔫 |
@bors r+ |
📌 Commit 511c0d1 has been approved by |
⌛ Testing commit 511c0d1 with merge 7f6705d... |
💔 Test failed - auto-mac-64-opt-rustbuild |
@bors: retry |
⌛ Testing commit 511c0d1 with merge 1447527... |
💔 Test failed - auto-mac-64-opt-rustbuild |
…a tarball Copy source files from rust code Add missing wildcard Remove unused function Remove use of tar --transform
I think this is caused by the addition of the |
Other PRs wouldn't be affected if they didn't change Cargo.toml as far as I know; I think this is true of most PRs. |
Lots of Cargo.lock exists that shouldn't in those logs, for example The Cargo in use to generate these is pinned, it's downloaded as part of the bootstrap process |
@alexcrichton Those files exist in the repository... |
This should fix the tidy check. There were two problems:
|
Produce source package in rust-installer format See rust-lang-deprecated/rust-buildbot#102 There may be a better way to do this, wasn't sure how to clean-up the `rust-src-image` directory when it's used by multiple make rules.
🎆 |
See rust-lang-deprecated/rust-buildbot#102
There may be a better way to do this, wasn't sure how to clean-up the
rust-src-image
directory when it's used by multiple make rules.