Skip to content

Commit

Permalink
Use --with-version when configuring jemalloc
Browse files Browse the repository at this point in the history
This also changes the metadata of the version so that jemalloc still
reports the same version as before.

Fixes #76

Signed-off-by: Rafael Ávila de Espíndola <rafael@espindo.la>
  • Loading branch information
espindola committed Mar 29, 2024
1 parent 2a26bb3 commit 21c04c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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-0-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
Expand Down
8 changes: 7 additions & 1 deletion jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ fn main() {
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 metadata = version
.split_once('+')
.expect("metadata part missing from version")
.1;

info!("TARGET={}", target);
info!("HOST={}", host);
Expand Down Expand Up @@ -151,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 @@ -174,6 +179,7 @@ fn main() {
.env("CFLAGS", cflags.clone())
.env("LDFLAGS", cflags.clone())
.env("CPPFLAGS", cflags)
.arg(format!("--with-version={metadata}"))
.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.

0 comments on commit 21c04c8

Please sign in to comment.