Rollup merge of #149964 - Mark-Simulacrum:ci-channel, r=Kobzol

Write file with channel to S3

This will let rustup-toolchain-install-master gain support for installing stable artifacts, which is currently only possible when explicitly overriding the channel. That in turn will unblock letting Crater kick off a beta run as soon as both a new beta and a new stable artifact are ready, rather than waiting until the actual release.
This commit is contained in:
Jonathan Brouwer 2025-12-25 21:11:53 +01:00 committed by GitHub
commit 2a9bc187a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 12 deletions

View file

@ -1624,26 +1624,20 @@ impl Build {
self.release(&self.version)
}
/// Returns the "package version" for a component given the `num` release
/// number.
/// Returns the "package version" for a component.
///
/// The package version is typically what shows up in the names of tarballs.
/// For channels like beta/nightly it's just the channel name, otherwise
/// it's the `num` provided.
fn package_vers(&self, num: &str) -> String {
/// For channels like beta/nightly it's just the channel name, otherwise it's the release
/// version.
fn rust_package_vers(&self) -> String {
match &self.config.channel[..] {
"stable" => num.to_string(),
"stable" => self.version.to_string(),
"beta" => "beta".to_string(),
"nightly" => "nightly".to_string(),
_ => format!("{num}-dev"),
_ => format!("{}-dev", self.version),
}
}
/// Returns the value of `package_vers` above for Rust itself.
fn rust_package_vers(&self) -> String {
self.package_vers(&self.version)
}
/// Returns the `version` string associated with this compiler for Rust
/// itself.
///

View file

@ -6,6 +6,7 @@
set -euo pipefail
IFS=$'\n\t'
ci_dir=`cd $(dirname $0)/.. && pwd`
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
upload_dir="$(mktemp -d)"
@ -22,6 +23,22 @@ if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
mv "${dist_dir}"/* "${upload_dir}"
fi
# We write the release channel into the output so that
# `rustup-toolchain-install-master` or other, similar, tools can automatically
# detect the appropriate name to use for downloading artifacts.
#
# For nightly and beta this isn't strictly necessary as just trying both is
# enough, but stable builds produce artifacts with a version (e.g.,
# rust-src-1.92.0.tar.xz) which can't be easily guessed otherwise.
channel=$(releaseChannel)
if [[ "$channel" = "stable" ]]; then
# On stable, artifacts use the version number. See rust_package_vers in
# src/bootstrap/src/lib.rs.
cat "$ci_dir/../version" > "${upload_dir}/package-version"
else
echo "$channel" > "${upload_dir}/package-version"
fi
# CPU usage statistics.
cp build/cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv"