Skip to content

[Backport staging-24.11] llvmPackages_12: build from monorepo source#356654

Merged
emilazy merged 4 commits intostaging-24.11from
backport-348568-to-staging-24.11
Nov 17, 2024
Merged

[Backport staging-24.11] llvmPackages_12: build from monorepo source#356654
emilazy merged 4 commits intostaging-24.11from
backport-348568-to-staging-24.11

Conversation

@github-actions
Copy link
Contributor

Bot-based backport to staging-24.11, triggered by a label in #348568.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-commiter, if you find that it is not acceptable, leave a comment.

We just need to make sure the attribute evaluates so we can cleanly
access `meta.broken` for those versions.

(cherry picked from commit ce6c31c)
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 commit makes LLVM 12 start from the monorepo
as well, simplifying all common LLVM expressions in the process.

With #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

(cherry picked from commit ee9eacf)
All LLVM versions < 12 have been removed, so this patch can live in the
versioned directory, simplifying the patch list in the process.

(cherry picked from commit 8408b91)
Seems like the patch we've written for LLVM 13 and above also works for
LLVM 12 which seems a little more robust.

(cherry picked from commit 3743784)
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Nov 17, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 17, 2024
@emilazy emilazy merged commit bcf31aa into staging-24.11 Nov 17, 2024
@emilazy emilazy deleted the backport-348568-to-staging-24.11 branch November 17, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants