-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-Sim…
…ulacrum Set `download-ci-llvm = "if-available"` by default when `channel = dev` See rust-lang/compiler-team#566. The motivation for changing the default is to avoid downloading and building LLVM when someone runs `x build` before running `x setup`. The motivation for only doing it on `channel = "dev"` is to avoid breaking distros or users installing from source. It works because `dev` is also the default channel. The diff looks larger than it is; most of it is moving the `llvm` branch below the `rust` so `config.channel` is set. r? `@Mark-Simulacrum` cc `@oli-obk` `@bjorn3` `@cuviper`
- Loading branch information
Showing
5 changed files
with
141 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use super::{Config, TomlConfig}; | ||
use std::path::Path; | ||
|
||
fn toml(config: &str) -> impl '_ + Fn(&Path) -> TomlConfig { | ||
|&_| toml::from_str(config).unwrap() | ||
} | ||
|
||
fn parse(config: &str) -> Config { | ||
Config::parse_inner(&["check".to_owned(), "--config=/does/not/exist".to_owned()], toml(config)) | ||
} | ||
|
||
#[test] | ||
fn download_ci_llvm() { | ||
let parse_llvm = |s| parse(s).llvm_from_ci; | ||
let if_available = parse_llvm("llvm.download-ci-llvm = \"if-available\""); | ||
|
||
assert!(parse_llvm("llvm.download-ci-llvm = true")); | ||
assert!(!parse_llvm("llvm.download-ci-llvm = false")); | ||
assert_eq!(parse_llvm(""), if_available); | ||
assert_eq!(parse_llvm("rust.channel = \"dev\""), if_available); | ||
assert!(!parse_llvm("rust.channel = \"stable\"")); | ||
} | ||
|
||
// FIXME: add test for detecting `src` and `out` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters