-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Separate static libraries to dev outputs automatically #164141
Comments
Summing up all static libraries on my system, it seems they consume 523M
|
Haskell packages are another big source of static libraries. |
For LLVM in particular I recently did this: But I agree that a generic solution would be nice, I started hacking on a hook doing just that but patching the cmake target files is not trivial. |
@rnhmjoj Haskell (GHC) libraries can be linked into binaries either dynamically or statically, as desired, it’s just that nearly every library or compiler change amounts to an ABI incompatibility, so the traditional (outside of Nix) benefit of transparent upgrades does not apply, only that of sharing read-only pages. I don’t know which way Nix links by default. (Glibc is always linked dynamically.) Of course, the |
What should be the behaviour of nixpkgs/pkgs/servers/invidious/lsquic.nix Lines 85 to 98 in faef939
|
replace it by getDev? |
Describe the bug
Looking at space used by nix packages, it seems there's a lot of packages that used Nx space due to having static libraries in out/lib outputs. The first such package I found is llvm.lib used by mesa: it consumes ~300 MB while most of the space is used by static libraries that are helpful only while building something, shared libraries in the package are only around ~100 MB, so it's grown around 3x by that issue. Then, when I started looking at all static libraries in /nix/store with
find
, rav1e stands out from all other packages. Entire consumed space by rav1e is 89M, librav1e.a is 81M while librav1e.so.0.5.1 is only 3,2M. The package is around 10X bigger than if static libraries were separated and 25X bigger than if there was a lib output with only shared library.Steps To Reproduce
Steps to reproduce the behavior:
nix-store -qR /run/current-system | xargs -I [] find [] -name '*.a' -exec du -h {} \; | sort -h
Expected behavior
Static libraries are in dev output
Additional context
My /nix/store (and
nix-store -qR /run/current-system | xargs du -csh | sort -h
) is 12GB afternix-collect-garbage -d
and I'm trying to understand why it's so big while a similar configuration with other distros would consume a way less space...Notify maintainers
@lovek323 @7c6f434c @dtzWill @primeos for LLVM, it seems rav1e has no maintainers and I don't know who to mention for a generic solution across all the packages...
Metadata
The text was updated successfully, but these errors were encountered: