Skip to content

Commit

Permalink
Auto merge of rust-lang#112049 - Kobzol:pgo-omit-benchmarks, r=<try>
Browse files Browse the repository at this point in the history
[do not merge] CI experiments

Various CI experiments for try/dist builds.

r? `@ghost`
  • Loading branch information
bors committed Jan 3, 2025
2 parents 6c8347b + 81e7b70 commit 2ae4c6d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
19 changes: 18 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,12 @@ dependencies = [
"windows-sys 0.59.0",
]

[[package]]
name = "cty"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"

[[package]]
name = "curl"
version = "0.4.47"
Expand Down Expand Up @@ -2075,6 +2081,17 @@ version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"

[[package]]
name = "libmimalloc-sys"
version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44"
dependencies = [
"cc",
"cty",
"libc",
]

[[package]]
name = "libredox"
version = "0.1.3"
Expand Down Expand Up @@ -3224,12 +3241,12 @@ checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497"
name = "rustc-main"
version = "0.0.0"
dependencies = [
"libmimalloc-sys",
"rustc_codegen_ssa",
"rustc_driver",
"rustc_driver_impl",
"rustc_smir",
"stable_mir",
"tikv-jemalloc-sys",
]

[[package]]
Expand Down
14 changes: 10 additions & 4 deletions compiler/rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ rustc_smir = { path = "../rustc_smir" }
stable_mir = { path = "../stable_mir" }
# tidy-alphabetical-end

[dependencies.tikv-jemalloc-sys]
version = "0.6.0"
#[dependencies.tikv-jemalloc-sys]
#version = "0.6.0"
#optional = true
#features = ['unprefixed_malloc_on_supported_platforms']

[dependencies.libmimalloc-sys]
version = "0.1.39"
optional = true
features = ['unprefixed_malloc_on_supported_platforms']
default-features = false
features = ["extended", "override"]

[features]
# tidy-alphabetical-start
jemalloc = ['dep:tikv-jemalloc-sys']
jemalloc = ['dep:libmimalloc-sys']
llvm = ['rustc_driver_impl/llvm']
max_level_info = ['rustc_driver_impl/max_level_info']
rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts']
Expand Down
14 changes: 6 additions & 8 deletions compiler/rustc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,19 @@ 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;
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;

// On OSX, jemalloc doesn't directly override malloc/free, but instead
// registers itself with the allocator's zone APIs in a ctor. However,
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2071,8 +2071,9 @@ pub fn run_cargo(
// During check builds we need to keep crate metadata
keep = true;
} else if rlib_only_metadata {
if filename.contains("jemalloc_sys")
if filename.contains("libmimalloc_sys")
|| filename.contains("rustc_smir")
|| filename.contains("cty")
|| filename.contains("stable_mir")
{
// jemalloc_sys and rustc_smir are not linked into librustc_driver.so,
Expand Down
14 changes: 7 additions & 7 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 tikv_jemalloc_sys as jemalloc_sys;
extern crate libmimalloc_sys;

use std::env::{self, VarError};
use std::io::{self, IsTerminal};
Expand Down Expand Up @@ -132,18 +132,18 @@ pub fn main() {
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;

#[cfg(target_os = "macos")]
{
Expand Down

0 comments on commit 2ae4c6d

Please sign in to comment.