-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Write manifest for MAJOR.MINOR channel to enable rustup convenience #76107
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I feel like this is relevant to @Mark-Simulacrum and @pietroalbini 's interests. |
This is basically adding a channel, like stable/nightly/beta for each 1.x release series, I think. This seems like the right approach, mostly, though I do wonder if instead we should just patch rustup to auto-search 1.x.0, 1.x.1, 1.x.2, etc -- we'd at most make 2-3 extra requests for tiny files (and they could be HEAD requests at that). I do worry a bit that presumably when installing, the user wants rustup to consider 1.45 and 1.45.0 to be equivalent, whereas I think with just this patch we would not do so. cc @kinnison as well since this is rustup-related |
I've considered that as well, and it's similar to what rustup does with searching for a nightly that contains all the desired components, so I don't think that approach is unreasonable either. I'm happy to close this and go work on that if that's the consensus. One reason I think this is better is that tools other than rustup could use this functionality as well (although I don't know of anything else concretely that uses these manifests, linux distros? 🤷♀️ )
I'm used to rvm from Ruby land, and it supports saying, for example, |
Right, I mean that I would expect the following behavior:
OTOH, that's not the behavior you get with nightly releases, even if nightly-YYYY-MM-DD is already installed as just "nightly" an install for it will download that nightly again. So maybe this is not actually what we want, I'm not sure. |
This is awesome! Regarding 1.45 vs 1.45.0: I would expect I would propose that if the user asks to install 1.45.0, and a subsequent point release exists, we display a warning that a newer point release exists (including a mention of |
When I discussed this with @pietroalbini previously, we were thinking about a |
Is there anything I could write up that would be helpful? |
If you want to write something up @carols10cents then I'd be grateful. Essentially we need a treatment of all the use-cases we're trying to solve here, and an indication of what goes on behind the scenes, so we can decide if (a) the only thing we need is the channel data, or (b) we'd need some For example, @Mark-Simulacrum 's use case in #76107 (comment) would need However, @joshtriplett 's point about 1.45.0 (in #76107 (comment) ) is actually already the case (in that it would install that .0 release even if .1 etc exists) but the putative warning to emit would need changes to No matter what we pick, We need to understand how everything fits together to know for sure if we have a coherent and unsurprising set of behaviours proposed. Once we do, we can file appropriate issues against |
Hm, so I think for now I'd be fine with rustup behaving for these 1.45 toolchain files just like it does for stable/beta/nightly and the 1.x.y releases/beta-YYYY-MM-DD/nightly-YYYY-MM-DD releases. That is, we would expect each 1.x channel to only represent itself, and explicit installs of parts of that channel would not "see" that channel's prior installation. So this sequence: Let's set the stage as stable=1.45.1.
If this behavior is something we can all agree is reasonable to start with, then I think this change to the manifest builder will probably do what we want, so we can merge this PR. I imagine once it's merged we'll want to go back and either re-generate or copy over manifests from 1.x.max(y) to 1.x for each x, so that we don't magically gain this support for 1.48+. But that's optional, and might not happen for a while if it needs manual work. I imagine we probably want some sort of FCP here -- at least with T-release? I'll let discussion following this post play out a bit but will likely kick off fcp here soon-ish if my opinion (that we should proceed) doesn't change. |
So I'd be fine with the behviour; but it will also need rustup to understand/accept those channel names, otherwise you get: dsilvers@listless:~$ rustup install 1.45
error: invalid toolchain name: '1.45'. Toolchain numbers tend to have three parts, e.g. 1.45.0
dsilvers@listless:~$ |
Yes, that's what I was referring to in my PR description with:
Ah thank you for mentioning this, @Mark-Simulacrum! This did occur to me at some point after opening this but I kept forgetting to come back and say that 😅 I think it can just be a set of
@Mark-Simulacrum also thank you for this write up! I think that all makes sense. I'd also add these scenarios that I think are consistent with what you have here and what would happen without rustup changes other than allowing
|
Yes, the removal behavior is as I would expect (even if it's a bit unfortunate). @rfcbot fcp merge This is proposing that we create a new channel for each stable release (e.g., 1.45) intended to both avoid the annoying "1.45 is not a release" rustup error and for CI and other places where you may want to test that you compile with some 1.x Rust release but want to upgrade to patch releases if they get issued automatically. Support in rustup will happen separately, but (AFAIK) landing this won't hurt that and we believe the rustup support won't need additional patches. FCP is mostly because this is expanding our stable surface area, though I personally expect that we could stop issuing these at any point in the future if we felt it wasn't a good idea anymore. |
Team member @Mark-Simulacrum has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
On Sun, Sep 13, 2020 at 02:40:08PM -0700, Mark Rousskov wrote:
Hm, so I think for now I'd be fine with rustup behaving for these 1.45 toolchain files just like it does for stable/beta/nightly and the 1.x.y releases/beta-YYYY-MM-DD/nightly-YYYY-MM-DD releases. That is, we would expect each 1.x channel to only represent itself, and explicit installs of parts of that channel would not "see" that channel's prior installation. So this sequence:
Let's set the stage as stable=1.45.1.
```
rustup install 1.45.1 # downloads and installs
rustup install 1.45 # downloads and installs 1.45.1, again, but calls it 1.45
rustup install stable # downloads and installs 1.45.1, again, but calls it stable
# We release stable 1.45.2
rustup update # updates 1.45 to 1.45.2, stable to 1.45.2. Does not touch 1.45.1 installation.
```
If this behavior is something we can all agree is reasonable to start with, then I think this change to the manifest builder will probably do what we want, so we can merge this PR.
This seems like reasonable behavior to start with. It'd be nice to
avoid re-downloads of identical files in the future, but that doesn't
seem critical.
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
☔ The latest upstream changes (presumably #77145) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
This connects to rust-lang/rustup#794. It's hard to remember if there have been patch releases for old versions when you'd like to install the latest in a MAJOR.MINOR series. When we're doing a stable release, we write duplicate manifests to `stable`. With this change, only when we're doing a stable release, also write duplicate manifests to `MAJOR.MINOR` to eventually enable rustup (and any other tooling that builds Rust release URLs) to request, say, `1.45` and get `1.45.2` (assuming `1.45.2` is the latest available `1.45` and assuming that we never publish patch releases out of order).
4eca5c2
to
2033eb1
Compare
I rebased to resolve the conflicts with your refactoring PR (omg it's so much nicer now!!) and tested, and I think it still does what I intend, but please re-review and make sure!! |
@pietroalbini good catch! I changed it to look for "stable" instead :) |
Thanks! @bors r+ |
📌 Commit a8fe654 has been approved by |
…as-schievink Rollup of 8 pull requests Successful merges: - rust-lang#75377 (Fix Debug implementations of some of the HashMap and BTreeMap iterator types) - rust-lang#76107 (Write manifest for MAJOR.MINOR channel to enable rustup convenience) - rust-lang#76745 (Move Wrapping<T> ui tests into library) - rust-lang#77182 (Add missing examples for Fd traits) - rust-lang#77251 (Bypass const_item_mutation if const's type has Drop impl) - rust-lang#77264 (Only use LOCAL_{STDOUT,STDERR} when set_{print/panic} is used. ) - rust-lang#77421 (Revert "resolve: Avoid "self-confirming" import resolutions in one more case") - rust-lang#77452 (Permit ty::Bool in const generics for v0 mangling) Failed merges: r? `@ghost`
Now that rust-lang/rust#76107 has been merged, new releases will also write their manifests to channel-rust-1.x.toml as well as channel-rust-1.x.y.toml to enable `rustup install 1.48` to get the latest patch release in a minor release series. This commit adds an idempotent function to copy manifests for the last patch release in every minor release series to the corresponding minor manifest so that past minor versions will work with the rustup functionality too. This function should only need to be run once, but should be safe to run more than once.
Now that rust-lang/rust#76107 has been merged, new releases will also write their manifests to channel-rust-1.x.toml as well as channel-rust-1.x.y.toml to enable `rustup install 1.48` to get the latest patch release in a minor release series. This commit adds an idempotent script to copy manifests and their signatures for the last patch release in every minor release series to the corresponding minor manifest files so that past minor versions will work with the rustup functionality too. This script should only need to be run once, but should be safe to run more than once. It starts at 1.8 because we don't have manifests for 1.0-1.7, and it ends with 1.47 because 1.48 will be the first stable release to write out the 1.x channel manifest.
This connects to rust-lang/rustup#794.
It's hard to remember if there have been patch releases for old versions
when you'd like to install the latest in a MAJOR.MINOR series.
When we're doing a stable release, we write duplicate manifests to
stable
. With this change, only when we're doing a stable release, alsowrite duplicate manifests to
MAJOR.MINOR
to eventually enable rustup(and any other tooling that builds Rust release URLs) to request, say,
1.45
and get1.45.2
(assuming1.45.2
is the latest available1.45
and assuming that we never publish patch releases out of order).I tested the best I could; it's a bit hard to get everything set up right
to be able to run the build-manifest tool. But I was able to run it with
a release of "1.45.2" and in addition to the files like
channel-rust-1.45.2.toml
and
channel-rust-stable.toml
(and other manifests) that I got before thischange, I now get
channel-rust-1.45.toml
.I believe this change to be safe to deploy as it does not change or remove
anything about manifests, just adds more. The actions in rust-central-station
that interact with manifests appear to use wildcards in such a way that it will
pick up these files without any problems.
There will need to be changes to
rustup
beforerustup install 1.45
will work,but we can wait for a stable release and stable patch releases to happen with this
change before making the
rustup
changes, so that we're not committing to anythingbefore we know it works.