Commit Graph

29 Commits

Author SHA1 Message Date
nixpkgs-ci[bot]
d6ac0273cd Merge staging-next into staging 2025-10-01 00:19:21 +00:00
Alyssa Ross
05a384cfe2 llvmPackages.libunwind: condition doFakeLibgcc on !stdenv.hostPlatform.isStatic (#417354) 2025-09-30 15:30:28 +00:00
Luna
11f69a77db llvmPackages.libunwind: clean up rebuild avoidance 2025-09-30 08:25:32 -07:00
Emily
2dac87bbde llvmPackages_17: drop 2025-09-14 19:03:24 +01:00
Emily
a892ce396d llvmPackages_16: 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
Emily
9b8a66c3a4 llvmPackages_12: 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
Greg Hellings
33e9d4f3c0 libunwind: fix dangling symlink errors
Windows ucrt for aarch64 crossPkgs fail building because of the dangling
symlinks this code introduces
2025-07-19 18:17:08 +02:00
Peter Waller
8f10f4f469 llvmPackages.libunwind: condition doFakeLibgcc on !stdenv.hostPlatform.isStatic
Since #380683, broken symlinks prevent the package from building on
pkgsStatic.pkgsLLVM.

So far as I know, isStatic builds don't have shared objects, so don't
emit these broken symlinks for them.

Signed-off-by: Peter Waller <p@pwaller.net>
2025-06-16 21:23:26 +01:00
Tristan Ross
4f8431266c llvmPackages.libunwind: add fake libgcc 2025-05-07 07:42:50 -07:00
Tristan Ross
580f5b27e1 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move post install 2025-04-09 11:34:34 +02:00
Tristan Ross
0d1beffa7d llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move pre and post patch hooks 2025-04-09 11:34:34 +02:00
Tristan Ross
b512c59df3 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move patches 2025-04-09 11:34:34 +02:00
Tristan Ross
80bedaea05 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move src 2025-04-09 11:34:34 +02:00
Tristan Ross
dae47665ec llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move pname 2025-04-09 11:34:34 +02:00
Tristan Ross
19cd20612c llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: use final attrs instead of rec 2025-04-09 11:34:34 +02:00
Tristan Ross
95415a8fc5 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: use lib.cmake functions 2025-04-09 11:34:34 +02:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
John Ericson
e91a742511 llvmPackages.libunwind: fix mingw build problem (#379996) 2025-03-27 20:49:33 -04:00
Tristan Ross
1a148262f4 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move patches out of common 2025-03-07 14:16:40 +01:00
Greg Hellings
7118a85d93 llvmPackages.libunwind: fix mingw build problem
Fixes a broken symlink in the MinGW targets for the shared library

Fixes #379993
2025-02-08 15:25:10 -06:00
Tristan Ross
ba1deff5ad llvmPackages.*: Expose git rev through pkg.src.rev (#354792) 2024-12-16 19:38:25 -08:00
sternenseemann
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]: 665ebfb253/pkgs/development/compilers/llvm/12/default.nix (L392-L430)

(cherry picked from commit ee9eacf23e)
(cherry picked from commit c4e9f17ef9)
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
Tristan Ross
ae92b08fd4 llvmPackages_{12,13,14,15,16,17,18,git}: use common libunwind 2024-04-11 22:54:11 -07:00