Skip to content
Merged
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
5 changes: 2 additions & 3 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,8 @@
# Indicate whether the vendored sources are used for Rust dependencies or not.
#
# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you
# want to use vendoring. See
# https://forge.rust-lang.org/infra/other-installation-methods.html#source-code.
#vendor = false
# want to use vendoring. See https://forge.rust-lang.org/infra/other-installation-methods.html#source-code.
#vendor = if "is a tarball source" && "vendor" dir exists && ".cargo/config.toml" file exists { true } else { false }

# Typically the build system will build the Rust compiler twice. The second
# compiler, however, will simply use its own libraries to link against. If you
Expand Down
7 changes: 6 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,6 @@ impl Config {
set(&mut config.docs_minification, docs_minification);
set(&mut config.docs, docs);
set(&mut config.locked_deps, locked_deps);
set(&mut config.vendor, vendor);
set(&mut config.full_bootstrap, full_bootstrap);
set(&mut config.extended, extended);
config.tools = tools;
Expand Down Expand Up @@ -1711,6 +1710,12 @@ impl Config {
config.in_tree_llvm_info = GitInfo::new(false, &config.src.join("src/llvm-project"));
config.in_tree_gcc_info = GitInfo::new(false, &config.src.join("src/gcc"));

config.vendor = vendor.unwrap_or(
config.rust_info.is_from_tarball()
&& config.src.join("vendor").exists()
&& config.src.join(".cargo/config.toml").exists(),
);

if let Some(rust) = toml.rust {
let Rust {
optimize: optimize_toml,
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "Revert `rust.download-rustc` global default to `false` and only use `rust.download-rustc = \"if-unchanged\"` default for library and tools profile. As alt CI rustc is built without debug assertions, `rust.debug-assertions = true` will now inhibit downloading CI rustc.",
},
ChangeInfo {
change_id: 133853,
severity: ChangeSeverity::Info,
summary: "`build.vendor` is now enabled by default for dist/tarball sources when 'vendor' directory and '.cargo/config.toml' file are present.",
},
];
Loading