Skip to content

[22.11] Backport llvmPackages_16#230327

Merged
primeos merged 9 commits intoNixOS:release-22.11from
primeos:llvm-16-backport
May 6, 2023
Merged

[22.11] Backport llvmPackages_16#230327
primeos merged 9 commits intoNixOS:release-22.11from
primeos:llvm-16-backport

Conversation

@primeos
Copy link
Member

@primeos primeos commented May 6, 2023

Description of changes

This is a backport of #223282 with some additional (trivial) commits to make it compatible with NixOS 22.11.
It only adds new packages and shouldn't change any existing packages.
We require LLVM 16 for building Chromium (where we need the most recent version (M113) for important security fixes).

On nixos-unstable the builds look fine so far: https://hydra.nixos.org/eval/1794582?filter=llvmPackages_16&compare=1794561&full=

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/)
  • 23.05 Release Notes (or backporting 22.11 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
  • Fits CONTRIBUTING.md.

RaitoBezarius and others added 9 commits May 6, 2023 13:33
(cherry picked from commit 2c627d9)
Reason: This backport is required for building Chromium on NixOS 22.11
(we need the most recent versions for important security fixes).
Kept separate from 2c627d9 to skip CI for this trivial change.

(cherry picked from commit 46d395e)
(cherry picked from commit c672de3)
Reason: This is required for llvmPackages_16 (and llvmPackages_15). Only
if stdenv.hostPlatform.isFreeBSD but backporting new packages is fine
and so that everything evaluates without errors.
This code is backported from nixos-unstable (2c627d9) and the power
platform isn't defined/supported on NixOS 22.11 yet, e.g.:
```
$ nix-instantiate -A llvmPackages_16
error: attribute 'power' missing

       at /home/michael/nixpkgs/worktrees/22.11/pkgs/development/compilers/llvm/16/default.nix:96:7:

           95|       lib.platforms.mips ++
           96|       lib.platforms.power ++
             |       ^
           97|       lib.platforms.riscv ++
(use '--show-trace' to show detailed location information)
```
This comes from eb2eafd (or rather [0]). I only backported the
patch instead of the whole commit to avoid mass rebuilds for
llvmPackages 13 and 14 (there is a small diff in the patches due to the
headers ("index" and the line numbers)).

This fixes:
```
error (ignored): error: end of string reached
error: getting status of 'pkgs/development/compilers/llvm/common/clang/add-nostdlibinc-flag.patch': No such file or directory
```

[0]: pkgs/development/compilers/llvm/git/clang/add-nostdlibinc-flag.patch
This code is backported from nixos-unstable (2c627d9) and isn't
fully compatible with NixOS 22.11 due to other missing
abstractions/changes. I simply went with the exact same code as the
other llvmPackages already use here. This fixes the following error:
```
error: cannot coerce a set to a string

        at pkgs/development/compilers/llvm/16/compiler-rt/default.nix:34:3:

            33|
            34|   env.NIX_CFLAGS_COMPILE = toString [
              |   ^
            35|     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
```
@primeos primeos requested a review from matthewbauer as a code owner May 6, 2023 12:01
@primeos
Copy link
Member Author

primeos commented May 6, 2023

@ofborg build llvmPackages_16

I only tested the evaluation so far:

$ nix-instantiate -A llvmPackages_16
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/86fpv6nb4zjpcvjp5xpy25qd6awqhsa5-llvm-binutils-wrapper-16.0.1.drv
/nix/store/28677s50j95vdwa2dmrlbm4rr0n8b0cx-llvm-binutils-16.0.1.drv
/nix/store/dpc8xzf4jgw55jrjz4ssp2smzzidq3wh-llvm-binutils-wrapper-16.0.1.drv
/nix/store/7vhmnsb7lcf986n173x8nya24h435xp8-clang-wrapper-16.0.1.drv
/nix/store/vgagxq7v2ldf37kc7z9kghxajvwkgpzv-clang-manpages-16.0.1.drv
/nix/store/s3ag3ha9miiz8if229azi22zfn9vknk3-clang-16.0.1.drv
/nix/store/pyap0hdcxnknwac3qw4dr37l2wn9mnhr-clang-wrapper-16.0.1.drv
/nix/store/hkaqai3n1r3bygr1jxs8flrxym4qyx57-clang-wrapper-16.0.1.drv
/nix/store/m0s7q6c45wzw427ya4ca2lwqlq5n9niz-clang-wrapper-16.0.1.drv
/nix/store/18a3yhq3y8k7pka2d1jwy6h74bf9dax4-clang-wrapper-16.0.1.drv
/nix/store/3dnhvlc5hir6y7cxs3jsni4nhi7prv75-clang-wrapper-16.0.1.drv
/nix/store/ljrqb9ni31pd348979b6g86srsfiqg0h-compiler-rt-libc-16.0.1.drv
/nix/store/ljrqb9ni31pd348979b6g86srsfiqg0h-compiler-rt-libc-16.0.1.drv
/nix/store/03dikf4i5c9q0kjfakym365kznvf9mha-libcxx-16.0.1.drv
/nix/store/5iiq413szhrvx6zsblrq2m81cdw8cas2-clang-wrapper-16.0.1.drv
/nix/store/ba4snx03y5vqs8fq1j3x5ynfpflw9dm1-stdenv-linux.drv
/nix/store/qjx68q7w3s534k81vf4bw7nrw5fbwvsd-libcxxabi-16.0.1.drv
/nix/store/m3dl5s6j3532r9faxnkqyx13zh5l8pgh-llvm-16.0.1.drv
/nix/store/3mpc941xxrg5z2bv67b21b697p95gg1z-libunwind-16.0.1.drv
/nix/store/5s8v4kjbxni7ijp9njwlbyqkm74rwfpp-lld-16.0.1.drv
/nix/store/0nigf0sca85x6sah7hrg1xx5f7z4i51c-lldb-16.0.1.drv
/nix/store/3fvsx6373npk6r7fzms9iacgf4bbrn25-lldb-manpages-16.0.1.drv
/nix/store/dm8cwh1ivr7dw126lcr2yc4fy4jqx2hi-llvm-manpages-16.0.1.drv
/nix/store/6a9mrlsxv9aqjg2zb3yd3q96zhfcqkl1-openmp-16.0.1.drv
/nix/store/p4phsczxvkddhbf9dyc4hcnhq6ny774g-stdenv-linux.drv

@primeos primeos mentioned this pull request May 6, 2023
12 tasks
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label May 6, 2023
@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 May 6, 2023
@primeos
Copy link
Member Author

primeos commented May 6, 2023

CI seems fine so let's give this a try :)
There should be no regressions as this should only add new packages.

@primeos primeos merged commit adc7c6f into NixOS:release-22.11 May 6, 2023
@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
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 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.

6 participants