diff --git a/INSTALL.md b/INSTALL.md index 0e3566af4b051..066422a57eb09 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -96,7 +96,7 @@ See [the rustc-dev-guide for more info][sysllvm]. --set llvm.libzstd=true \ --set llvm.ninja=false \ --set rust.debug-assertions=false \ - --set rust.override-allocator=jemalloc \ + --set build.allocator=jemalloc \ --set rust.bootstrap-override-lld=true \ --set rust.lto=thin \ --set rust.codegen-units=1 diff --git a/bootstrap.example.toml b/bootstrap.example.toml index a8bab85fda087..3251b0870774d 100644 --- a/bootstrap.example.toml +++ b/bootstrap.example.toml @@ -544,6 +544,12 @@ # For example, exclude = ["tests/ui", "src/tools/tidy"]. #build.exclude = [] +# Link the compiler and LLVM against the specified allocator instead of the default libc allocator. +# This option is only tested on Linux and OSX. It can also be configured per-target in the +# [target.] section. +# Possible options: "system" (default), "jemalloc" +#build.allocator = "jemalloc" + # ============================================================================= # General install configuration options # ============================================================================= @@ -859,15 +865,9 @@ # Useful for reproducible builds. Generally only set for releases #rust.remap-debuginfo = false -# Link the compiler and LLVM against the specified allocator instead of the default libc allocator. -# This option is only tested on Linux and OSX. It can also be configured per-target in the -# [target.] section. -# Possible options: "jemalloc" -#rust.override-allocator = "jemalloc" - -# Deprecated alias for `rust.override-allocator`. Setting this to `true` is -# equivalent to `rust.override-allocator = "jemalloc"`. If both are set, they -# must agree. +# Deprecated alias for `build.allocator`. Setting this to `true` is +# equivalent to `build.allocator = "jemalloc"`. Both cannot be set in the same section +# (`rust` or `target.[target]`) #rust.jemalloc = false # Run tests in various test suites with the "nll compare mode" in addition to @@ -1177,10 +1177,10 @@ #optimized-compiler-builtins = build.optimized-compiler-builtins (bool or path) # Link the compiler and LLVM against the specified allocator instead of the default libc allocator. -# This overrides the global `rust.override-allocator` option. See that option for more info. -#override-allocator = rust.override-allocator (string) +# This overrides the global `build.allocator` option. See that option for more info. +#allocator = build.allocator (string) -# Deprecated alias for `override-allocator`. See `rust.jemalloc` for more info. +# Deprecated alias for `allocator`. See `rust.jemalloc` for more info. #jemalloc = rust.jemalloc (bool) # The linker configuration that will *override* the default linker used for Linux diff --git a/src/bootstrap/download-ci-llvm-stamp b/src/bootstrap/download-ci-llvm-stamp index ba6dcfc761c5a..2ebc3066f1fac 100644 --- a/src/bootstrap/download-ci-llvm-stamp +++ b/src/bootstrap/download-ci-llvm-stamp @@ -1,4 +1,4 @@ Change this file to make users of the `download-ci-llvm` configuration download a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. -Last change is for: https://github.com/rust-lang/rust/pull/158766 +Last change is for: https://github.com/rust-lang/rust/pull/160100 diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 9ddcb32c2e45d..570af8256430f 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -28,7 +28,7 @@ use crate::core::builder::{ }; use crate::core::config::toml::target::DefaultLinuxLinkerOverride; use crate::core::config::{ - CompilerBuiltins, DebuginfoLevel, LlvmLibunwind, OverrideAllocator, RustcLto, TargetSelection, + Allocator, CompilerBuiltins, DebuginfoLevel, LlvmLibunwind, RustcLto, TargetSelection, }; use crate::utils::build_stamp; use crate::utils::build_stamp::BuildStamp; @@ -1392,7 +1392,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS } // See also the "JEMALLOC_SYS_WITH_LG_PAGE" setting in the tool build step. - if let Some(OverrideAllocator::Jemalloc) = builder.config.override_allocator(target) + if builder.config.allocator(target) == Allocator::Jemalloc && env::var_os("JEMALLOC_SYS_WITH_LG_PAGE").is_none() { // Build jemalloc on AArch64 with support for page sizes up to 64K diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index d5c2ecf7e93f5..1941566e2a0a2 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -21,7 +21,7 @@ use crate::core::builder::{ Builder, Cargo as CargoCommand, CommandLineStep, RunConfig, ShouldRun, Step, StepMetadata, apply_pgo, cargo_profile_var, }; -use crate::core::config::{DebuginfoLevel, OverrideAllocator, RustcLto, TargetSelection}; +use crate::core::config::{Allocator, DebuginfoLevel, RustcLto, TargetSelection}; use crate::utils::exec::{BootstrapCommand, command}; use crate::utils::helpers::{add_dylib_path, exe, t}; use crate::{Compiler, FileType, Kind, Mode}; @@ -241,7 +241,7 @@ pub fn prepare_tool_cargo( cargo.env("LZMA_API_STATIC", "1"); // See also the "JEMALLOC_SYS_WITH_LG_PAGE" setting in the compile build step. - if let Some(OverrideAllocator::Jemalloc) = builder.config.override_allocator(target) + if builder.config.allocator(target) == Allocator::Jemalloc && env::var_os("JEMALLOC_SYS_WITH_LG_PAGE").is_none() { // Build jemalloc on AArch64 with support for page sizes up to 64K @@ -767,8 +767,8 @@ impl CommandLineStep for Rustdoc { // to build rustdoc. // let mut extra_features = Vec::new(); - if let Some(allocator) = builder.config.override_allocator(target) { - extra_features.push(allocator.feature_name().to_string()); + if let Some(allocator_feature_name) = builder.config.allocator(target).feature_name() { + extra_features.push(allocator_feature_name.to_string()); } if !builder.config.rust_debug_logging { extra_features.push("max_level_info".to_string()) @@ -1585,8 +1585,8 @@ tool_rustc_extended!(Clippy { stable: true, add_bins_to_sysroot: ["clippy-driver"], add_features: |builder, target, features| { - if let Some(allocator) = builder.config.override_allocator(target) { - features.push(allocator.feature_name().to_string()); + if let Some(allocator_feature_name) = builder.config.allocator(target).feature_name() { + features.push(allocator_feature_name.to_string()); } } }); @@ -1596,8 +1596,8 @@ tool_rustc_extended!(Miri { stable: false, add_bins_to_sysroot: ["miri"], add_features: |builder, target, features| { - if let Some(allocator) = builder.config.override_allocator(target) { - features.push(allocator.feature_name().to_string()); + if let Some(allocator_feature_name) = builder.config.allocator(target).feature_name() { + features.push(allocator_feature_name.to_string()); } }, // Always compile also tests when building miri. Otherwise feature unification can cause rebuilds between building and testing miri. diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index b3ed7d4c6beb7..81a425fba1cab 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -49,8 +49,8 @@ use crate::core::config::toml::target::{ DefaultLinuxLinkerOverride, Target, TomlTarget, default_linux_linker_overrides, }; use crate::core::config::{ - CompilerBuiltins, CompressDebuginfo, DebuggerPath, DebuginfoLevel, DryRun, GccCiMode, - LlvmLibunwind, Merge, OverrideAllocator, ReplaceOpt, RustcLto, SplitDebuginfo, StringOrBool, + Allocator, CompilerBuiltins, CompressDebuginfo, DebuggerPath, DebuginfoLevel, DryRun, + GccCiMode, LlvmLibunwind, Merge, ReplaceOpt, RustcLto, SplitDebuginfo, StringOrBool, threads_from_config, }; use crate::core::download::{ @@ -249,7 +249,7 @@ pub struct Config { pub hosts: Vec, pub targets: Vec, pub local_rebuild: bool, - pub override_allocator: Option, + pub allocator: Option, pub control_flow_guard: bool, pub ehcont_guard: bool, @@ -538,6 +538,7 @@ impl Config { exclude: build_exclude, compiletest_allow_stage0: build_compiletest_allow_stage0, sde: build_sde, + allocator: build_allocator, } = toml_build.unwrap_or_default(); let Install { @@ -590,7 +591,6 @@ impl Config { thin_lto_import_instr_limit: rust_thin_lto_import_instr_limit, parallel_frontend_threads: rust_parallel_frontend_threads, remap_debuginfo: rust_remap_debuginfo, - override_allocator: rust_override_allocator, jemalloc: rust_jemalloc, test_compare_mode: rust_test_compare_mode, llvm_libunwind: rust_llvm_libunwind, @@ -970,7 +970,7 @@ impl Config { codegen_backends: target_codegen_backends, runner: target_runner, optimized_compiler_builtins: target_optimized_compiler_builtins, - override_allocator: target_override_allocator, + allocator: target_allocator, jemalloc: target_jemalloc, } = cfg; @@ -1047,9 +1047,10 @@ impl Config { target.rpath = target_rpath; target.rustflags = target_rustflags.unwrap_or_default(); target.optimized_compiler_builtins = target_optimized_compiler_builtins; - target.override_allocator = reconcile_jemalloc( + target.allocator = reconcile_jemalloc( target_jemalloc, - target_override_allocator, + target_allocator, + &format!("target.{triple}"), &format!("target.{triple}"), ); if let Some(backends) = target_codegen_backends { @@ -1396,6 +1397,7 @@ NOTE: Please add `--stage 2` to your command line, or if you're sure you want to Config { // tidy-alphabetical-start + allocator: reconcile_jemalloc(rust_jemalloc, build_allocator, "rust", "build"), android_ndk: build_android_ndk, backtrace: rust_backtrace.unwrap_or(true), backtrace_on_ice: rust_backtrace_on_ice.unwrap_or(false), @@ -1521,7 +1523,6 @@ NOTE: Please add `--stage 2` to your command line, or if you're sure you want to on_fail: flags_on_fail, optimized_compiler_builtins, out, - override_allocator: reconcile_jemalloc(rust_jemalloc, rust_override_allocator, "rust"), patch_binaries_for_nix: build_patch_binaries_for_nix, path_modification_cache, paths, @@ -1956,11 +1957,12 @@ NOTE: Please add `--stage 2` to your command line, or if you're sure you want to self.enabled_codegen_backends(target).first().unwrap() } - pub fn override_allocator(&self, target: TargetSelection) -> Option { + pub fn allocator(&self, target: TargetSelection) -> Allocator { self.target_config .get(&target) - .and_then(|cfg| cfg.override_allocator) - .or(self.override_allocator) + .and_then(|cfg| cfg.allocator) + .or(self.allocator) + .unwrap_or(Allocator::System) } pub fn rpath_enabled(&self, target: TargetSelection) -> bool { @@ -2054,35 +2056,39 @@ impl AsRef for Config { } /// Reconciles the deprecated `jemalloc` boolean option with the new -/// `override-allocator` option. +/// `allocator` option. /// -/// Emits a warning if `jemalloc` is present and errors out if it is set but -/// `override-allocator` is not `jemalloc`. The allocator is overridden if -/// either option is set. +/// Emits a warning if `jemalloc` is set, and an error if *both* `jemalloc` and `allocator` are set. fn reconcile_jemalloc( jemalloc: Option, - override_allocator: Option, - section: &str, -) -> Option { - if let Some(jemalloc) = jemalloc { - println!( - "WARNING: The `{section}.jemalloc` option is deprecated. \ - Use `{section}.override-allocator` instead.", - ); - if jemalloc && override_allocator.is_some_and(|a| a != OverrideAllocator::Jemalloc) { - panic!( - "ERROR: `{section}.jemalloc` is set but `{section}.override-allocator` is \ - not `jemalloc` ({:?}). Remove the deprecated `jemalloc` option or set \ - `override-allocator = \"jemalloc\"`.", - override_allocator, + allocator: Option, + jemalloc_section: &str, + allocator_section: &str, +) -> Option { + match (jemalloc, allocator) { + (None, None) => None, + (None, Some(allocator)) => Some(allocator), + (Some(true), None) => { + println!( + "WARNING: The `jemalloc` option is deprecated. \ + Please use `{allocator_section}.allocator = \"jemalloc\"` instead of `{jemalloc_section}.jemalloc = true`", + ); + Some(Allocator::Jemalloc) + } + (Some(false), None) => { + println!( + "WARNING: The `jemalloc` option is deprecated. \ + Please use `{allocator_section}.allocator = \"system\"` instead of `{jemalloc_section}.jemalloc = false`", ); + Some(Allocator::System) + } + _ => { + panic!( + "ERROR: `{jemalloc_section}.jemalloc` and `{allocator_section}.allocator` are both set. \ + Please remove the outdated `{jemalloc_section}.jemalloc` directive." + ) } } - override_allocator.or(if jemalloc == Some(true) { - Some(OverrideAllocator::Jemalloc) - } else { - None - }) } fn compute_src_directory(src_dir: Option, exec_ctx: &ExecutionContext) -> Option { diff --git a/src/bootstrap/src/core/config/mod.rs b/src/bootstrap/src/core/config/mod.rs index 8a198a0d9436f..6a3ab55f71aad 100644 --- a/src/bootstrap/src/core/config/mod.rs +++ b/src/bootstrap/src/core/config/mod.rs @@ -252,27 +252,30 @@ impl<'de> Deserialize<'de> for CompilerBuiltins { } #[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum OverrideAllocator { +pub enum Allocator { + System, Jemalloc, } -impl OverrideAllocator { - pub fn feature_name(self) -> &'static str { +impl Allocator { + pub fn feature_name(self) -> Option<&'static str> { match self { - OverrideAllocator::Jemalloc => "jemalloc", + Allocator::System => None, + Allocator::Jemalloc => Some("jemalloc"), } } } -impl<'de> Deserialize<'de> for OverrideAllocator { +impl<'de> Deserialize<'de> for Allocator { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { let name = String::deserialize(deserializer)?; match name.as_str() { + "system" => Ok(Self::System), "jemalloc" => Ok(Self::Jemalloc), - other => Err(serde::de::Error::unknown_variant(other, &["jemalloc"])), + other => Err(serde::de::Error::unknown_variant(other, &["system", "jemalloc"])), } } } diff --git a/src/bootstrap/src/core/config/toml/build.rs b/src/bootstrap/src/core/config/toml/build.rs index 666bb229e8af8..265dde78e08eb 100644 --- a/src/bootstrap/src/core/config/toml/build.rs +++ b/src/bootstrap/src/core/config/toml/build.rs @@ -11,7 +11,7 @@ use std::collections::HashMap; use serde::{Deserialize, Deserializer}; use crate::core::config::toml::ReplaceOpt; -use crate::core::config::{CompilerBuiltins, DebuggerPath, Merge, StringOrBool}; +use crate::core::config::{Allocator, CompilerBuiltins, DebuggerPath, Merge, StringOrBool}; use crate::{HashSet, PathBuf, define_config, exit}; define_config! { @@ -77,6 +77,7 @@ define_config! { exclude: Option> = "exclude", record_failed_tests_path: Option = "record_failed_tests_path", sde: Option = "sde", + allocator: Option = "allocator", } } diff --git a/src/bootstrap/src/core/config/toml/rust.rs b/src/bootstrap/src/core/config/toml/rust.rs index f8f383ef18e73..c8a8db28c773a 100644 --- a/src/bootstrap/src/core/config/toml/rust.rs +++ b/src/bootstrap/src/core/config/toml/rust.rs @@ -5,9 +5,7 @@ use build_helper::ci::CiEnv; use serde::{Deserialize, Deserializer}; use crate::core::config::toml::TomlConfig; -use crate::core::config::{ - CompressDebuginfo, DebuginfoLevel, Merge, OverrideAllocator, ReplaceOpt, StringOrBool, -}; +use crate::core::config::{CompressDebuginfo, DebuginfoLevel, Merge, ReplaceOpt, StringOrBool}; use crate::{BTreeSet, CodegenBackendKind, HashSet, PathBuf, TargetSelection, define_config, exit}; define_config! { @@ -57,7 +55,6 @@ define_config! { verify_llvm_ir: Option = "verify-llvm-ir", thin_lto_import_instr_limit: Option = "thin-lto-import-instr-limit", remap_debuginfo: Option = "remap-debuginfo", - override_allocator: Option = "override-allocator", // FIXME: Remove this option in Q1 2027 jemalloc: Option = "jemalloc", test_compare_mode: Option = "test-compare-mode", @@ -297,6 +294,10 @@ pub fn check_incompatible_options_for_ci_rustc( ci_config_toml.build.as_ref().and_then(|b| b.optimized_compiler_builtins.clone()); err!(current_optimized_compiler_builtins, optimized_compiler_builtins, "build"); + let current_allocator = current_config_toml.build.as_ref().and_then(|b| b.allocator); + let allocator = ci_config_toml.build.as_ref().and_then(|b| b.allocator); + err!(current_allocator, allocator, "build"); + // We always build the in-tree compiler on cross targets, so we only care // about the host target here. let host_str = host.to_string(); @@ -309,10 +310,17 @@ pub fn check_incompatible_options_for_ci_rustc( ))?; let profiler = &ci_cfg.profiler; - err!(current_cfg.profiler, profiler, "build"); + err!(current_cfg.profiler, profiler, format!("target.{host_str}")); let optimized_compiler_builtins = &ci_cfg.optimized_compiler_builtins; - err!(current_cfg.optimized_compiler_builtins, optimized_compiler_builtins, "build"); + err!( + current_cfg.optimized_compiler_builtins, + optimized_compiler_builtins, + format!("target.{host_str}") + ); + + err!(current_cfg.allocator, &ci_cfg.allocator, format!("target.{host_str}")); + err!(current_cfg.jemalloc, &ci_cfg.jemalloc, format!("target.{host_str}")); } let (Some(current_rust_config), Some(ci_rust_config)) = @@ -333,7 +341,6 @@ pub fn check_incompatible_options_for_ci_rustc( stack_protector, strip, jemalloc, - override_allocator, rpath, channel, default_linker, @@ -403,7 +410,6 @@ pub fn check_incompatible_options_for_ci_rustc( err!(current_rust_config.llvm_tools, llvm_tools, "rust"); err!(current_rust_config.llvm_bitcode_linker, llvm_bitcode_linker, "rust"); err!(current_rust_config.jemalloc, jemalloc, "rust"); - err!(current_rust_config.override_allocator, override_allocator, "rust"); err!(current_rust_config.default_linker, default_linker, "rust"); err!(current_rust_config.stack_protector, stack_protector, "rust"); err!(current_rust_config.std_features, std_features, "rust"); diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs index 5f12b1295bc2e..8e354060eceff 100644 --- a/src/bootstrap/src/core/config/toml/target.rs +++ b/src/bootstrap/src/core/config/toml/target.rs @@ -15,7 +15,7 @@ use serde::de::Error; use serde::{Deserialize, Deserializer}; use crate::core::config::{ - CompilerBuiltins, CompressDebuginfo, LlvmLibunwind, Merge, OverrideAllocator, ReplaceOpt, + Allocator, CompilerBuiltins, CompressDebuginfo, LlvmLibunwind, Merge, ReplaceOpt, SplitDebuginfo, StringOrBool, }; use crate::{CodegenBackendKind, HashSet, PathBuf, define_config, exit}; @@ -48,7 +48,7 @@ define_config! { codegen_backends: Option> = "codegen-backends", runner: Option = "runner", optimized_compiler_builtins: Option = "optimized-compiler-builtins", - override_allocator: Option = "override-allocator", + allocator: Option = "allocator", jemalloc: Option = "jemalloc", } } @@ -84,7 +84,7 @@ pub struct Target { pub no_std: bool, pub codegen_backends: Option>, pub optimized_compiler_builtins: Option, - pub override_allocator: Option, + pub allocator: Option, } impl Target { diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 3babca128d471..7d119247b3bac 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -862,10 +862,11 @@ impl Build { crates.is_empty() || possible_features_by_crates.contains(feature) }; let mut features = vec![]; - if let Some(allocator) = self.config.override_allocator(target) - && check(allocator.feature_name()) + + if let Some(allocator_feature_name) = self.config.allocator(target).feature_name() + && check(allocator_feature_name) { - features.push(allocator.feature_name()); + features.push(allocator_feature_name); } if (self.config.llvm_enabled(target) || kind == Kind::Check) && check("llvm") { features.push("llvm"); diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 8892832037ee2..25c0963aa4191 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -666,4 +666,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Warning, summary: "The `rust.use-lld` option has been removed. Use `rust.bootstrap-override-lld` instead.", }, + ChangeInfo { + change_id: 160100, + severity: ChangeSeverity::Warning, + summary: "The `override-allocator` option has been renamed: The global setting is now `build.allocator` and the per-target setting is `target..allocator`. It can now be set to 'system' to explicitly request the system allocator.", + }, ]; diff --git a/src/ci/citool/tests/jobs.rs b/src/ci/citool/tests/jobs.rs index 3ab24b353fd76..683c76f52e9ea 100644 --- a/src/ci/citool/tests/jobs.rs +++ b/src/ci/citool/tests/jobs.rs @@ -6,7 +6,7 @@ const TEST_JOBS_YML_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/tes fn auto_jobs() { let stdout = get_matrix("push", "commit", "refs/heads/automation/bors/auto"); insta::assert_snapshot!(stdout, @r#" - jobs=[{"name":"aarch64-gnu","full_name":"auto - aarch64-gnu","os":"ubuntu-22.04-arm","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"x86_64-gnu-llvm-18-1","full_name":"auto - x86_64-gnu-llvm-18-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DOCKER_SCRIPT":"stage_2_test_set1.sh","IMAGE":"x86_64-gnu-llvm-18","READ_ONLY_SRC":"0","RUST_BACKTRACE":1,"TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"aarch64-apple","full_name":"auto - aarch64-apple","os":"macos-15","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DEVELOPER_DIR":"/Applications/Xcode_26.2.app/Contents/Developer","MACOSX_DEPLOYMENT_TARGET":11.0,"MACOSX_STD_DEPLOYMENT_TARGET":11.0,"NO_DEBUG_ASSERTIONS":1,"NO_LLVM_ASSERTIONS":1,"NO_OVERFLOW_CHECKS":1,"RUSTC_RETRY_LINKER_ON_SEGFAULT":1,"RUST_CONFIGURE_ARGS":"--enable-sanitizers --enable-profiler --set rust.override-allocator=jemalloc","SCRIPT":"./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin","TOOLSTATE_PUBLISH":1}},{"name":"dist-i686-msvc","full_name":"auto - dist-i686-msvc","os":"windows-2022","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_REQUIRE_ALL_TOOLS":1,"RUST_CONFIGURE_ARGS":"--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler","SCRIPT":"python x.py dist bootstrap --include-default-paths","TOOLSTATE_PUBLISH":1}},{"name":"pr-check-1","full_name":"auto - pr-check-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"pr-check-2","full_name":"auto - pr-check-2","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"tidy","full_name":"auto - tidy","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true,"doc_url":"https://foo.bar"}] + jobs=[{"name":"aarch64-gnu","full_name":"auto - aarch64-gnu","os":"ubuntu-22.04-arm","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"x86_64-gnu-llvm-18-1","full_name":"auto - x86_64-gnu-llvm-18-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DOCKER_SCRIPT":"stage_2_test_set1.sh","IMAGE":"x86_64-gnu-llvm-18","READ_ONLY_SRC":"0","RUST_BACKTRACE":1,"TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"aarch64-apple","full_name":"auto - aarch64-apple","os":"macos-15","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DEVELOPER_DIR":"/Applications/Xcode_26.2.app/Contents/Developer","MACOSX_DEPLOYMENT_TARGET":11.0,"MACOSX_STD_DEPLOYMENT_TARGET":11.0,"NO_DEBUG_ASSERTIONS":1,"NO_LLVM_ASSERTIONS":1,"NO_OVERFLOW_CHECKS":1,"RUSTC_RETRY_LINKER_ON_SEGFAULT":1,"RUST_CONFIGURE_ARGS":"--enable-sanitizers --enable-profiler --set build.allocator=jemalloc","SCRIPT":"./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin","TOOLSTATE_PUBLISH":1}},{"name":"dist-i686-msvc","full_name":"auto - dist-i686-msvc","os":"windows-2022","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_REQUIRE_ALL_TOOLS":1,"RUST_CONFIGURE_ARGS":"--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler","SCRIPT":"python x.py dist bootstrap --include-default-paths","TOOLSTATE_PUBLISH":1}},{"name":"pr-check-1","full_name":"auto - pr-check-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"pr-check-2","full_name":"auto - pr-check-2","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"tidy","full_name":"auto - tidy","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true,"doc_url":"https://foo.bar"}] run_type=auto "#); } diff --git a/src/ci/citool/tests/test-jobs.yml b/src/ci/citool/tests/test-jobs.yml index eb0ef8a9b4c02..4a249cb1e92b5 100644 --- a/src/ci/citool/tests/test-jobs.yml +++ b/src/ci/citool/tests/test-jobs.yml @@ -28,7 +28,7 @@ runners: envs: env-x86_64-apple-tests: &env-x86_64-apple-tests SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc-html -- --exact - RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.override-allocator=jemalloc + RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set build.allocator=jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 # Ensure that host tooling is tested on our minimum supported macOS version. MACOSX_DEPLOYMENT_TARGET: 10.12 @@ -110,7 +110,7 @@ auto: RUST_CONFIGURE_ARGS: >- --enable-sanitizers --enable-profiler - --set rust.override-allocator=jemalloc + --set build.allocator=jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer # Aarch64 tooling only needs to support macOS 11.0 and up as nothing else diff --git a/src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile b/src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile index 684e8cf9051fc..1e205aa72a450 100644 --- a/src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile +++ b/src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile @@ -89,7 +89,7 @@ ENV RUST_CONFIGURE_ARGS="--build=aarch64-unknown-linux-gnu \ --set llvm.libzstd=true \ --set llvm.ninja=false \ --set rust.debug-assertions=false \ - --set rust.override-allocator=jemalloc \ + --set build.allocator=jemalloc \ --set rust.bootstrap-override-lld=true \ --set rust.lto=thin \ --set rust.codegen-units=1" diff --git a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile index 88f484d0e8643..63b12ad646a25 100644 --- a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile @@ -76,7 +76,7 @@ ENV RUST_CONFIGURE_ARGS="--enable-full-tools \ --set target.i686-unknown-linux-gnu.linker=clang \ --build=i686-unknown-linux-gnu \ --set llvm.ninja=false \ - --set rust.override-allocator=jemalloc" + --set build.allocator=jemalloc" ENV SCRIPT="python3 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS" ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang diff --git a/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile index f037b6faa563c..f60167b94d071 100644 --- a/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile @@ -51,7 +51,7 @@ ENV RUST_CONFIGURE_ARGS="--enable-extended \ --enable-profiler \ --enable-sanitizers \ --disable-docs \ - --set rust.override-allocator=jemalloc \ + --set build.allocator=jemalloc \ --set rust.lto=thin \ --set rust.codegen-units=1" diff --git a/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile index 2b77249c494c8..8fdfe7f78b100 100644 --- a/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile @@ -33,7 +33,7 @@ ENV RUST_CONFIGURE_ARGS="--enable-extended \ --enable-profiler \ --enable-sanitizers \ --disable-docs \ - --set rust.override-allocator=jemalloc \ + --set build.allocator=jemalloc \ --set rust.lto=thin \ --set rust.codegen-units=1 \ --set target.loongarch64-unknown-linux-musl.crt-static=false \ diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index 2fa936056233f..2db64b8f5c7c1 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -90,7 +90,7 @@ ENV RUST_CONFIGURE_ARGS="--enable-full-tools \ --set llvm.thin-lto=true \ --set llvm.ninja=false \ --set llvm.libzstd=true \ - --set rust.override-allocator=jemalloc \ + --set build.allocator=jemalloc \ --set rust.bootstrap-override-lld=true \ --set rust.lto=thin \ --set rust.codegen-units=1" diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index e6e3c1acd853b..9b76b7a6cb628 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -497,7 +497,7 @@ auto: --enable-sanitizers --enable-profiler --disable-docs - --set rust.override-allocator=jemalloc + --set build.allocator=jemalloc --set llvm.link-shared=true --set rust.lto=thin --set rust.codegen-units=1 @@ -532,7 +532,7 @@ auto: RUST_CONFIGURE_ARGS: >- --enable-sanitizers --enable-profiler - --set rust.override-allocator=jemalloc + --set build.allocator=jemalloc --set target.aarch64-apple-ios-macabi.sanitizers=false --set target.x86_64-apple-ios-macabi.sanitizers=false --set target.aarch64-apple-tvos.profiler=false @@ -557,7 +557,7 @@ auto: --enable-full-tools --enable-sanitizers --enable-profiler - --set rust.override-allocator=jemalloc + --set build.allocator=jemalloc --set llvm.link-shared=true --set rust.lto=thin --set rust.codegen-units=1 @@ -578,7 +578,7 @@ auto: RUST_CONFIGURE_ARGS: >- --enable-sanitizers --enable-profiler - --set rust.override-allocator=jemalloc + --set build.allocator=jemalloc DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer # Aarch64 tooling only needs to support macOS 11.0 and up as nothing else # supports the hardware, so only need to test it there.