Skip to content

Revert "llvmPackages: do not include static archives when shared…" - #178007

Merged
sternenseemann merged 1 commit into
stagingfrom
revert-162607-libllvm-drop-static
Jul 5, 2022
Merged

sternenseemann merged 1 commit into
stagingfrom
revert-162607-libllvm-drop-static

Conversation

@sternenseemann

Copy link
Copy Markdown
Member

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.


Tested with

$ ./result-dev/bin/llvm-config --link-static --libs
$ ./result-dev/bin/llvm-config --link-static --libnames

for the default LLVM version.

Note that this PR will increase the closure size of LLVM, but reduced closure size is not worth sacrifizing correctness for. There is no trivial way to fix @waldheinz's original patch, so reverting until a better solution is found is the better option.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

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)
@ofborg ofborg Bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Jun 17, 2022
@ofborg
ofborg Bot requested review from 7c6f434c, dtzWill, lovek323 and primeos June 17, 2022 11:16
@ofborg ofborg Bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jun 17, 2022
@kristoff3r

Copy link
Copy Markdown
Contributor

I got bitten by this while trying to make a derivation for https://antelang.org/, so I would be happy to see this merged.

@sternenseemann

Copy link
Copy Markdown
Member Author

I think everyone had enough time to comment.

@sternenseemann
sternenseemann merged commit 0083a68 into staging Jul 5, 2022
@sternenseemann
sternenseemann deleted the revert-162607-libllvm-drop-static branch July 5, 2022 13:03
@github-actions

github-actions Bot commented Jul 5, 2022

Copy link
Copy Markdown
Contributor

Successfully created backport PR #180233 for staging-22.05.

@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/visualizing-nix-closures/80102/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants