Skip to content

Commit 7311b41

Browse files
maru-avaclaude
andcommitted
fixup: Force sequential jemalloc build for x86_64 reproducibility
Set MAKEFLAGS=-j1 to force sequential build of vendored jemalloc in tikv-jemallocator. The vendored jemalloc has race conditions during parallel builds causing non-deterministic symbol generation on x86_64 (NixOS/nixpkgs#380852). Using MAKEFLAGS instead of NUM_JOBS ensures only the make invocation for jemalloc is affected, while Cargo continues to build Rust crates in parallel. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5b29b0d commit 7311b41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ffi/flake.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
nativeBuildInputs = with pkgs; [
5858
pkg-config
5959
];
60+
61+
# Force sequential build of vendored jemalloc to avoid race conditions
62+
# that cause non-deterministic symbol generation on x86_64
63+
# MAKEFLAGS only affects make invocations (jemalloc), not cargo parallelism
64+
# See: https://github.com/NixOS/nixpkgs/issues/380852
65+
MAKEFLAGS = "-j1";
6066
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
6167
# Set macOS deployment target for Darwin builds
6268
MACOSX_DEPLOYMENT_TARGET = "13.0";
@@ -125,6 +131,9 @@
125131
if [[ ":$PATH:" != *":$GOBIN:"* ]]; then
126132
export PATH="$GOBIN:$PATH"
127133
fi
134+
135+
# Force sequential build of vendored jemalloc for reproducibility
136+
export MAKEFLAGS="-j1"
128137
'';
129138
};
130139
});

0 commit comments

Comments
 (0)