Rollup merge of #133853 - onur-ozkan:use-vendor-directory-on-dist-build, r=Kobzol
use vendor sources by default on dist tarballs Tarball sources are distributed with vendor sources along with the `.cargo/config.toml` file configured for vendor sources. This means we can use vendor sources by default unless explicitly disabled with `build.vendor=false` by the user. So, let's do that.
This commit is contained in:
commit
ea64a5d811
3 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
@ -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,
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue