From 7c5a4cdd669c9816df938a878147fe5b4645e951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Sun, 5 Apr 2020 00:00:00 +0000 Subject: [PATCH] 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. --- config.toml.example | 5 +++-- src/bootstrap/native.rs | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config.toml.example b/config.toml.example index ce21b63467f..c01112f4e60 100644 --- a/config.toml.example +++ b/config.toml.example @@ -84,8 +84,9 @@ #link-shared = false # When building llvm, this configures what is being appended to the version. -# If absent, we let the version as-is. -#version-suffix = "-rust" +# The default is "-rust-$version-$channel", except for dev channel where rustc +# version number is omitted. To use LLVM version as is, provide an empty string. +#version-suffix = "-rust-dev" # On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass # with clang-cl, so this is special in that it only compiles LLVM with clang-cl diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index d4d66abd520..1e380a20629 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -235,10 +235,14 @@ fn run(self, builder: &Builder<'_>) -> PathBuf { if !suffix.is_empty() { cfg.define("LLVM_VERSION_SUFFIX", suffix); } + } else if builder.config.channel == "dev" { + // Changes to a version suffix require a complete rebuild of the LLVM. + // To avoid rebuilds during a time of version bump, don't include rustc + // release number on the dev channel. + cfg.define("LLVM_VERSION_SUFFIX", "-rust-dev"); } else { - let default_suffix = - format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel); - cfg.define("LLVM_VERSION_SUFFIX", default_suffix); + let suffix = format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel); + cfg.define("LLVM_VERSION_SUFFIX", suffix); } if let Some(ref linker) = builder.config.llvm_use_linker {