about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-10-03 00:31:06 +0200
committerGitHub <noreply@github.com>2020-10-03 00:31:06 +0200
commitca0ff934e939969e09abcc2d17f0cff89b8147ee (patch)
tree67da531e9357175e143e183ac5cd66dcb923cc7e /src
parent1118ab99301025f371f03c1345a5212c3068cf56 (diff)
parenta8fe6544482593073118dbdc3b25c2fb1fa7506c (diff)
downloadrust-ca0ff934e939969e09abcc2d17f0cff89b8147ee.tar.gz
rust-ca0ff934e939969e09abcc2d17f0cff89b8147ee.zip
Rollup merge of #76107 - integer32llc:manifest-alias, r=pietroalbini
Write manifest for MAJOR.MINOR channel to enable rustup convenience

This connects to https://github.com/rust-lang/rustup/issues/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).

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 this
change, 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` before `rustup 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 anything
before we know it works.
Diffstat (limited to 'src')
-rw-r--r--src/tools/build-manifest/src/main.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index be3e862e7ae..e1dc9111bf3 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -294,6 +294,10 @@ impl Builder {
         if self.versions.channel() != rust_version {
             self.write_channel_files(&rust_version, &manifest);
         }
+        if self.versions.channel() == "stable" {
+            let major_minor = rust_version.split('.').take(2).collect::<Vec<_>>().join(".");
+            self.write_channel_files(&major_minor, &manifest);
+        }
     }
 
     /// If a tool does not pass its tests, don't ship it.