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
haskellPackages.stack: enableSharedExecutables = false; #20133
Conversation
The `stack` binary has a large number of dependencies, and therefore loads a large number of shared objects on startup (I count 20,000 `open` syscalls with `strace` when running `stack --version`). Statically linking haskell dependencies brings the time taken for `stack --version` from 1.3 seconds to 0.006 seconds on my machine. I think it's worth it, since the binary is frequently invoked for short operations during a dev workflow.
@@ -157140,6 +157140,7 @@ self: { | |||
QuickCheck resourcet retry smallcheck store template-haskell | |||
temporary text th-reify-many transformers vector | |||
]; | |||
enableSharedExecutables = false; |
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.
this is the only actual change, the rest is just automatic trailing whitespace removal (feel free to disregard it of course)
note: upstream ships |
@peti what do you think? (the reviewer-adding bot seems to have not kicked in here) |
note: code diff with whitespace changes ignored: https://github.com/NixOS/nixpkgs/pull/20133/files?w=1 |
We've been building a lean version of |
When I install @anderspapitto Do you know what I need to do to get a statically linked one via nix? (ATM I'm manually downloading the statically linked executable from the stack github release page.) Edit: $ nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
"17.03pre99414.b2b32ea" |
@themoritz you want |
Awesome, thanks! |
The
stack
binary has a large number of dependencies, and thereforeloads a large number of shared objects on startup (I count 20,000
open
syscalls with
strace
when runningstack --version
).Statically linking haskell dependencies brings the time taken for
stack --version
from 1.3 seconds to 0.006 seconds on my machine. I think it'sworth it, since the binary is frequently invoked for short operations
during a dev workflow.