Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
17 changes: 17 additions & 0 deletions src/ci/scripts/upload-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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"

Expand Down
Loading