Implement "if-available" option for download-ci-llvm
This commit is contained in:
parent
d772879df3
commit
ab614b0f01
4 changed files with 22 additions and 4 deletions
|
@ -447,7 +447,8 @@ class RustBuild(object):
|
||||||
|
|
||||||
def downloading_llvm(self):
|
def downloading_llvm(self):
|
||||||
opt = self.get_toml('download-ci-llvm', 'llvm')
|
opt = self.get_toml('download-ci-llvm', 'llvm')
|
||||||
return opt == "true"
|
return opt == "true" \
|
||||||
|
or (opt == "if-available" and self.build == "x86_64-unknown-linux-gnu")
|
||||||
|
|
||||||
def _download_stage0_helper(self, filename, pattern, tarball_suffix, date=None):
|
def _download_stage0_helper(self, filename, pattern, tarball_suffix, date=None):
|
||||||
if date is None:
|
if date is None:
|
||||||
|
@ -892,7 +893,7 @@ class RustBuild(object):
|
||||||
submodules_names = []
|
submodules_names = []
|
||||||
for module in submodules:
|
for module in submodules:
|
||||||
if module.endswith("llvm-project"):
|
if module.endswith("llvm-project"):
|
||||||
if self.get_toml('llvm-config') or self.get_toml('download-ci-llvm') == 'true':
|
if self.get_toml('llvm-config') or self.downloading_llvm():
|
||||||
if self.get_toml('lld') != 'true':
|
if self.get_toml('lld') != 'true':
|
||||||
continue
|
continue
|
||||||
check = self.check_submodule(module, slow_submodules)
|
check = self.check_submodule(module, slow_submodules)
|
||||||
|
|
|
@ -391,7 +391,7 @@ struct Llvm {
|
||||||
use_libcxx: Option<bool>,
|
use_libcxx: Option<bool>,
|
||||||
use_linker: Option<String>,
|
use_linker: Option<String>,
|
||||||
allow_old_toolchain: Option<bool>,
|
allow_old_toolchain: Option<bool>,
|
||||||
download_ci_llvm: Option<bool>,
|
download_ci_llvm: Option<StringOrBool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default, Clone, Merge)]
|
#[derive(Deserialize, Default, Clone, Merge)]
|
||||||
|
@ -735,7 +735,14 @@ impl Config {
|
||||||
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
|
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
|
||||||
config.llvm_use_linker = llvm.use_linker.clone();
|
config.llvm_use_linker = llvm.use_linker.clone();
|
||||||
config.llvm_allow_old_toolchain = llvm.allow_old_toolchain;
|
config.llvm_allow_old_toolchain = llvm.allow_old_toolchain;
|
||||||
config.llvm_from_ci = llvm.download_ci_llvm.unwrap_or(false);
|
config.llvm_from_ci = match llvm.download_ci_llvm {
|
||||||
|
Some(StringOrBool::String(s)) => {
|
||||||
|
assert!(s == "if-available", "unknown option `{}` for download-ci-llvm", s);
|
||||||
|
config.build.triple == "x86_64-unknown-linux-gnu"
|
||||||
|
}
|
||||||
|
Some(StringOrBool::Bool(b)) => b,
|
||||||
|
None => false,
|
||||||
|
};
|
||||||
|
|
||||||
if config.llvm_from_ci {
|
if config.llvm_from_ci {
|
||||||
// None of the LLVM options, except assertions, are supported
|
// None of the LLVM options, except assertions, are supported
|
||||||
|
|
|
@ -6,3 +6,8 @@
|
||||||
debug-logging = true
|
debug-logging = true
|
||||||
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
|
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
|
||||||
incremental = true
|
incremental = true
|
||||||
|
|
||||||
|
[llvm]
|
||||||
|
# Will download LLVM from CI if available on your platform (Linux only for now)
|
||||||
|
# https://github.com/rust-lang/rust/issues/77084 tracks support for more platforms
|
||||||
|
download-ci-llvm = "if-available"
|
||||||
|
|
|
@ -8,3 +8,8 @@ bench-stage = 0
|
||||||
[rust]
|
[rust]
|
||||||
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
|
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
|
||||||
incremental = true
|
incremental = true
|
||||||
|
|
||||||
|
[llvm]
|
||||||
|
# Will download LLVM from CI if available on your platform (Linux only for now)
|
||||||
|
# https://github.com/rust-lang/rust/issues/77084 tracks support for more platforms
|
||||||
|
download-ci-llvm = "if-available"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue