Skip to content

Commit 7c5a4cd

Browse files
committed
Make LLVM version suffix independent of rustc version on dev channel
Remove rustc version from LLVM version suffix on dev channel, avoiding the need for full rebuilds when moving between commits with different LLVM submodule & rustc version.
1 parent 39b6253 commit 7c5a4cd

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

config.toml.example

+3-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@
8484
#link-shared = false
8585

8686
# When building llvm, this configures what is being appended to the version.
87-
# If absent, we let the version as-is.
88-
#version-suffix = "-rust"
87+
# The default is "-rust-$version-$channel", except for dev channel where rustc
88+
# version number is omitted. To use LLVM version as is, provide an empty string.
89+
#version-suffix = "-rust-dev"
8990

9091
# On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
9192
# with clang-cl, so this is special in that it only compiles LLVM with clang-cl

src/bootstrap/native.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,14 @@ impl Step for Llvm {
235235
if !suffix.is_empty() {
236236
cfg.define("LLVM_VERSION_SUFFIX", suffix);
237237
}
238+
} else if builder.config.channel == "dev" {
239+
// Changes to a version suffix require a complete rebuild of the LLVM.
240+
// To avoid rebuilds during a time of version bump, don't include rustc
241+
// release number on the dev channel.
242+
cfg.define("LLVM_VERSION_SUFFIX", "-rust-dev");
238243
} else {
239-
let default_suffix =
240-
format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel);
241-
cfg.define("LLVM_VERSION_SUFFIX", default_suffix);
244+
let suffix = format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel);
245+
cfg.define("LLVM_VERSION_SUFFIX", suffix);
242246
}
243247

244248
if let Some(ref linker) = builder.config.llvm_use_linker {

0 commit comments

Comments
 (0)