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 != "gcc49Stdenv"))
52 (filterAttrs (n: _: n != "gccMultiStdenv"))
53 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
54 # fails with things like
55 # ld: warning: ld: warning: object file (trunctfsf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
56 # ld: warning: ld: warning: could not create compact unwind for ___fixunstfdi: register 20 saved somewhere other than in frame
57 (filterAttrs (n: _: n != "gcc11Stdenv"))
64 inherit (lib) filterAttrs;
65 sets = lib.pipe llvmTests ([
66 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.clang.stdenv.cc))
67 (filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.libcxx.stdenv.cc))
70 # fix in https://github.com/NixOS/nixpkgs/pull/216273
71 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
72 (filterAttrs (n: _: n != "llvmPackages_9"))
81 llvmTests = recurseIntoAttrs llvmTests;
85 devShellTools = callPackage ../build-support/dev-shell-tools/tests { };
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 { };
117 fetchPypiLegacy = callPackages ../build-support/fetchpypilegacy/tests.nix { };
119 install-shell-files = callPackage ./install-shell-files {};
121 checkpointBuildTools = callPackage ./checkpointBuild {};
123 kernel-config = callPackage ./kernel.nix {};
125 ld-library-path = callPackage ./ld-library-path {};
127 macOSSierraShared = callPackage ./macos-sierra-shared {};
129 cross = callPackage ./cross {} // { __attrsFailEvaluation = true; };
131 php = recurseIntoAttrs (callPackages ./php {});
133 pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }) // { __recurseIntoDerivationForReleaseJobs = true; };
135 buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
136 importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
138 vim = callPackage ./vim {};
140 nixos-functions = callPackage ./nixos-functions {};
142 overriding = callPackage ./overriding.nix { };
144 texlive = callPackage ./texlive {};
146 cuda = callPackage ./cuda { };
148 trivial-builders = callPackage ../build-support/trivial-builders/test/default.nix {};
150 writers = callPackage ../build-support/writers/test.nix {};
152 testers = callPackage ../build-support/testers/test/default.nix {};
154 dhall = callPackage ./dhall { };
156 cue-validation = callPackage ./cue {};
158 coq = callPackage ./coq {};
160 dotnet = recurseIntoAttrs (callPackages ./dotnet { });
162 makeHardcodeGsettingsPatch = callPackage ./make-hardcode-gsettings-patch { };
164 makeWrapper = callPackage ./make-wrapper { };
165 makeBinaryWrapper = callPackage ./make-binary-wrapper {
166 makeBinaryWrapper = pkgs.makeBinaryWrapper.override {
167 # Enable sanitizers in the tests only, to avoid the performance cost in regular usage.
168 # The sanitizers cause errors on aarch64-darwin, see https://github.com/NixOS/nixpkgs/pull/150079#issuecomment-994132734
169 sanitizers = pkgs.lib.optionals (! (pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64))
170 [ "undefined" "address" ];
174 pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; });
176 buildFHSEnv = recurseIntoAttrs (callPackages ./buildFHSEnv { });
178 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";
180 auto-patchelf-hook = callPackage ./auto-patchelf-hook { };
182 systemd = callPackage ./systemd { };
184 substitute = recurseIntoAttrs (callPackage ./substitute { });