-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
tree-wide: make rust jemalloc-sys use nixpkgs jemalloc build #243324
Conversation
More difficult than I thought because some packages (where the |
What's your current thinking on how to address this? It seems hard to do automatically without better ways to override. |
We can create a prefixed (as is currently in this PR) and only-prefixed-on-some-platforms version. Then choosing the correct version of the hook should be a matter of trial-and-error. Then another challenge is finding all rust packages that build with jemallocator |
This does sound like the best option today.
Perhaps this can be considered an issue that upstreams would be amenable to fixing, so then our second variant is just the system
I think the only way to find these right now is if someone like you encounters a breakage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unprefixed variant doesn't seem to be used anywhere — is that still waiting for testing each package to determine which one it needs?
setupHook = writeText "setup-hook.sh" '' | ||
addRustJemalloc () { | ||
if test -f "$1/rust-jemalloc"; then | ||
export JEMALLOC_OVERRIDE="$1/lib/libjemalloc${stdenv.hostPlatform.extensions.library}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can maybe do
export JEMALLOC_OVERRIDE="$1/lib/libjemalloc${stdenv.hostPlatform.extensions.library}" | |
export JEMALLOC_OVERRIDE="@out@/lib/libjemalloc${stdenv.hostPlatform.extensions.library}" |
and not need the if
or the postFixup
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we can. done.
This broke all Rust static builds that use jemalloc (which is pretty much everything). For example $ git checkout 799fff889b1e
$ nix-build -A pkgsStatic.ruff # error
$ git checkout HEAD^
$ nix-build -A pkgsStatic.ruff # succeeds |
Right, yes. We have two options, then. Make every package only conditionally depend on rust-jemalloc-sys when !stdenv.hostPlatform.isStatic, or set rust-jemalloc-sys to null in that case. @yu-re-ka, any thoughts? |
Description of changes
Addresses #202863
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)