Chore: Disable jemalloc on Windows#84
Open
hmoog wants to merge 4 commits into
Open
Conversation
jemalloc does not build on Windows. Drop it from the central rocksdb workspace dependency and re-enable it only for non-Windows targets in storage/rocksdb-store; Cargo feature unification then activates it for the entire non-Windows build while leaving Windows builds jemalloc-free. Also gitignore the IDE's target-idea/ build directory so its artifacts no longer surface as untracked files.
…le-jemalloc-on-windows # Conflicts: # Cargo.toml
biryukovmaxim
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
jemallocfeature of therocksdbcrate does not build on Windows, so anyWindows build of the workspace currently fails. This PR makes jemalloc a
non-Windows-only optimization while keeping it enabled everywhere it works
(Linux, macOS), with no change to the allocator behavior on those targets.
This re-implements the idea from @IzioDev's PR #35, adapted to the current
workspace layout (where
rocksdbis now consumed by several crates via theworkspace dependency, not just
storage/rocksdb-store).Approach
[workspace.dependencies]cannot becfg/target-gated, androcksdb.workspace = trueresolves to a single feature set, so the per-OS split cannot live in the root
manifest. Instead:
rocksdbworkspace dependency dropsjemallocfrom its featurelist, making the shared definition Windows-safe by default.
storage/rocksdb-storekeepsrocksdb.workspace = trueand re-enablesjemallocthrough a[target.'cfg(not(windows))'.dependencies]block.Cargo feature unification then turns
jemallocon for the entire non-Windowsbuild (every crate that depends on rocksdb) and leaves it off on Windows. Only
storage/rocksdb-storeneeds to opt in; the other rocksdb-using crates areuntouched.
Changes
Cargo.toml: removejemallocfrom the centralrocksdbworkspacedependency, with a comment pointing to where it is re-enabled.
storage/rocksdb-store/Cargo.toml: add a non-Windows target dependency thatenables
rocksdb'sjemallocfeature.storage/README.md: note that jemalloc applies to non-Windows targets..gitignore: ignore the IDE'starget-idea/build directory.Behavior
the whole build via feature unification.
Testing
./cargo-check-all.shon a non-Windows host confirms the build still picks upjemalloc through unification.