llvmPackages_12: build from monorepo source#348568
Conversation
|
|
dda8d8a to
a475c8b
Compare
|
I'm going to re-test everything, now that everything is rebased on staging, just to be sure. |
|
lldb in LLVM 12 failed to resolve the |
a475c8b to
628e484
Compare
|
|
|
@reckenrode Any ideas about the followng error (staging, aarch64-darwin, llvmPackages_12.libcxx)? Interestingly, before my PR, compilation fails later, in |
2909afd to
989ba37
Compare
Darwin needed to use
Its test for a working C++ compiler appears to be trying to link libc++ even though libcxx is building with Does it build if you deaddine |
|
OK. I believe we haven’t yet done an eval with the |
We just need to make sure the attribute evaluates so we can cleanly access `meta.broken` for those versions.
As mentioned in NixOS#305146, keeping LLVM 12 is a source of pain because it is the only version to be built from individual release tarball instead of the LLVM monorepo. This commit makes LLVM 12 start from the monorepo as well, simplifying all common LLVM expressions in the process. With NixOS#347887, some quirks in the expressions for LLVM <14 were ironed out, so building LLVM through from the monorepo is quite simple now. - Most expressions only required minor changes, mostly removing the special casing for `sourceRoot`. - The patch lists from llvm/12/default.nix were ported to common/default.nix. This only required a few extra conditionals which could be reduced via a rebuild also involving other LLVM versions. Outstanding tasks of little urgency have been noted in TODO comments. I have verified that the patch lists stay the same for all packages except LLVM where merely the order changes. An extra set of eyes is appreciated, of course. - clang: The expression was reworked to use the same symlink location for clang-tools-extra for all versions including LLVM 12. This required adjusting the ad hoc patching of the clangd cmake files slightly. - libunwind: We no longer need to make the libcxx sources available manually. We can rely on the monorepo source instead. - lld: We no longer need to make the libunwind sources available manually. - llvm: We no longer need to make the polly sources available manually - On Darwin, we need to bypass CMake's C++ compiler for libcxx and libunwind now. It isn't a 100% clear why, probably because we've started to use Darwin's bootstrapStdenv for libcxx in the common expression compared to LLVM 12 on master [1]. The reordering of flags for wasm causes a rebuild for some packages like firefox, but this should be tolerable on staging. [1]: https://github.com/NixOS/nixpkgs/blob/665ebfb253caba7b85c2affefe2a92b305def4e6/pkgs/development/compilers/llvm/12/default.nix#L392-L430
All LLVM versions < 12 have been removed, so this patch can live in the versioned directory, simplifying the patch list in the process.
Seems like the patch we've written for LLVM 13 and above also works for LLVM 12 which seems a little more robust.
8708697 to
3743784
Compare
|
Rebased, but currently untested. I'd at least want to look at ofborg's rebuild overview before merging. |
|
Glad this is happening! :) |
|
Builds on the community builders, only 220 rebuilds outside of |
|
Realized that actually the |
|
I had a failure in |
|
Successfully created backport PR for |
llvm/llvm-project@b31080c looks like it fixes the race |
| (cd tools && ln -s ../../clang-tools-extra extra) | ||
| '' + lib.optionalString (lib.versionOlder release_version "13") '' | ||
| substituteInPlace tools/extra/clangd/quality/CompletionModel.cmake \ | ||
| --replace ' ''${CMAKE_SOURCE_DIR}/../clang-tools-extra' ' ''${CMAKE_SOURCE_DIR}/tools/extra' |
There was a problem hiding this comment.
#356120 (--replace-fail) broke this one on clang 12 (staging 03ed65c).
The path tools/extra doesn't exist; the only reference to it I could find is in the deleted diff hunk which appears after this one. I take it you somehow separated out clang-tools-extra from this derivation and therefore it is vestigial and can be removed. Correct?
There was a problem hiding this comment.
Oh no, wait, I see (cd tools && ln -s ../../clang-tools-extra extra) retained in this diff which I missed. Hmm.
There was a problem hiding this comment.
Found it, it's vestigial because the patch which removed CMAKE_SOURCE_DIR was removed in 12.0.1:
llvm/llvm-project@3be5dbb
There was a problem hiding this comment.
Can't comment much more, I've just tried to preserve all the parts of the phases in the original LLVM 12 expressions. They may have been unnecessarily copied from earlier versions, yes.
…l.cmake Fix up NixOS#356120 for clang 12. The failing replacement target was removed between llvm 12.0.0 and 12.0.1. Ref: NixOS#348568 (comment) Ref: llvm/llvm-project@3be5dbb Signed-off-by: Peter Waller <[email protected]>
…l.cmake Fix up #356120 for clang 12. The failing replacement target was removed between llvm 12.0.0 and 12.0.1. Ref: #348568 (comment) Ref: llvm/llvm-project@3be5dbb Signed-off-by: Peter Waller <[email protected]>
As mentioned in #305146, keeping LLVM 12 is a source of pain because it
is the only version to be built from individual release tarball instead
of the LLVM monorepo. This change makes LLVM 12 start from the monorepo
as well, simplifying all common LLVM expressions in the process.
No more LLVM 12 specific
default.nix!Additionally, some additional, simple cleanups are included that just rebuild LLVM 12.
Consequently, this PR is best reviewed commit by commit.
The common
default.nix's patch logic can further be simplified by a separate changethat rebuilds all LLVM versions.
This change is not breaking and could be included in 24.11 (or backported if we miss
the window) which seems wise. I've tested LLVM 12 on x86_64-linux and aarch64-linux.
I've also tested GHC 8.10.7 (which uses LLVM 12) on aarch64-linux.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.