Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use --with-version when configuring jemalloc #77

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jemalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tikv-jemalloc-sys"
version = "0.5.4+5.3.0-patched"
version = "0.5.4+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
authors = [
"Alex Crichton <[email protected]>",
"Gonzalo Brito Gadeschi <[email protected]>",
Expand Down
18 changes: 14 additions & 4 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,23 @@ fn copy_recursively(src: &Path, dst: &Path) -> io::Result<()> {
Ok(())
}

fn expect_env(name: &str) -> String {
env::var(name).unwrap_or_else(|_| panic!("{} was not set", name))
}

// TODO: split main functions and remove following allow.
#[allow(clippy::cognitive_complexity)]
fn main() {
let target = env::var("TARGET").expect("TARGET was not set");
let host = env::var("HOST").expect("HOST was not set");
let num_jobs = env::var("NUM_JOBS").expect("NUM_JOBS was not set");
let target = expect_env("TARGET");
let host = expect_env("HOST");
let num_jobs = expect_env("NUM_JOBS");
let out_dir = PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR was not set"));
let src_dir = env::current_dir().expect("failed to get current directory");
let version = expect_env("CARGO_PKG_VERSION");
let je_version = version
.split_once('+')
.expect("jemalloc version is missing")
.1;

info!("TARGET={}", target);
info!("HOST={}", host);
Expand Down Expand Up @@ -147,7 +156,7 @@ fn main() {
assert!(build_dir.exists());

// Configuration files
let config_files = ["configure", "VERSION"];
let config_files = ["configure"];

// Copy the configuration files to jemalloc's source directory
for f in &config_files {
Expand All @@ -170,6 +179,7 @@ fn main() {
.env("CFLAGS", cflags.clone())
.env("LDFLAGS", cflags.clone())
.env("CPPFLAGS", cflags)
.arg(format!("--with-version={je_version}"))
.arg("--disable-cxx")
.arg("--enable-doc=no")
.arg("--enable-shared=no");
Expand Down
1 change: 0 additions & 1 deletion jemalloc-sys/configure/VERSION

This file was deleted.

Loading