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 (filter (n: n != "gcc49Stdenv"))
34 (filter (n: n != "gcc6Stdenv"))
35 ] ++ lib.optionals (!(
36 (stdenv.buildPlatform.isLinux && stdenv.buildPlatform.isx86_64) &&
37 (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64)
39 (filter (n: !lib.hasSuffix "MultiStdenv" n))
41 in lib.genAttrs pkgSets (name: callPackage ./cc-wrapper { stdenv = pkgs.${name}; });
43 default = callPackage ./cc-wrapper { };
45 supported = stdenv.mkDerivation {
46 name = "cc-wrapper-supported";
49 inherit (lib) filterAttrs;
50 sets = lib.pipe gccTests [
51 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.stdenv.cc))
53 (filterAttrs (n: _: n != "gccMultiStdenv"))
60 inherit (lib) filterAttrs;
61 sets = lib.pipe llvmTests [
62 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.clang.stdenv.cc))
63 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.libcxx.stdenv.cc))
72 llvmTests = recurseIntoAttrs llvmTests;
76 devShellTools = callPackage ../build-support/dev-shell-tools/tests { };
78 stdenv-inputs = callPackage ./stdenv-inputs { };
79 stdenv = callPackage ./stdenv { };
81 hardeningFlags = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {});
82 hardeningFlags-gcc = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
85 hardeningFlags-clang = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
86 stdenv = llvmPackages.stdenv;
89 config = callPackage ./config.nix { };
91 top-level = callPackage ./top-level { };
93 haskell = callPackage ./haskell { };
95 hooks = callPackage ./hooks { };
97 cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
98 cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
100 compress-drv = callPackage ../build-support/compress-drv/test.nix { };
102 fetchurl = callPackages ../build-support/fetchurl/tests.nix { };
103 fetchtorrent = callPackages ../build-support/fetchtorrent/tests.nix { };
104 fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { };
105 fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; };
106 fetchDebianPatch = callPackages ../build-support/fetchdebianpatch/tests.nix { };
107 fetchzip = callPackages ../build-support/fetchzip/tests.nix { };
108 fetchgit = callPackages ../build-support/fetchgit/tests.nix { };
109 fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
110 fetchPypiLegacy = callPackages ../build-support/fetchpypilegacy/tests.nix { };
112 install-shell-files = callPackage ./install-shell-files {};
114 checkpointBuildTools = callPackage ./checkpointBuild {};
116 kernel-config = callPackage ./kernel.nix {};
118 ld-library-path = callPackage ./ld-library-path {};
120 cross = callPackage ./cross {} // { __attrsFailEvaluation = true; };
122 php = recurseIntoAttrs (callPackages ./php {});
124 pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }) // { __recurseIntoDerivationForReleaseJobs = true; };
126 buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
127 importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
129 vim = callPackage ./vim {};
131 nixos-functions = callPackage ./nixos-functions {};
133 overriding = callPackage ./overriding.nix { };
135 texlive = callPackage ./texlive {};
137 cuda = callPackage ./cuda { };
139 trivial-builders = callPackage ../build-support/trivial-builders/test/default.nix {};
141 writers = callPackage ../build-support/writers/test.nix {};
143 testers = callPackage ../build-support/testers/test/default.nix {};
145 dhall = callPackage ./dhall { };
147 cue-validation = callPackage ./cue {};
149 coq = callPackage ./coq {};
151 dotnet = recurseIntoAttrs (callPackages ./dotnet { });
153 makeHardcodeGsettingsPatch = callPackage ./make-hardcode-gsettings-patch { };
155 makeWrapper = callPackage ./make-wrapper { };
156 makeBinaryWrapper = callPackage ./make-binary-wrapper {
157 makeBinaryWrapper = pkgs.makeBinaryWrapper.override {
158 # Enable sanitizers in the tests only, to avoid the performance cost in regular usage.
159 # The sanitizers cause errors on aarch64-darwin, see https://github.com/NixOS/nixpkgs/pull/150079#issuecomment-994132734
160 sanitizers = pkgs.lib.optionals (! (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64))
161 [ "undefined" "address" ];
165 pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; });
167 buildFHSEnv = recurseIntoAttrs (callPackages ./buildFHSEnv { });
169 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";
171 auto-patchelf-hook = callPackage ./auto-patchelf-hook { };
173 srcOnly = callPackage ../build-support/src-only/tests.nix { };
175 systemd = callPackage ./systemd { };
177 replaceVars = recurseIntoAttrs (callPackage ./replace-vars { });
179 substitute = recurseIntoAttrs (callPackage ./substitute { });
181 build-environment-info = callPackage ./build-environment-info { };