28 Commits
Author SHA1 Message Date
Grimmauld 1d05796574 treewide: openmpCheckPhaseHook -> checkPhaseThreadLimitHook 2026-07-10 00:47:02 +02:00
Grimmauld 559ae88af9 llvmPackages.openmp: propagate openmpCheckPhaseHook 2026-06-26 18:42:06 +02:00
Emily 3a8c494305 llvmPackages: remove things made unnecessary by splicing 2025-10-25 20:07:13 +01:00
Emily 210060e66c llvmPackages.openmp: don’t use a target platform LLVM
This was used in 4b07aeae16 to get
what was actually a *host* LLVM in practice, when the `buildHost`
LLVM package set was included in the `callPackage` scope used for
libraries. It should no longer be necessary and is now quite confusing.
2025-10-25 20:07:13 +01:00
Wolfgang Walther 5e1f5b623b Merge branch 'staging-next' into staging 2025-10-05 11:40:56 +02:00
Wolfgang Walther 91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Luna f85d20b665 llvmPackages.openmp: clean up rebuild avoidance 2025-09-28 21:08:29 -07:00
Emily 2dac87bbde llvmPackages_17: drop 2025-09-14 19:03:24 +01:00
Emily f470ea24b6 llvmPackages_14: drop 2025-09-14 19:03:24 +01:00
Emily 791fe23b63 llvmPackages_13: drop 2025-09-14 19:03:24 +01:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Tristan RossandAlyssa Ross 219e1bbd02 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: nixfmt 2025-04-02 16:20:20 +02:00
Tristan RossandAlyssa Ross d07d21818b llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: use lib.cmake functions 2025-04-02 16:20:20 +02:00
Tristan RossandAlyssa Ross acfb171686 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: condense native build inputs 2025-04-02 16:20:20 +02:00
Tristan RossandAlyssa Ross b6c57aadc7 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: move src 2025-04-02 16:20:20 +02:00
Tristan RossandAlyssa Ross 8e716103ee llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: move pname 2025-04-02 16:20:20 +02:00
Tristan RossandAlyssa Ross 7032a9014b llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: use final attrs instead of rec 2025-04-02 16:20:20 +02:00
Tristan RossandAlyssa Ross 946113bbf7 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: move patches out of common 2025-03-07 14:16:58 +01:00
Alyssa Ross d570710367 Reapply "llvmPackages.openmp: Build static libraries when appropriate"
This reverts commit c006d5f063.

Mass rebuild accidentally merged to master, now being resubmitted to
staging.
2025-02-09 08:55:29 +01:00
Alyssa Ross 110af7ef47 Reapply "llvmPackages.openmp: Make OMPD customisable, add missing Python dependency"
This reverts commit fa648b2835.

Mass rebuild accidentally merged to master, now being resubmitted to
staging.  Python had been added as an unconditionial build input on
staging in 261db7efdc ("llvmPackages.openmp: fix cross build"), but
we're keeping it conditional here per discussion with the author of
that change.

Link: https://github.com/NixOS/nixpkgs/pull/380299#issuecomment-2645492202
2025-02-09 08:55:29 +01:00
FliegendeWurst 261db7efdc llvmPackages.openmp: fix cross build 2025-01-20 09:10:12 +01:00
Tristan RossandGitHub ba1deff5ad llvmPackages.*: Expose git rev through pkg.src.rev (#354792) 2024-12-16 19:38:25 -08:00
sternenseemannandVladimír Čunát f0f66c41d4 llvmPackages_12: build from monorepo source
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 ee9eacf23e)
(cherry picked from commit c4e9f17ef944bb7ce0d3d1226d7f922f28e46b02)
2024-11-30 15:11:09 +01:00
Peter Waller cdefc40e99 llvmPackages.*: Expose git rev through pkg.src.rev
Also exposes owner, repo, and other attributes available on the original
monorepoSrc. These attributes were previously hidden behind a
runCommand that consumes monorepoSrc and hides this information away.

```
$ nix eval --raw .#llvmPackages_18.llvm.src.rev
llvmorg-18.1.8

$ nix eval --raw .#llvmPackages_git.llvm.src.rev
0e8555d4dbfdfeddc01dc2ecf9a9b6e804f7b645
```

Signed-off-by: Peter Waller <p@pwaller.net>
2024-11-09 15:12:56 +00:00
sternenseemann 1d6675e530 llvmPackages_13: build from filtered monorepoSrc
This change implements a leftover task from #307211, namely passing
monorepoSrc to the different llvmPackages_13 package expressions. Before
this change, all packages llvmPackages_13 would be built from a
subdirectory of the full LLVM monorepo tree. After this change only the
relevant directories are made available at build time. This

- reduces the size of the source that needs to be made available to the
  builder.
- prevents LLVM from sidestepping our instructions and including extra
  sources from other directories it shouldn't.

Since LLVM 12 and 13 don't have the `cmake` directory at the top level,
the runCommand expressions filtering the source need to be adjusted, but
this causes no rebuild for any other LLVM version (ofborg should confirm
this).

The only problem encountered was in lld:

- We need to make the patch to the inclusion of libunwind headers
  unconditional now. lld needs this on non-darwin as well. In the
  full monorepo, LLVM_MAIN_SRC_DIR would be set correctly, so the
  patch wasn't necessary.
- The substitute mechanism for LLVM 12 and 13 can't be unified yet since
  LLVM 12 still uses a non monorepo build, so we come up with a
  different LLVM_MAIN_SRC_DIR.

Change was tested by building the following expression on x86_64-linux.

    with import ./. {};
    builtins.removeAttrs llvmPackages_13 [ "lldb" "lldbPlugins" ]'

lld was also tested on aarch64-darwin.
2024-10-14 12:15:32 +02:00
Peter Waller 290ec4e775 llvmPackages.*: Add devExtraCmakeFlags parameter
cmake flags have a 'last flag wins' logic, so by appending to the end of
the flags it is possible to override any cmake flag.

It also ignores (and warns) if a flag is unused, so passing flags across
all packages should be safe if you want to target one package.

In combination with #320261, this PR allows consistently overriding all
packages within LLVM with additional cmake arguments. Consistency here
means for example 'if you override LLVM, then all dependencies on it are
also see the overridden LLVM in their input'. Consistency is hard to
achieve with the other obvious way of implementing this as a user: if
you use overrideAttrs then you have to write a big mess of override code
in order to override all dependents, and this can be very difficult in a
cross-compilation scenario using crossSystem and useLLVM, for example.

With this PR it is possible to write an overlay which overlays
`llvmPackages` with `llvmPackage.override { devExtraCmakeFlags = [ ... ]; }`,
and then the toolchain used with useLLVM in effect should respect
these flags.

This is useful in development for experimenting with the effect of
various flags, hence the chosen name `devCmakeFlags`.

This won't work out of the box without #341855 applied, which fixes
override passthrough.

See-Also: #320261, #341855
Signed-off-by: Peter Waller <p@pwaller.net>
2024-09-15 11:50:52 +01:00
Sigmanificient 63d05d989e pkgs/development: remove unused arguments 2024-08-03 17:18:20 +02:00
Tristan Ross 8c71431f14 llvmPackages_{12,13,14,15,16,17,18,git}: use common openmp 2024-04-12 07:22:03 -07:00