-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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
llvmPackages/libllvm: do not include static archives when shared is r… #162607
Conversation
9ca2cbe
to
b3cddf8
Compare
I was a bit too optimistic when opening this PR because the stripped down version of libllvm is sufficient for mesa, but there are other derivations whicht break. E.g.
Would it be acceptable to move |
7d2c5fa
to
8f8b8a4
Compare
So I just did what I said yesterday and moved the archives to the I also manually confirmed that the nixos tests "login" and "sway" succeed, which already exercises those changes quite a bit. Currently my machine is evaluating the "xfce" test. Anything else I should do? |
Reduces closure size by ~240MiB (down to ~100MiB) for LLVM 13, the others are similar. Having those archives in the lib output makes no sense as they are no runtime dependencies. Removing them alltogether is also not an option because the dynamic libraries offer only the C API while many users of libllvm require the C++ API. Those users must have an dependency on libllvm.dev anyway and will find those files for linking.
8f8b8a4
to
1748887
Compare
I'm not happy with duplicating the exact same change 11 times with this commit, but I fear that's the style the different LLVM versions are handled in nixpkgs. So I think getting rid of the duplication would be out of scope here, if it is desirable at all. |
Out of scope but I wouldn't mind if some of this stuff gets deduplicated. |
I promise I'll come back to this when I have a beefier machine under my desk, the compile times ain't funny. ;-) |
This should probably target |
I see, this is a bit exciting. So if there is a consensus that this might be a good idea I'll work on this a bit more to reduce code duplication in But before I invest my time on this I'd like to know if this is "the way to go" in general. I stumbled upon this because |
I think deduplication would need a larger discussion in terms of whether people who do LLVM updates expect significant changes in build procedures between versions in the future. |
@waldheinz This change caused Edit: I forgot how this changed, patching llvm-config won't really work (or shouldn't) anymore, we need to either make LLVM install into different directories using it's CMake flags and nothing else. |
Reverts #162607 / 1748887. Reason for revert: This change caused llvm-config{,-native} to be unable to find static archives bundled with LLVM, as has been [reported]. Ever since #152944 using moveToOutput in LLVM is _evil_ because llvm-config obtains it knowledge about the installation locations from the CMake configure step. Consequently a change like #162607 will need to be implemented by making LLVM itself install the static archives to the correct location or by adding yet another patch which updates llvm-config's knowledge of the location. The latter is not desireable in my opinion, though, since it is just asking for this sort of trouble: Before #152944 we had an outputs.patch that did this sort of things which broke spectacularly in edge cases. Fixes #148117. [reported]: #148117 (comment)
Proposed in #178007. |
Reverts #162607 / 1748887. Reason for revert: This change caused llvm-config{,-native} to be unable to find static archives bundled with LLVM, as has been [reported]. Ever since #152944 using moveToOutput in LLVM is _evil_ because llvm-config obtains it knowledge about the installation locations from the CMake configure step. Consequently a change like #162607 will need to be implemented by making LLVM itself install the static archives to the correct location or by adding yet another patch which updates llvm-config's knowledge of the location. The latter is not desireable in my opinion, though, since it is just asking for this sort of trouble: Before #152944 we had an outputs.patch that did this sort of things which broke spectacularly in edge cases. Fixes #148117. [reported]: #148117 (comment)
Reverts #162607 / 1748887. Reason for revert: This change caused llvm-config{,-native} to be unable to find static archives bundled with LLVM, as has been [reported]. Ever since #152944 using moveToOutput in LLVM is _evil_ because llvm-config obtains it knowledge about the installation locations from the CMake configure step. Consequently a change like #162607 will need to be implemented by making LLVM itself install the static archives to the correct location or by adding yet another patch which updates llvm-config's knowledge of the location. The latter is not desireable in my opinion, though, since it is just asking for this sort of trouble: Before #152944 we had an outputs.patch that did this sort of things which broke spectacularly in edge cases. Fixes #148117. [reported]: #148117 (comment) (cherry picked from commit a2ed5b2)
Reverts #162607 / 1748887. Reason for revert: This change caused llvm-config{,-native} to be unable to find static archives bundled with LLVM, as has been [reported]. Ever since #152944 using moveToOutput in LLVM is _evil_ because llvm-config obtains it knowledge about the installation locations from the CMake configure step. Consequently a change like #162607 will need to be implemented by making LLVM itself install the static archives to the correct location or by adding yet another patch which updates llvm-config's knowledge of the location. The latter is not desireable in my opinion, though, since it is just asking for this sort of trouble: Before #152944 we had an outputs.patch that did this sort of things which broke spectacularly in edge cases. Fixes #148117. [reported]: #148117 (comment) (cherry picked from commit a2ed5b2)
Reduces closure size by ~240MiB for LLVM 13, I assume the
others are similar.