6 cc-wrapper = with builtins; let
7 pkgNames = (attrNames pkgs);
9 pkgSets = lib.pipe pkgNames [
10 (filter (lib.hasPrefix "llvmPackages"))
11 (filter (n: n != "rocmPackages.llvm"))
13 (filter (n: n != "llvmPackages_rocm"))
14 (filter (n: n != "llvmPackages_latest"))
15 (filter (n: n != "llvmPackages_git"))
17 tests = lib.genAttrs pkgSets (name: recurseIntoAttrs {
18 clang = callPackage ./cc-wrapper { stdenv = pkgs.${name}.stdenv; };
19 libcxx = callPackage ./cc-wrapper { stdenv = pkgs.${name}.libcxxStdenv; };
24 pkgSets = lib.pipe (attrNames pkgs) ([
25 (filter (lib.hasPrefix "gcc"))
26 (filter (lib.hasSuffix "Stdenv"))
27 (filter (n: n != "gccCrossLibcStdenv"))
28 ] ++ lib.optionals (!(
29 (stdenv.buildPlatform.isLinux && stdenv.buildPlatform.isx86_64) &&
30 (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64)
32 (filter (n: !lib.hasSuffix "MultiStdenv" n))
34 in lib.genAttrs pkgSets (name: callPackage ./cc-wrapper { stdenv = pkgs.${name}; });
36 default = callPackage ./cc-wrapper { };
38 supported = stdenv.mkDerivation {
39 name = "cc-wrapper-supported";
42 inherit (lib) filterAttrs;
43 sets = lib.pipe gccTests ([
44 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.stdenv.cc))
46 (filterAttrs (n: _: n != "gcc49Stdenv"))
47 (filterAttrs (n: _: n != "gccMultiStdenv"))
48 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
49 # fails with things like
50 # ld: warning: ld: warning: object file (trunctfsf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
51 # ld: warning: ld: warning: could not create compact unwind for ___fixunstfdi: register 20 saved somewhere other than in frame
52 (filterAttrs (n: _: n != "gcc11Stdenv"))
59 inherit (lib) filterAttrs;
60 sets = lib.pipe llvmTests ([
61 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.clang.stdenv.cc))
62 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.libcxx.stdenv.cc))
65 # fix in https://github.com/NixOS/nixpkgs/pull/216273
66 ] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
67 # libcxx does not build for some reason on aarch64-linux
68 (filterAttrs (n: _: n != "llvmPackages_7"))
69 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
70 (filterAttrs (n: _: n != "llvmPackages_6"))
71 (filterAttrs (n: _: n != "llvmPackages_7"))
72 (filterAttrs (n: _: n != "llvmPackages_8"))
73 (filterAttrs (n: _: n != "llvmPackages_9"))
74 (filterAttrs (n: _: n != "llvmPackages_10"))
83 llvmTests = recurseIntoAttrs llvmTests;
87 stdenv-inputs = callPackage ./stdenv-inputs { };
88 stdenv = callPackage ./stdenv { };
90 hardeningFlags = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {});
91 hardeningFlags-gcc = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
94 hardeningFlags-clang = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
95 stdenv = llvmPackages.stdenv;
98 config = callPackage ./config.nix { };
100 top-level = callPackage ./top-level { };
102 haskell = callPackage ./haskell { };
104 hooks = callPackage ./hooks { };
106 cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
107 cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
109 fetchurl = callPackages ../build-support/fetchurl/tests.nix { };
110 fetchtorrent = callPackages ../build-support/fetchtorrent/tests.nix { };
111 fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { };
112 fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; };
113 fetchDebianPatch = callPackages ../build-support/fetchdebianpatch/tests.nix { };
114 fetchzip = callPackages ../build-support/fetchzip/tests.nix { };
115 fetchgit = callPackages ../build-support/fetchgit/tests.nix { };
116 fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
118 install-shell-files = callPackage ./install-shell-files {};
120 kernel-config = callPackage ./kernel.nix {};
122 ld-library-path = callPackage ./ld-library-path {};
124 macOSSierraShared = callPackage ./macos-sierra-shared {};
126 cross = callPackage ./cross {};
128 php = recurseIntoAttrs (callPackages ./php {});
130 pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { });
132 buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
133 importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
135 vim = callPackage ./vim {};
137 nixos-functions = callPackage ./nixos-functions {};
139 overriding = callPackage ./overriding.nix { };
141 texlive = callPackage ./texlive {};
143 cuda = callPackage ./cuda { };
145 trivial-builders = callPackage ../build-support/trivial-builders/test/default.nix {};
147 writers = callPackage ../build-support/writers/test.nix {};
149 testers = callPackage ../build-support/testers/test/default.nix {};
151 dhall = callPackage ./dhall { };
153 cue-validation = callPackage ./cue {};
155 coq = callPackage ./coq {};
157 dotnet = recurseIntoAttrs (callPackages ./dotnet { });
159 makeHardcodeGsettingsPatch = callPackage ./make-hardcode-gsettings-patch { };
161 makeWrapper = callPackage ./make-wrapper { };
162 makeBinaryWrapper = callPackage ./make-binary-wrapper {
163 makeBinaryWrapper = pkgs.makeBinaryWrapper.override {
164 # Enable sanitizers in the tests only, to avoid the performance cost in regular usage.
165 # The sanitizers cause errors on aarch64-darwin, see https://github.com/NixOS/nixpkgs/pull/150079#issuecomment-994132734
166 sanitizers = pkgs.lib.optionals (! (pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64))
167 [ "undefined" "address" ];
171 pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; });
173 nixpkgs-check-by-name = callPackage ./nixpkgs-check-by-name { };