-
-
Notifications
You must be signed in to change notification settings - Fork 47
Minimize closure with keep-derivations = false
#13
Conversation
I have mixed feelings about this change. My intention with this image has always been to provide the smallest possible working |
Apparently there are 2 glibc's in the closure, one of which comes from this installed bash and another from the installed Nix. I'll try to figure out how both can use the same glibc to decrease closure size. |
Reduces image size from 161MB to 147MB
036554e
to
801231b
Compare
I was able to minimize closure size from 161MB to 149MB, while adding bash at no extra cost :) This is done by:
See commits for more details |
801231b
to
c798344
Compare
After thinking about it some more, what you suggested sounds fine to me. I removed all but the first commit which minimizes the closure a bit more. |
NIX_BUILD_SHELL
to a persistent bashkeep-derivations = false
Ping? |
Sorry for being unresponsive. I have a bad cold and can't do much productive work at the moment. Give me another day or two, please, then I'll revisit this PR! |
With the work in #31 (which was upstreamed to We can look at the closure size of |
If this is not done, nix-shell tries to use in NIX_PATH to get
a bash, which is a problem if that doesn't exist.
Also because
nix-shell
doesn't gcroot the bash it uses from<nixpkgs>
, this can lead to it having to build/fetch bash first before it can start, which slows it down a couple seconds.This increases the image size from 161MB to 175MB (~8%), but considering that bash is something almost always needed I think this is reasonable.
This PR is sponsored by Niteo ✨