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
pruneLibtoolFiles: init setup hook #41819
Conversation
A .la file specifies linker flags to link with the library it describes. Its "dependency_libs" field lists the libraries that this library depends upon. This list often contains "-l" flags without corresponding "-L" flags. Many packages in Nixpkgs deal with this in one of these ways: - delete .la file [1] - clear dependency_libs [2] - add -L flags to dependency_libs [3] - propagate dependencies [4] Sometimes "dependency_libs" contain wrong "-L" flags pointing to the "dev" output with headers rather than to the main output with libraries. They have to be edited or deleted to reduce closure size [5]. Deleting .la files is often but not always safe [6]. Atomatically deleting as many of them as possible is complex [7]. Deleting .la files that describe shared rather than static libraries is probably safe; but clearing their "dependency_libs" field achieves the same effect with less potential for unintended consequences. This is the approach that may be enabled for all Nixpkgs. [1] NixOS@2a79d29 [2] NixOS@c83a530 [3] NixOS@9e0dcf3 [4] NixOS@01134e6 [5] NixOS@f6c73f1 [6] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives [7] https://github.com/gentoo/gentoo/blob/fb1f2435/eclass/ltprune.eclass
Success on aarch64-linux (full log) Attempted: pruneLibtoolFiles Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: pruneLibtoolFiles Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: pruneLibtoolFiles Partial log (click to expand)
|
For the record, triton has opted to discover and replace |
One thing I've found though is that sometimes "-R" is used as well. See e93a8cb. |
A .la file specifies linker flags to link with the library it describes. Its
"dependency_libs" field lists the libraries that this library depends upon.
This list often contains "-l" flags without corresponding "-L" flags. Many
packages in Nixpkgs deal with this in one of these ways:
Sometimes "dependency_libs" contain wrong "-L" flags pointing to the "dev"
output with headers rather than to the main output with libraries. They have to
be edited or deleted to reduce closure size [5].
Deleting .la files is often but not always safe [6]. Atomatically deleting as
many of them as possible is complex [7]. Deleting .la files that describe
shared rather than static libraries is probably safe; but clearing their
"dependency_libs" field achieves the same effect with less potential for
unintended consequences. This is the approach that may be enabled for all
Nixpkgs.
[1] 2a79d29
[2] c83a530
[3] 9e0dcf3
[4] 01134e6
[5] f6c73f1
[6] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives
[7] https://github.com/gentoo/gentoo/blob/fb1f2435/eclass/ltprune.eclass
I intend to merge this not enabled by default for use by individual packages, and to enable it by default on the next
staging
cycle.