From 6fc64b2ba6650a0aef60ef3048977ed81eb30c2c Mon Sep 17 00:00:00 2001 From: jq-rs Date: Fri, 5 Feb 2021 12:49:03 +0200 Subject: [PATCH 1/5] [WIP] Swap jemalloc to mimalloc * Swap jemalloc to mimalloc * Fix aligned alloc. * Bump libmimalloc-sys. * Include lock-file. --- Cargo.lock | 35 +++++++++++++++++------------------ compiler/rustc/Cargo.toml | 14 ++++++++++---- compiler/rustc/src/main.rs | 14 +++++++------- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb401ed4cd0bb..66a0d9c9a3985 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,6 +901,12 @@ dependencies = [ "syn", ] +[[package]] +name = "cty" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7313c0d620d0cb4dbd9d019e461a4beb501071ff46ec0ab933efb4daa76d73e3" + [[package]] name = "curl" version = "0.4.34" @@ -1216,12 +1222,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "fs_extra" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" - [[package]] name = "fst" version = "0.3.5" @@ -1612,17 +1612,6 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" -[[package]] -name = "jemalloc-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - [[package]] name = "jobserver" version = "0.1.21" @@ -1805,6 +1794,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libmimalloc-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e58f42b6424a0ed536678c65fd97cd64b4344bcf86251e284f7c0ce9eee40e64" +dependencies = [ + "cmake", + "cty", +] + [[package]] name = "libnghttp2-sys" version = "0.1.4+1.41.0" @@ -3406,7 +3405,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" name = "rustc-main" version = "0.0.0" dependencies = [ - "jemalloc-sys", + "libmimalloc-sys", "rustc_codegen_ssa", "rustc_driver", ] diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 6e6c0c71a1f3b..53a587a70de40 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -11,12 +11,18 @@ rustc_driver = { path = "../rustc_driver" } # crate is intended to be used by codegen backends, which may not be in-tree. rustc_codegen_ssa = { path = "../rustc_codegen_ssa" } -[dependencies.jemalloc-sys] -version = '0.3.0' +#[dependencies.jemalloc-sys] +#version = '0.3.0' +#optional = true +#features = ['unprefixed_malloc_on_supported_platforms'] + +[dependencies.libmimalloc-sys] +version = "0.1.20" optional = true -features = ['unprefixed_malloc_on_supported_platforms'] +default-features = false +features = ["extended", "override"] [features] -jemalloc = ['jemalloc-sys'] +jemalloc = ['libmimalloc-sys'] llvm = ['rustc_driver/llvm'] max_level_info = ['rustc_driver/max_level_info'] diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index 6bc5aa6382c4c..e0ceaf8820e31 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs @@ -7,23 +7,23 @@ fn main() { // dynamic libraries. That means to pull in jemalloc we need to actually // reference allocation symbols one way or another (as this file is the only // object code in the rustc executable). - #[cfg(feature = "jemalloc-sys")] + #[cfg(feature = "libmimalloc-sys")] { use std::os::raw::{c_int, c_void}; #[used] - static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::calloc; + static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = libmimalloc_sys::mi_calloc; #[used] static _F2: unsafe extern "C" fn(*mut *mut c_void, usize, usize) -> c_int = - jemalloc_sys::posix_memalign; + libmimalloc_sys::mi_posix_memalign; #[used] - static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::aligned_alloc; + static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = libmimalloc_sys::mi_aligned_alloc; #[used] - static _F4: unsafe extern "C" fn(usize) -> *mut c_void = jemalloc_sys::malloc; + static _F4: unsafe extern "C" fn(usize) -> *mut c_void = libmimalloc_sys::mi_malloc; #[used] - static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = jemalloc_sys::realloc; + static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = libmimalloc_sys::mi_realloc; #[used] - static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free; + static _F6: unsafe extern "C" fn(*mut c_void) = libmimalloc_sys::mi_free; } rustc_driver::set_sigpipe_handler(); From 35d93523681994e8fad7a3c4886e7072e6344040 Mon Sep 17 00:00:00 2001 From: jq-rs Date: Fri, 5 Feb 2021 13:08:32 +0200 Subject: [PATCH 2/5] Run tidy. --- compiler/rustc/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index e0ceaf8820e31..e0fb886a16edc 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs @@ -17,11 +17,13 @@ fn main() { static _F2: unsafe extern "C" fn(*mut *mut c_void, usize, usize) -> c_int = libmimalloc_sys::mi_posix_memalign; #[used] - static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = libmimalloc_sys::mi_aligned_alloc; + static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = + libmimalloc_sys::mi_aligned_alloc; #[used] static _F4: unsafe extern "C" fn(usize) -> *mut c_void = libmimalloc_sys::mi_malloc; #[used] - static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = libmimalloc_sys::mi_realloc; + static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = + libmimalloc_sys::mi_realloc; #[used] static _F6: unsafe extern "C" fn(*mut c_void) = libmimalloc_sys::mi_free; } From 22f306c6508af55ac66e25e432449431808b9890 Mon Sep 17 00:00:00 2001 From: jq-rs Date: Tue, 9 Feb 2021 09:00:39 +0200 Subject: [PATCH 3/5] Mimalloc support as a separate config.toml option. Remove misleading OSX from config.toml option comments as it is not really supported. --- Cargo.lock | 18 ++++++++++++++++++ compiler/rustc/Cargo.toml | 15 ++++++++------- compiler/rustc/src/main.rs | 27 +++++++++++++++++++++++++++ config.toml.example | 8 ++++++-- src/bootstrap/config.rs | 3 +++ src/bootstrap/lib.rs | 3 +++ 6 files changed, 65 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66a0d9c9a3985..7e5123229b388 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1222,6 +1222,12 @@ dependencies = [ "rustc-std-workspace-core", ] +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + [[package]] name = "fst" version = "0.3.5" @@ -1612,6 +1618,17 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +[[package]] +name = "jemalloc-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" +dependencies = [ + "cc", + "fs_extra", + "libc", +] + [[package]] name = "jobserver" version = "0.1.21" @@ -3405,6 +3422,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" name = "rustc-main" version = "0.0.0" dependencies = [ + "jemalloc-sys", "libmimalloc-sys", "rustc_codegen_ssa", "rustc_driver", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 53a587a70de40..0ef3fefd0510f 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -11,18 +11,19 @@ rustc_driver = { path = "../rustc_driver" } # crate is intended to be used by codegen backends, which may not be in-tree. rustc_codegen_ssa = { path = "../rustc_codegen_ssa" } -#[dependencies.jemalloc-sys] -#version = '0.3.0' -#optional = true -#features = ['unprefixed_malloc_on_supported_platforms'] +[dependencies.jemalloc-sys] +version = '0.3.0' +optional = true +features = ['unprefixed_malloc_on_supported_platforms'] [dependencies.libmimalloc-sys] -version = "0.1.20" +version = '0.1.20' optional = true default-features = false -features = ["extended", "override"] +features = ['extended', 'override'] [features] -jemalloc = ['libmimalloc-sys'] +jemalloc = ['jemalloc-sys'] +mimalloc = ['libmimalloc-sys'] llvm = ['rustc_driver/llvm'] max_level_info = ['rustc_driver/max_level_info'] diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index e0fb886a16edc..ec1136b8d14c4 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs @@ -7,6 +7,33 @@ fn main() { // dynamic libraries. That means to pull in jemalloc we need to actually // reference allocation symbols one way or another (as this file is the only // object code in the rustc executable). + #[cfg(feature = "jemalloc-sys")] + { + use std::os::raw::{c_int, c_void}; + + #[used] + static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::calloc; + #[used] + static _F2: unsafe extern "C" fn(*mut *mut c_void, usize, usize) -> c_int = + jemalloc_sys::posix_memalign; + #[used] + static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::aligned_alloc; + #[used] + static _F4: unsafe extern "C" fn(usize) -> *mut c_void = jemalloc_sys::malloc; + #[used] + static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = jemalloc_sys::realloc; + #[used] + static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free; + } + + // Pull in mimalloc when enabled. + // + // Note that we're pulling in a static copy of mimalloc which means that to + // pull it in we need to actually reference its symbols for it to get + // linked. The two crates we link to here, std and rustc_driver, are both + // dynamic libraries. That means to pull in mimalloc we need to actually + // reference allocation symbols one way or another (as this file is the only + // object code in the rustc executable). #[cfg(feature = "libmimalloc-sys")] { use std::os::raw::{c_int, c_void}; diff --git a/config.toml.example b/config.toml.example index 55b20adabd045..047b46d4e1a03 100644 --- a/config.toml.example +++ b/config.toml.example @@ -535,9 +535,13 @@ changelog-seen = 2 # Map debuginfo paths to `/rust/$sha/...`, generally only set for releases #remap-debuginfo = false -# Link the compiler against `jemalloc`, where on Linux and OSX it should -# override the default allocator for rustc and LLVM. +# Link the compiler against `jemalloc`, where on Linux it should override +# the default allocator for rustc and LLVM. #jemalloc = false +# +# Link the compiler against `mimalloc`, where on Linux it should override +# the default allocator for rustc and LLVM. +#mimalloc = false # Run tests in various test suites with the "nll compare mode" in addition to # running the tests in normal mode. Largely only used on CI and during local diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index ec1308ab82b51..dfa4e78ef69f5 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -142,6 +142,7 @@ pub struct Config { pub targets: Vec, pub local_rebuild: bool, pub jemalloc: bool, + pub mimalloc: bool, pub control_flow_guard: bool, // dist misc @@ -497,6 +498,7 @@ struct Rust { thin_lto_import_instr_limit: Option, remap_debuginfo: Option, jemalloc: Option, + mimalloc: Option, test_compare_mode: Option, llvm_libunwind: Option, control_flow_guard: Option, @@ -849,6 +851,7 @@ impl Config { set(&mut config.codegen_tests, rust.codegen_tests); set(&mut config.rust_rpath, rust.rpath); set(&mut config.jemalloc, rust.jemalloc); + set(&mut config.mimalloc, rust.mimalloc); set(&mut config.test_compare_mode, rust.test_compare_mode); config.llvm_libunwind = rust .llvm_libunwind diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 88fdcfa2d43cd..c16c69b7fc4c2 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -567,6 +567,9 @@ impl Build { if self.config.jemalloc { features.push_str("jemalloc"); } + if self.config.mimalloc { + features.push_str("mimalloc"); + } if self.config.llvm_enabled() { features.push_str(" llvm"); } From d4e65c60386cce4eac8614ec9ad2dbb89a574365 Mon Sep 17 00:00:00 2001 From: jq-rs Date: Mon, 15 Feb 2021 08:42:01 +0200 Subject: [PATCH 4/5] Replace jemalloc with mimalloc. Update bootstrap CHANGELOG.md accordingly. Cleanup jemalloc from darwin ci.yml, it was not supported. --- Cargo.lock | 18 ------------- compiler/rustc/Cargo.toml | 6 ----- compiler/rustc/src/main.rs | 27 ------------------- config.toml.example | 4 --- src/bootstrap/CHANGELOG.md | 1 + src/bootstrap/config.rs | 3 --- src/bootstrap/lib.rs | 3 --- .../disabled/dist-x86_64-haiku/Dockerfile | 2 +- .../host-x86_64/dist-i686-linux/Dockerfile | 2 +- .../host-x86_64/dist-x86_64-linux/Dockerfile | 2 +- src/ci/github-actions/ci.yml | 15 +++-------- 11 files changed, 7 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e5123229b388..66a0d9c9a3985 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1222,12 +1222,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "fs_extra" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" - [[package]] name = "fst" version = "0.3.5" @@ -1618,17 +1612,6 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" -[[package]] -name = "jemalloc-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - [[package]] name = "jobserver" version = "0.1.21" @@ -3422,7 +3405,6 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" name = "rustc-main" version = "0.0.0" dependencies = [ - "jemalloc-sys", "libmimalloc-sys", "rustc_codegen_ssa", "rustc_driver", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 0ef3fefd0510f..53a374e7f70f6 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -11,11 +11,6 @@ rustc_driver = { path = "../rustc_driver" } # crate is intended to be used by codegen backends, which may not be in-tree. rustc_codegen_ssa = { path = "../rustc_codegen_ssa" } -[dependencies.jemalloc-sys] -version = '0.3.0' -optional = true -features = ['unprefixed_malloc_on_supported_platforms'] - [dependencies.libmimalloc-sys] version = '0.1.20' optional = true @@ -23,7 +18,6 @@ default-features = false features = ['extended', 'override'] [features] -jemalloc = ['jemalloc-sys'] mimalloc = ['libmimalloc-sys'] llvm = ['rustc_driver/llvm'] max_level_info = ['rustc_driver/max_level_info'] diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index ec1136b8d14c4..fdb5826a6bfbf 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs @@ -1,31 +1,4 @@ fn main() { - // Pull in jemalloc when enabled. - // - // Note that we're pulling in a static copy of jemalloc which means that to - // pull it in we need to actually reference its symbols for it to get - // linked. The two crates we link to here, std and rustc_driver, are both - // dynamic libraries. That means to pull in jemalloc we need to actually - // reference allocation symbols one way or another (as this file is the only - // object code in the rustc executable). - #[cfg(feature = "jemalloc-sys")] - { - use std::os::raw::{c_int, c_void}; - - #[used] - static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::calloc; - #[used] - static _F2: unsafe extern "C" fn(*mut *mut c_void, usize, usize) -> c_int = - jemalloc_sys::posix_memalign; - #[used] - static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::aligned_alloc; - #[used] - static _F4: unsafe extern "C" fn(usize) -> *mut c_void = jemalloc_sys::malloc; - #[used] - static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = jemalloc_sys::realloc; - #[used] - static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free; - } - // Pull in mimalloc when enabled. // // Note that we're pulling in a static copy of mimalloc which means that to diff --git a/config.toml.example b/config.toml.example index 047b46d4e1a03..3c433c0be7573 100644 --- a/config.toml.example +++ b/config.toml.example @@ -535,10 +535,6 @@ changelog-seen = 2 # Map debuginfo paths to `/rust/$sha/...`, generally only set for releases #remap-debuginfo = false -# Link the compiler against `jemalloc`, where on Linux it should override -# the default allocator for rustc and LLVM. -#jemalloc = false -# # Link the compiler against `mimalloc`, where on Linux it should override # the default allocator for rustc and LLVM. #mimalloc = false diff --git a/src/bootstrap/CHANGELOG.md b/src/bootstrap/CHANGELOG.md index f899f21080ebe..a118614181269 100644 --- a/src/bootstrap/CHANGELOG.md +++ b/src/bootstrap/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Changes since the last major version] +- `jemalloc` allocator `config.toml` option is replaced with `mimalloc` option for improved performance characteristics [#81782](https://github.com/rust-lang/rust/pull/81782) - `llvm-libunwind` now accepts `in-tree` (formerly true), `system` or `no` (formerly false) [#77703](https://github.com/rust-lang/rust/pull/77703) ### Non-breaking changes diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index dfa4e78ef69f5..53e96ec73528e 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -141,7 +141,6 @@ pub struct Config { pub hosts: Vec, pub targets: Vec, pub local_rebuild: bool, - pub jemalloc: bool, pub mimalloc: bool, pub control_flow_guard: bool, @@ -497,7 +496,6 @@ struct Rust { verify_llvm_ir: Option, thin_lto_import_instr_limit: Option, remap_debuginfo: Option, - jemalloc: Option, mimalloc: Option, test_compare_mode: Option, llvm_libunwind: Option, @@ -850,7 +848,6 @@ impl Config { set(&mut config.rust_optimize_tests, rust.optimize_tests); set(&mut config.codegen_tests, rust.codegen_tests); set(&mut config.rust_rpath, rust.rpath); - set(&mut config.jemalloc, rust.jemalloc); set(&mut config.mimalloc, rust.mimalloc); set(&mut config.test_compare_mode, rust.test_compare_mode); config.llvm_libunwind = rust diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index c16c69b7fc4c2..f0c5c553a4439 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -564,9 +564,6 @@ impl Build { /// Gets the space-separated set of activated features for the compiler. fn rustc_features(&self) -> String { let mut features = String::new(); - if self.config.jemalloc { - features.push_str("jemalloc"); - } if self.config.mimalloc { features.push_str("mimalloc"); } diff --git a/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile b/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile index 5ddd3f1803964..483de149fc559 100644 --- a/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile @@ -43,7 +43,7 @@ RUN sh /scripts/sccache.sh ENV HOST=x86_64-unknown-haiku ENV TARGET=target.$HOST -ENV RUST_CONFIGURE_ARGS --disable-jemalloc \ +ENV RUST_CONFIGURE_ARGS \ --set=$TARGET.cc=x86_64-unknown-haiku-gcc \ --set=$TARGET.cxx=x86_64-unknown-haiku-g++ \ --set=$TARGET.llvm-config=/bin/llvm-config-haiku 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 22d7cbb0d14d8..adbfa3dd4f754 100644 --- a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile @@ -94,7 +94,7 @@ ENV RUST_CONFIGURE_ARGS \ --set target.i686-unknown-linux-gnu.linker=clang \ --build=i686-unknown-linux-gnu \ --set llvm.ninja=false \ - --set rust.jemalloc + --set rust.mimalloc ENV SCRIPT python2.7 ../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-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index d1b4bbf7fffef..16549c925c8e6 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 @@ -99,7 +99,7 @@ ENV RUST_CONFIGURE_ARGS \ --set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \ --set llvm.thin-lto=true \ --set llvm.ninja=false \ - --set rust.jemalloc + --set rust.mimalloc ENV SCRIPT ../src/ci/pgo.sh python2.7 ../x.py dist \ --host $HOSTS --target $HOSTS \ --include-default-paths \ diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 9eea6243dfa57..0aa8dc7df61a6 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -432,7 +432,7 @@ jobs: - name: dist-x86_64-apple env: SCRIPT: ./x.py dist - RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false + RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set llvm.ninja=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.7 NO_LLVM_ASSERTIONS: 1 @@ -443,7 +443,7 @@ jobs: - name: dist-x86_64-apple-alt env: SCRIPT: ./x.py dist - RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false + RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set llvm.ninja=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.7 NO_LLVM_ASSERTIONS: 1 @@ -453,7 +453,7 @@ jobs: - name: x86_64-apple env: SCRIPT: ./x.py --stage 2 test - RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false + RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set llvm.ninja=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.8 MACOSX_STD_DEPLOYMENT_TARGET: 10.7 @@ -472,7 +472,6 @@ jobs: --enable-full-tools --enable-sanitizers --enable-profiler - --set rust.jemalloc --set llvm.ninja=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 SELECT_XCODE: /Applications/Xcode_12.2.app @@ -482,14 +481,6 @@ jobs: NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 DIST_REQUIRE_ALL_TOOLS: 1 - # Corresponds to 16K page size - # - # Shouldn't be needed if jemalloc-sys is updated to - # handle this platform like iOS or if we build on - # aarch64-apple-darwin itself. - # - # https://github.com/gnzlbg/jemallocator/blob/c27a859e98e3cb790dc269773d9da71a1e918458/jemalloc-sys/build.rs#L237 - JEMALLOC_SYS_WITH_LG_PAGE: 14 <<: *job-macos-xl ###################### From 388bd5e31394477ad0ecb067f36bc7414963dcf2 Mon Sep 17 00:00:00 2001 From: jq-rs Date: Mon, 15 Feb 2021 08:59:01 +0200 Subject: [PATCH 5/5] Update yaml anchors. --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f10b6ca7ea94d..4235e32924395 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -279,7 +279,7 @@ jobs: - name: dist-x86_64-apple env: SCRIPT: "./x.py dist" - RUST_CONFIGURE_ARGS: "--host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set llvm.ninja=false" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.7 NO_LLVM_ASSERTIONS: 1 @@ -289,7 +289,7 @@ jobs: - name: dist-x86_64-apple-alt env: SCRIPT: "./x.py dist" - RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set llvm.ninja=false" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.7 NO_LLVM_ASSERTIONS: 1 @@ -298,7 +298,7 @@ jobs: - name: x86_64-apple env: SCRIPT: "./x.py --stage 2 test" - RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set llvm.ninja=false" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.8 MACOSX_STD_DEPLOYMENT_TARGET: 10.7 @@ -308,7 +308,7 @@ jobs: - name: dist-aarch64-apple env: SCRIPT: "./x.py dist --stage 2" - RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false" + RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --set llvm.ninja=false" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 SELECT_XCODE: /Applications/Xcode_12.2.app USE_XCODE_CLANG: 1 @@ -317,7 +317,6 @@ jobs: NO_LLVM_ASSERTIONS: 1 NO_DEBUG_ASSERTIONS: 1 DIST_REQUIRE_ALL_TOOLS: 1 - JEMALLOC_SYS_WITH_LG_PAGE: 14 os: macos-latest - name: x86_64-msvc-1 env: