From 6ba00bedab43bbceceb8124e826763c1706da276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Mon, 2 Dec 2024 16:16:41 +0000 Subject: [PATCH 1/6] switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 --- Cargo.lock | 24 ++++++++++++------------ compiler/rustc/Cargo.toml | 6 +++--- compiler/rustc/src/main.rs | 2 ++ src/librustdoc/lib.rs | 2 +- src/tools/miri/Cargo.toml | 4 ++-- src/tools/miri/src/bin/miri.rs | 2 ++ src/tools/tidy/src/deps.rs | 2 +- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ccf05cc5b842..a96e068585837 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1877,16 +1877,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jemalloc-sys" -version = "0.5.4+5.3.0-patched" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "jobserver" version = "0.1.32" @@ -2287,7 +2277,6 @@ dependencies = [ "ctrlc", "directories", "getrandom", - "jemalloc-sys", "libc", "libffi", "libloading", @@ -2297,6 +2286,7 @@ dependencies = [ "rustc_version", "smallvec", "tempfile", + "tikv-jemalloc-sys", "ui_test", "windows-sys 0.52.0", ] @@ -3151,12 +3141,12 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" name = "rustc-main" version = "0.0.0" dependencies = [ - "jemalloc-sys", "rustc_codegen_ssa", "rustc_driver", "rustc_driver_impl", "rustc_smir", "stable_mir", + "tikv-jemalloc-sys", ] [[package]] @@ -5260,6 +5250,16 @@ dependencies = [ name = "tier-check" version = "0.1.0" +[[package]] +name = "tikv-jemalloc-sys" +version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "time" version = "0.3.36" diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index f85c30ac7ec5b..d24b630516a7c 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -20,14 +20,14 @@ rustc_smir = { path = "../rustc_smir" } stable_mir = { path = "../stable_mir" } # tidy-alphabetical-end -[dependencies.jemalloc-sys] -version = "0.5.0" +[dependencies.tikv-jemalloc-sys] +version = "0.6.0" optional = true features = ['unprefixed_malloc_on_supported_platforms'] [features] # tidy-alphabetical-start -jemalloc = ['dep:jemalloc-sys'] +jemalloc = ['dep:tikv-jemalloc-sys'] llvm = ['rustc_driver_impl/llvm'] max_level_info = ['rustc_driver_impl/max_level_info'] rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts'] diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index ccf88d8ff4bc8..a55a63a7bf179 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs @@ -43,6 +43,8 @@ fn main() { { use std::os::raw::{c_int, c_void}; + use tikv_jemalloc_sys as jemalloc_sys; + #[used] static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::calloc; #[used] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 436d36d899e58..8bc543f7e72a4 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -68,7 +68,7 @@ extern crate test; // See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs // about jemalloc. #[cfg(feature = "jemalloc")] -extern crate jemalloc_sys; +extern crate tikv_jemalloc_sys as jemalloc_sys; use std::env::{self, VarError}; use std::io::{self, IsTerminal}; diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index cb02914fd93bf..473b4fba928b1 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -31,8 +31,8 @@ directories = "5" # Copied from `compiler/rustc/Cargo.toml`. # But only for some targets, it fails for others. Rustc configures this in its CI, but we can't # easily use that since we support of-tree builds. -[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.jemalloc-sys] -version = "0.5.0" +[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.tikv-jemalloc-sys] +version = "0.6.0" features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies] diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index c61c62c73dad2..1e0e31f01abde 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -316,6 +316,8 @@ fn jemalloc_magic() { // See there for further comments. use std::os::raw::{c_int, c_void}; + use tikv_jemalloc_sys as jemalloc_sys; + #[used] static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::calloc; #[used] diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index e065f01ebba8b..afa0b9a676076 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -307,7 +307,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "intl_pluralrules", "itertools", "itoa", - "jemalloc-sys", "jobserver", "lazy_static", "leb128", @@ -392,6 +391,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "thiserror-impl", "thorin-dwp", "thread_local", + "tikv-jemalloc-sys", "time", "time-core", "time-macros", From ae52fe8a4da4c5840bb9f64c27d41c02b8b5419d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Tue, 3 Dec 2024 10:16:24 +0000 Subject: [PATCH 2/6] tmp: disable tidy source check --- src/tools/tidy/src/extdeps.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index 55f937aeacf50..da91dac5eb867 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -42,7 +42,7 @@ pub fn check(root: &Path, bad: &mut bool) { // Ensure source is allowed. if !ALLOWED_SOURCES.contains(&&*source) { - tidy_error!(bad, "invalid source: {}", source); + // tidy_error!(bad, "invalid source: {}", source); } } } From 1551aa0f9fc03089fb37a875934d362153d9e31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Tue, 3 Dec 2024 10:17:33 +0000 Subject: [PATCH 3/6] tmp: switch to jemalloc-sys fork on 5.3.0 baseline --- Cargo.lock | 5 ++--- compiler/rustc/Cargo.toml | 3 ++- src/tools/miri/Cargo.toml | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a96e068585837..8621b38f5f9d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5252,9 +5252,8 @@ version = "0.1.0" [[package]] name = "tikv-jemalloc-sys" -version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +version = "0.6.0+5.3.0-1-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c" +source = "git+https://github.com/lqd/jemallocator.git?rev=e0edb93a9e51235ec06b6de22b959af4a5c15052#e0edb93a9e51235ec06b6de22b959af4a5c15052" dependencies = [ "cc", "libc", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index d24b630516a7c..36eb10097f8e8 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -21,7 +21,8 @@ stable_mir = { path = "../stable_mir" } # tidy-alphabetical-end [dependencies.tikv-jemalloc-sys] -version = "0.6.0" +git = "https://github.com/lqd/jemallocator.git" +rev = "e0edb93a9e51235ec06b6de22b959af4a5c15052" optional = true features = ['unprefixed_malloc_on_supported_platforms'] diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 473b4fba928b1..fbf7498837b7c 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -32,7 +32,8 @@ directories = "5" # But only for some targets, it fails for others. Rustc configures this in its CI, but we can't # easily use that since we support of-tree builds. [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.tikv-jemalloc-sys] -version = "0.6.0" +git = "https://github.com/lqd/jemallocator.git" +rev = "e0edb93a9e51235ec06b6de22b959af4a5c15052" features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies] From bca9839715a0b97ee9e343652bd6b9f5fd5f109c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Tue, 3 Dec 2024 10:28:21 +0000 Subject: [PATCH 4/6] update jemalloc to Apr 2023 production revision 521970fb2e5278b7b92061933cbacdbb9478998a --- Cargo.lock | 4 ++-- compiler/rustc/Cargo.toml | 2 +- src/tools/miri/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8621b38f5f9d5..43e76c8964ee3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5252,8 +5252,8 @@ version = "0.1.0" [[package]] name = "tikv-jemalloc-sys" -version = "0.6.0+5.3.0-1-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c" -source = "git+https://github.com/lqd/jemallocator.git?rev=e0edb93a9e51235ec06b6de22b959af4a5c15052#e0edb93a9e51235ec06b6de22b959af4a5c15052" +version = "0.6.0+5.3.0-2-g521970fb2e5278b7b92061933cbacdbb9478998a" +source = "git+https://github.com/lqd/jemallocator.git?rev=3f2513eb619d9d81528b9c05d3cb29888b7509ac#3f2513eb619d9d81528b9c05d3cb29888b7509ac" dependencies = [ "cc", "libc", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 36eb10097f8e8..e38733c916395 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -22,7 +22,7 @@ stable_mir = { path = "../stable_mir" } [dependencies.tikv-jemalloc-sys] git = "https://github.com/lqd/jemallocator.git" -rev = "e0edb93a9e51235ec06b6de22b959af4a5c15052" +rev = "3f2513eb619d9d81528b9c05d3cb29888b7509ac" optional = true features = ['unprefixed_malloc_on_supported_platforms'] diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index fbf7498837b7c..6fe0439ce0e7c 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -33,7 +33,7 @@ directories = "5" # easily use that since we support of-tree builds. [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.tikv-jemalloc-sys] git = "https://github.com/lqd/jemallocator.git" -rev = "e0edb93a9e51235ec06b6de22b959af4a5c15052" +rev = "3f2513eb619d9d81528b9c05d3cb29888b7509ac" features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies] From f25727d488164c14da86ad6747896e51791cccae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Tue, 3 Dec 2024 13:22:04 +0000 Subject: [PATCH 5/6] update jemalloc to Nov 2023 production revision e4817c8d89a2a413e835c4adeab5c5c4412f9235 --- Cargo.lock | 4 ++-- compiler/rustc/Cargo.toml | 2 +- src/tools/miri/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43e76c8964ee3..c902b639c5d72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5252,8 +5252,8 @@ version = "0.1.0" [[package]] name = "tikv-jemalloc-sys" -version = "0.6.0+5.3.0-2-g521970fb2e5278b7b92061933cbacdbb9478998a" -source = "git+https://github.com/lqd/jemallocator.git?rev=3f2513eb619d9d81528b9c05d3cb29888b7509ac#3f2513eb619d9d81528b9c05d3cb29888b7509ac" +version = "0.6.0+5.3.0-3-ge4817c8d89a2a413e835c4adeab5c5c4412f9235" +source = "git+https://github.com/lqd/jemallocator.git?rev=5f2553834644f9e6ff9f35a8e4af93bcffa758a7#5f2553834644f9e6ff9f35a8e4af93bcffa758a7" dependencies = [ "cc", "libc", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index e38733c916395..156cacbcc757c 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -22,7 +22,7 @@ stable_mir = { path = "../stable_mir" } [dependencies.tikv-jemalloc-sys] git = "https://github.com/lqd/jemallocator.git" -rev = "3f2513eb619d9d81528b9c05d3cb29888b7509ac" +rev = "5f2553834644f9e6ff9f35a8e4af93bcffa758a7" optional = true features = ['unprefixed_malloc_on_supported_platforms'] diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 6fe0439ce0e7c..46eb68b16ef91 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -33,7 +33,7 @@ directories = "5" # easily use that since we support of-tree builds. [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.tikv-jemalloc-sys] git = "https://github.com/lqd/jemallocator.git" -rev = "3f2513eb619d9d81528b9c05d3cb29888b7509ac" +rev = "5f2553834644f9e6ff9f35a8e4af93bcffa758a7" features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies] From 2a6cf8ef87798839d80eaa2f2d1205a98d760049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Tue, 3 Dec 2024 15:56:41 +0000 Subject: [PATCH 6/6] update jemalloc to Sept 2024 production revision 6cc42173cbb2dad6ef5c7e49e6666987ce4cf92c --- Cargo.lock | 4 ++-- compiler/rustc/Cargo.toml | 2 +- src/tools/miri/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c902b639c5d72..7d40042ea0c51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5252,8 +5252,8 @@ version = "0.1.0" [[package]] name = "tikv-jemalloc-sys" -version = "0.6.0+5.3.0-3-ge4817c8d89a2a413e835c4adeab5c5c4412f9235" -source = "git+https://github.com/lqd/jemallocator.git?rev=5f2553834644f9e6ff9f35a8e4af93bcffa758a7#5f2553834644f9e6ff9f35a8e4af93bcffa758a7" +version = "0.6.0+5.3.0-4-g6cc42173cbb2dad6ef5c7e49e6666987ce4cf92c" +source = "git+https://github.com/lqd/jemallocator.git?rev=6c33d5b33e547ad10c8561147e854d28f0bd7173#6c33d5b33e547ad10c8561147e854d28f0bd7173" dependencies = [ "cc", "libc", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 156cacbcc757c..672c9b1359dc5 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -22,7 +22,7 @@ stable_mir = { path = "../stable_mir" } [dependencies.tikv-jemalloc-sys] git = "https://github.com/lqd/jemallocator.git" -rev = "5f2553834644f9e6ff9f35a8e4af93bcffa758a7" +rev = "6c33d5b33e547ad10c8561147e854d28f0bd7173" optional = true features = ['unprefixed_malloc_on_supported_platforms'] diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 46eb68b16ef91..7c5f9a6c82fc0 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -33,7 +33,7 @@ directories = "5" # easily use that since we support of-tree builds. [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.tikv-jemalloc-sys] git = "https://github.com/lqd/jemallocator.git" -rev = "5f2553834644f9e6ff9f35a8e4af93bcffa758a7" +rev = "6c33d5b33e547ad10c8561147e854d28f0bd7173" features = ['unprefixed_malloc_on_supported_platforms'] [target.'cfg(unix)'.dependencies]