2018-05-11 01:08:26 +00:00
|
|
|
{ pkgs, callPackage }:
|
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
{
|
2023-02-14 06:46:15 +00:00
|
|
|
cc-wrapper = with builtins; let
|
|
|
|
pkgNames = (attrNames pkgs);
|
|
|
|
llvmTests = let
|
|
|
|
pkgSets = lib.pipe pkgNames [
|
|
|
|
(filter (lib.hasPrefix "llvmPackages"))
|
2023-10-02 00:36:12 +00:00
|
|
|
(filter (n: n != "rocmPackages.llvm"))
|
2024-01-24 15:44:32 +00:00
|
|
|
# Are throw aliases.
|
2023-11-03 22:32:06 +00:00
|
|
|
(filter (n: n != "llvmPackages_rocm"))
|
2023-02-14 06:46:15 +00:00
|
|
|
(filter (n: n != "llvmPackages_latest"))
|
|
|
|
(filter (n: n != "llvmPackages_git"))
|
2024-01-24 15:44:32 +00:00
|
|
|
(filter (n: n != "llvmPackages_6"))
|
|
|
|
(filter (n: n != "llvmPackages_7"))
|
2023-02-14 06:46:15 +00:00
|
|
|
];
|
|
|
|
tests = lib.genAttrs pkgSets (name: recurseIntoAttrs {
|
|
|
|
clang = callPackage ./cc-wrapper { stdenv = pkgs.${name}.stdenv; };
|
|
|
|
libcxx = callPackage ./cc-wrapper { stdenv = pkgs.${name}.libcxxStdenv; };
|
|
|
|
});
|
|
|
|
in
|
2023-09-07 20:21:06 +00:00
|
|
|
tests;
|
2023-02-14 06:46:15 +00:00
|
|
|
gccTests = let
|
2023-09-07 17:30:03 +00:00
|
|
|
pkgSets = lib.pipe (attrNames pkgs) ([
|
2023-02-14 06:46:15 +00:00
|
|
|
(filter (lib.hasPrefix "gcc"))
|
|
|
|
(filter (lib.hasSuffix "Stdenv"))
|
|
|
|
(filter (n: n != "gccCrossLibcStdenv"))
|
2023-09-07 17:30:03 +00:00
|
|
|
] ++ lib.optionals (!(
|
|
|
|
(stdenv.buildPlatform.isLinux && stdenv.buildPlatform.isx86_64) &&
|
|
|
|
(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64)
|
|
|
|
)) [
|
|
|
|
(filter (n: !lib.hasSuffix "MultiStdenv" n))
|
|
|
|
]);
|
2023-02-14 06:46:15 +00:00
|
|
|
in lib.genAttrs pkgSets (name: callPackage ./cc-wrapper { stdenv = pkgs.${name}; });
|
|
|
|
in recurseIntoAttrs {
|
|
|
|
default = callPackage ./cc-wrapper { };
|
2023-09-07 20:21:06 +00:00
|
|
|
|
|
|
|
supported = stdenv.mkDerivation {
|
|
|
|
name = "cc-wrapper-supported";
|
|
|
|
builtGCC =
|
|
|
|
let
|
2023-11-15 18:47:14 +00:00
|
|
|
inherit (lib) filterAttrs;
|
|
|
|
sets = lib.pipe gccTests ([
|
|
|
|
(filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.stdenv.cc))
|
2023-09-07 20:21:06 +00:00
|
|
|
# Broken
|
2023-11-15 18:47:14 +00:00
|
|
|
(filterAttrs (n: _: n != "gcc49Stdenv"))
|
|
|
|
(filterAttrs (n: _: n != "gccMultiStdenv"))
|
2023-09-07 20:21:06 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
|
|
|
# fails with things like
|
|
|
|
# ld: warning: ld: warning: object file (trunctfsf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
|
|
|
|
# ld: warning: ld: warning: could not create compact unwind for ___fixunstfdi: register 20 saved somewhere other than in frame
|
2023-11-15 18:47:14 +00:00
|
|
|
(filterAttrs (n: _: n != "gcc11Stdenv"))
|
2023-09-07 20:21:06 +00:00
|
|
|
]);
|
|
|
|
in
|
2023-11-15 18:47:14 +00:00
|
|
|
toJSON sets;
|
2023-09-07 20:21:06 +00:00
|
|
|
|
|
|
|
builtLLVM =
|
|
|
|
let
|
2023-11-15 18:47:14 +00:00
|
|
|
inherit (lib) filterAttrs;
|
|
|
|
sets = lib.pipe llvmTests ([
|
|
|
|
(filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.clang.stdenv.cc))
|
|
|
|
(filterAttrs (_: v: lib.meta.availableOn stdenv.hostPlatform v.libcxx.stdenv.cc))
|
2023-09-07 20:21:06 +00:00
|
|
|
|
|
|
|
# libcxxStdenv broken
|
|
|
|
# fix in https://github.com/NixOS/nixpkgs/pull/216273
|
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
2023-11-15 18:47:14 +00:00
|
|
|
(filterAttrs (n: _: n != "llvmPackages_8"))
|
|
|
|
(filterAttrs (n: _: n != "llvmPackages_9"))
|
|
|
|
(filterAttrs (n: _: n != "llvmPackages_10"))
|
2023-09-07 20:21:06 +00:00
|
|
|
]);
|
|
|
|
in
|
2023-11-15 18:47:14 +00:00
|
|
|
toJSON sets;
|
2023-09-07 20:21:06 +00:00
|
|
|
buildCommand = ''
|
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
llvmTests = recurseIntoAttrs llvmTests;
|
|
|
|
inherit gccTests;
|
|
|
|
};
|
2023-02-14 06:46:15 +00:00
|
|
|
|
2018-05-11 01:08:26 +00:00
|
|
|
stdenv-inputs = callPackage ./stdenv-inputs { };
|
2022-12-07 03:55:45 +00:00
|
|
|
stdenv = callPackage ./stdenv { };
|
2018-05-11 01:08:26 +00:00
|
|
|
|
2023-02-12 21:53:08 +00:00
|
|
|
hardeningFlags = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {});
|
|
|
|
hardeningFlags-gcc = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
|
|
|
|
stdenv = gccStdenv;
|
|
|
|
});
|
|
|
|
hardeningFlags-clang = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix {
|
|
|
|
stdenv = llvmPackages.stdenv;
|
|
|
|
});
|
|
|
|
|
2022-05-29 08:23:16 +00:00
|
|
|
config = callPackage ./config.nix { };
|
|
|
|
|
2023-09-12 13:55:32 +00:00
|
|
|
top-level = callPackage ./top-level { };
|
|
|
|
|
2021-05-01 11:24:25 +00:00
|
|
|
haskell = callPackage ./haskell { };
|
shellFor: Refactor for consistency and cross
This makes it work like work-on-multi from Reflex Platform. In
particular, rather than making `.env` from `shellFor`, we make `.env`
the primitive, and `shellFor` works by combining together the arguments
of all the packages to `generic-builder` and taking the `.env` of the
resulting mashup-package.
There are 2 benefits of this:
1. The dependency logic is deduplicated. generic builder just concatted
lists, whereas all the envs until now would sieve apart haskell and
system build inputs. Now, they both decide haskell vs system the same
way: according to the argument list and without reflection.
Consistency is good, especially because it mean that if the build
works, the shell is more likely to work.
2. Cross is handled better. For native builds, because the
`ghcWithPackages` calls would shadow, we through both the regular
component (lib, exe, test, bench) haskell deps and Setup.hs haskell
deps in the same `ghcWithPackages` call. But for cross builds we use
`buildPackages.ghcWithPackages` to get the setup deps. This ensures
everything works correctly.
2019-12-23 20:33:18 +00:00
|
|
|
|
2022-12-09 06:45:38 +00:00
|
|
|
hooks = callPackage ./hooks { };
|
|
|
|
|
2018-05-11 01:08:26 +00:00
|
|
|
cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
|
|
|
|
cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
|
|
|
|
|
2022-06-30 17:49:54 +00:00
|
|
|
fetchurl = callPackages ../build-support/fetchurl/tests.nix { };
|
2023-10-27 22:25:35 +00:00
|
|
|
fetchtorrent = callPackages ../build-support/fetchtorrent/tests.nix { };
|
2021-12-20 12:12:30 +00:00
|
|
|
fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { };
|
2022-07-20 19:47:14 +00:00
|
|
|
fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; };
|
2023-08-30 07:50:44 +00:00
|
|
|
fetchDebianPatch = callPackages ../build-support/fetchdebianpatch/tests.nix { };
|
2022-05-17 18:49:33 +00:00
|
|
|
fetchzip = callPackages ../build-support/fetchzip/tests.nix { };
|
2021-12-20 12:12:30 +00:00
|
|
|
fetchgit = callPackages ../build-support/fetchgit/tests.nix { };
|
|
|
|
fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
|
|
|
|
|
2020-10-25 21:17:24 +00:00
|
|
|
install-shell-files = callPackage ./install-shell-files {};
|
|
|
|
|
2024-01-07 10:47:47 +00:00
|
|
|
checkpointBuildTools = callPackage ./checkpointBuild {};
|
2022-04-07 14:28:20 +00:00
|
|
|
|
2018-10-03 09:54:42 +00:00
|
|
|
kernel-config = callPackage ./kernel.nix {};
|
|
|
|
|
2018-08-01 09:58:07 +00:00
|
|
|
ld-library-path = callPackage ./ld-library-path {};
|
|
|
|
|
2018-05-11 01:08:26 +00:00
|
|
|
macOSSierraShared = callPackage ./macos-sierra-shared {};
|
2018-07-21 02:43:55 +00:00
|
|
|
|
2023-11-23 00:46:36 +00:00
|
|
|
cross = callPackage ./cross {} // { __attrsFailEvaluation = true; };
|
2018-09-16 17:53:45 +00:00
|
|
|
|
2021-11-03 23:20:56 +00:00
|
|
|
php = recurseIntoAttrs (callPackages ./php {});
|
|
|
|
|
2023-11-23 00:46:36 +00:00
|
|
|
pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }) // { __recurseIntoDerivationForReleaseJobs = true; };
|
2022-04-23 21:37:49 +00:00
|
|
|
|
2020-11-29 16:23:00 +00:00
|
|
|
buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
|
2021-05-08 09:33:29 +00:00
|
|
|
importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
|
2020-10-17 07:43:33 +00:00
|
|
|
|
2021-04-21 10:55:05 +00:00
|
|
|
vim = callPackage ./vim {};
|
|
|
|
|
2018-10-02 19:49:54 +00:00
|
|
|
nixos-functions = callPackage ./nixos-functions {};
|
|
|
|
|
2023-01-20 16:57:13 +00:00
|
|
|
overriding = callPackage ./overriding.nix { };
|
|
|
|
|
2020-04-10 23:47:44 +00:00
|
|
|
texlive = callPackage ./texlive {};
|
|
|
|
|
2021-03-09 18:04:03 +00:00
|
|
|
cuda = callPackage ./cuda { };
|
|
|
|
|
2023-07-26 11:51:47 +00:00
|
|
|
trivial-builders = callPackage ../build-support/trivial-builders/test/default.nix {};
|
2021-05-14 15:27:25 +00:00
|
|
|
|
2018-11-27 02:58:17 +00:00
|
|
|
writers = callPackage ../build-support/writers/test.nix {};
|
2021-10-25 05:53:15 +00:00
|
|
|
|
2022-05-09 12:18:40 +00:00
|
|
|
testers = callPackage ../build-support/testers/test/default.nix {};
|
|
|
|
|
2021-10-25 05:53:15 +00:00
|
|
|
dhall = callPackage ./dhall { };
|
2021-06-22 21:05:38 +00:00
|
|
|
|
2022-12-08 21:19:23 +00:00
|
|
|
cue-validation = callPackage ./cue {};
|
|
|
|
|
2022-08-29 05:46:20 +00:00
|
|
|
coq = callPackage ./coq {};
|
|
|
|
|
2023-05-26 10:40:36 +00:00
|
|
|
dotnet = recurseIntoAttrs (callPackages ./dotnet { });
|
|
|
|
|
2022-12-15 20:05:02 +00:00
|
|
|
makeHardcodeGsettingsPatch = callPackage ./make-hardcode-gsettings-patch { };
|
|
|
|
|
2022-05-10 13:51:43 +00:00
|
|
|
makeWrapper = callPackage ./make-wrapper { };
|
|
|
|
makeBinaryWrapper = callPackage ./make-binary-wrapper {
|
|
|
|
makeBinaryWrapper = pkgs.makeBinaryWrapper.override {
|
2022-05-12 13:23:38 +00:00
|
|
|
# Enable sanitizers in the tests only, to avoid the performance cost in regular usage.
|
|
|
|
# The sanitizers cause errors on aarch64-darwin, see https://github.com/NixOS/nixpkgs/pull/150079#issuecomment-994132734
|
2022-05-10 13:51:43 +00:00
|
|
|
sanitizers = pkgs.lib.optionals (! (pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64))
|
|
|
|
[ "undefined" "address" ];
|
|
|
|
};
|
|
|
|
};
|
2022-03-28 06:51:25 +00:00
|
|
|
|
|
|
|
pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; });
|
2023-08-23 02:22:41 +00:00
|
|
|
|
|
|
|
nixpkgs-check-by-name = callPackage ./nixpkgs-check-by-name { };
|
2023-12-20 17:08:22 +00:00
|
|
|
|
|
|
|
auto-patchelf-hook = callPackage ./auto-patchelf-hook { };
|
2018-05-11 01:08:26 +00:00
|
|
|
}
|