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_6"))
16 (filter (n: n != "llvmPackages_7"))
17 (filter (n: n != "llvmPackages_8"))
18 (filter (n: n != "llvmPackages_9"))
19 (filter (n: n != "llvmPackages_10"))
20 (filter (n: n != "llvmPackages_11"))
22 tests = lib.genAttrs pkgSets (name: recurseIntoAttrs {
23 clang = callPackage ./cc-wrapper { stdenv = pkgs.${name}.stdenv; };
24 libcxx = callPackage ./cc-wrapper { stdenv = pkgs.${name}.libcxxStdenv; };
29 pkgSets = lib.pipe (attrNames pkgs) ([
30 (filter (lib.hasPrefix "gcc"))
31 (filter (lib.hasSuffix "Stdenv"))
32 (filter (n: n != "gccCrossLibcStdenv"))
33 ] ++ lib.optionals (!(
34 (stdenv.buildPlatform.isLinux && stdenv.buildPlatform.isx86_64) &&
35 (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64)
37 (filter (n: !lib.hasSuffix "MultiStdenv" n))
39 in lib.genAttrs pkgSets (name: callPackage ./cc-wrapper { stdenv = pkgs.${name}; });
41 default = callPackage ./cc-wrapper { };
43 supported = stdenv.mkDerivation {
44 name = "cc-wrapper-supported";
47 inherit (lib) filterAttrs;
48 sets = lib.pipe gccTests ([
49 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.stdenv.cc))
51 (filterAttrs (n: _: n != "gccMultiStdenv"))
52 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
53 # fails with things like
54 # ld: warning: ld: warning: object file (trunctfsf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
55 # ld: warning: ld: warning: could not create compact unwind for ___fixunstfdi: register 20 saved somewhere other than in frame
56 (filterAttrs (n: _: n != "gcc11Stdenv"))
63 inherit (lib) filterAttrs;
64 sets = lib.pipe llvmTests ([
65 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.clang.stdenv.cc))
66 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.libcxx.stdenv.cc))
69 # fix in https://github.com/NixOS/nixpkgs/pull/216273
70 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
71 (filterAttrs (n: _: n != "llvmPackages_9"))
80 llvmTests = recurseIntoAttrs llvmTests;
84 devShellTools = callPackage ../build-support/dev-shell-tools/tests { };
86 stdenv-inputs = callPackage ./stdenv-inputs { };
87 stdenv = callPackage ./stdenv { };
89 hardeningFlags = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {});
90 hardeningFlags-gcc = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
93 hardeningFlags-clang = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
94 stdenv = llvmPackages.stdenv;
97 config = callPackage ./config.nix { };
99 top-level = callPackage ./top-level { };
101 haskell = callPackage ./haskell { };
103 hooks = callPackage ./hooks { };
105 cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
106 cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
108 compress-drv = callPackage ../build-support/compress-drv/test.nix { };
110 fetchurl = callPackages ../build-support/fetchurl/tests.nix { };
111 fetchtorrent = callPackages ../build-support/fetchtorrent/tests.nix { };
112 fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { };
113 fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; };
114 fetchDebianPatch = callPackages ../build-support/fetchdebianpatch/tests.nix { };
115 fetchzip = callPackages ../build-support/fetchzip/tests.nix { };
116 fetchgit = callPackages ../build-support/fetchgit/tests.nix { };
117 fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
118 fetchPypiLegacy = callPackages ../build-support/fetchpypilegacy/tests.nix { };
120 install-shell-files = callPackage ./install-shell-files {};
122 checkpointBuildTools = callPackage ./checkpointBuild {};
124 kernel-config = callPackage ./kernel.nix {};
126 ld-library-path = callPackage ./ld-library-path {};
128 cross = callPackage ./cross {} // { __attrsFailEvaluation = true; };
130 php = recurseIntoAttrs (callPackages ./php {});
132 pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }) // { __recurseIntoDerivationForReleaseJobs = true; };
134 buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
135 importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
137 vim = callPackage ./vim {};
139 nixos-functions = callPackage ./nixos-functions {};
141 overriding = callPackage ./overriding.nix { };
143 texlive = callPackage ./texlive {};
145 cuda = callPackage ./cuda { };
147 trivial-builders = callPackage ../build-support/trivial-builders/test/default.nix {};
149 writers = callPackage ../build-support/writers/test.nix {};
151 testers = callPackage ../build-support/testers/test/default.nix {};
153 dhall = callPackage ./dhall { };
155 cue-validation = callPackage ./cue {};
157 coq = callPackage ./coq {};
159 dotnet = recurseIntoAttrs (callPackages ./dotnet { });
161 makeHardcodeGsettingsPatch = callPackage ./make-hardcode-gsettings-patch { };
163 makeWrapper = callPackage ./make-wrapper { };
164 makeBinaryWrapper = callPackage ./make-binary-wrapper {
165 makeBinaryWrapper = pkgs.makeBinaryWrapper.override {
166 # Enable sanitizers in the tests only, to avoid the performance cost in regular usage.
167 # The sanitizers cause errors on aarch64-darwin, see https://github.com/NixOS/nixpkgs/pull/150079#issuecomment-994132734
168 sanitizers = pkgs.lib.optionals (! (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64))
169 [ "undefined" "address" ];
173 pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; });
175 buildFHSEnv = recurseIntoAttrs (callPackages ./buildFHSEnv { });
177 nixpkgs-check-by-name = throw "tests.nixpkgs-check-by-name is now specified in a separate repository: https://github.com/NixOS/nixpkgs-check-by-name";
179 auto-patchelf-hook = callPackage ./auto-patchelf-hook { };
181 systemd = callPackage ./systemd { };
183 replaceVars = recurseIntoAttrs (callPackage ./replace-vars { });
185 substitute = recurseIntoAttrs (callPackage ./substitute { });