tests: eval and build more tests (#405702)
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "basic-dynamic";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock.lockFileContents = builtins.readFile ./Cargo.lock;
|
||||
cargoLock.lockFileContents = builtins.readFile ./package/Cargo.lock;
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "basic-sparse";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./.cargo/config.toml
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
extraRegistries = {
|
||||
"sparse+https://index.crates.io/" = "https://static.crates.io/crates";
|
||||
};
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "basic";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
};
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "git-dependency-branch";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
outputHashes = {
|
||||
"rand-0.8.4" = "1ilk9wvfw3mdm57g199ys8f5nrgdrh0n3a4c8b7nz6lgnqvfrv6z";
|
||||
};
|
||||
|
||||
@@ -3,23 +3,13 @@
|
||||
pkg-config,
|
||||
openssl,
|
||||
zlib,
|
||||
lib,
|
||||
}:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "git-dependency-rev-non-workspace-nested-crate";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
@@ -31,7 +21,7 @@ rustPlatform.buildRustPackage {
|
||||
];
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
outputHashes = {
|
||||
"cargo-test-macro-0.1.0" = "1yy1y1d523xdzwg1gc77pigbcwsbawmy4b7vw8v21m7q957sk0c4";
|
||||
};
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "git-dependency-rev";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
outputHashes = {
|
||||
"rand-0.8.3" = "0l3p174bpwia61vcvxz5mw65a13ri3wy94z04xrnyy5lzciykz4f";
|
||||
};
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "git-dependency-tag";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
outputHashes = {
|
||||
"rand-0.8.3" = "0l3p174bpwia61vcvxz5mw65a13ri3wy94z04xrnyy5lzciykz4f";
|
||||
};
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "git-dependency";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
outputHashes = {
|
||||
"rand-0.8.3" = "0ya2hia3cn31qa8894s3av2s8j5bjwb6yq92k0jsnlx7jid0jwqa";
|
||||
};
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
{ lib, rustPlatform }:
|
||||
let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
{ rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "v1";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ./.;
|
||||
fileset = fs.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = ./package;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
lockFile = ./package/Cargo.lock;
|
||||
};
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
@@ -456,7 +456,7 @@ recurseIntoAttrs {
|
||||
);
|
||||
};
|
||||
|
||||
data = {
|
||||
data = recurseIntoAttrs {
|
||||
json = expectDataEqual {
|
||||
file = writeJSON "data.json" { hello = "world"; };
|
||||
expected = ''
|
||||
|
||||
@@ -98,7 +98,10 @@ let
|
||||
++ lib.optional static "etc";
|
||||
setOutputFlags = false;
|
||||
separateDebugInfo =
|
||||
!stdenv.hostPlatform.isDarwin && !(stdenv.hostPlatform.useLLVM or false) && stdenv.cc.isGNU;
|
||||
!stdenv.hostPlatform.isDarwin
|
||||
&& !stdenv.hostPlatform.isAndroid
|
||||
&& !(stdenv.hostPlatform.useLLVM or false)
|
||||
&& stdenv.cc.isGNU;
|
||||
|
||||
nativeBuildInputs =
|
||||
lib.optional (!stdenv.hostPlatform.isWindows) makeBinaryWrapper
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.recurseIntoAttrs {
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/175196
|
||||
@@ -11,13 +15,14 @@ lib.recurseIntoAttrs {
|
||||
# Instead of `builtins.seq`, the list may be constructed based on actual package info.
|
||||
allowPkgsInPermittedInsecurePackages =
|
||||
let
|
||||
pkgs = import ../.. {
|
||||
pkgs' = import ../.. {
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
config = {
|
||||
permittedInsecurePackages = builtins.seq pkgs.glibc.version [ ];
|
||||
permittedInsecurePackages = builtins.seq pkgs'.glibc.version [ ];
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
pkgs.hello;
|
||||
pkgs'.hello;
|
||||
|
||||
}
|
||||
|
||||
@@ -71,30 +71,32 @@ let
|
||||
|
||||
mapMultiPlatformTest =
|
||||
crossSystemFun: test:
|
||||
lib.mapAttrs (
|
||||
name: system:
|
||||
test rec {
|
||||
crossPkgs = import pkgs.path {
|
||||
localSystem = { inherit (pkgs.stdenv.hostPlatform) config; };
|
||||
crossSystem = crossSystemFun system;
|
||||
};
|
||||
lib.dontRecurseIntoAttrs (
|
||||
lib.mapAttrs (
|
||||
name: system:
|
||||
lib.recurseIntoAttrs (test rec {
|
||||
crossPkgs = import pkgs.path {
|
||||
localSystem = { inherit (pkgs.stdenv.hostPlatform) config; };
|
||||
crossSystem = crossSystemFun system;
|
||||
};
|
||||
|
||||
emulator = crossPkgs.stdenv.hostPlatform.emulator pkgs;
|
||||
emulator = crossPkgs.stdenv.hostPlatform.emulator pkgs;
|
||||
|
||||
# Apply some transformation on windows to get dlls in the right
|
||||
# place. Unfortunately mingw doesn’t seem to be able to do linking
|
||||
# properly.
|
||||
platformFun =
|
||||
pkg:
|
||||
if crossPkgs.stdenv.hostPlatform.isWindows then
|
||||
pkgs.buildEnv {
|
||||
name = "${pkg.name}-winlinks";
|
||||
paths = [ pkg ] ++ pkg.buildInputs;
|
||||
}
|
||||
else
|
||||
pkg;
|
||||
}
|
||||
) testedSystems;
|
||||
# Apply some transformation on windows to get dlls in the right
|
||||
# place. Unfortunately mingw doesn’t seem to be able to do linking
|
||||
# properly.
|
||||
platformFun =
|
||||
pkg:
|
||||
if crossPkgs.stdenv.hostPlatform.isWindows then
|
||||
pkgs.buildEnv {
|
||||
name = "${pkg.name}-winlinks";
|
||||
paths = [ pkg ] ++ pkg.buildInputs;
|
||||
}
|
||||
else
|
||||
pkg;
|
||||
})
|
||||
) testedSystems
|
||||
);
|
||||
|
||||
tests = {
|
||||
|
||||
@@ -214,8 +216,12 @@ let
|
||||
|
||||
in
|
||||
{
|
||||
gcc = (lib.mapAttrs (_: mapMultiPlatformTest (system: system // { useLLVM = false; })) tests);
|
||||
llvm = (lib.mapAttrs (_: mapMultiPlatformTest (system: system // { useLLVM = true; })) tests);
|
||||
gcc = lib.recurseIntoAttrs (
|
||||
lib.mapAttrs (_: mapMultiPlatformTest (system: system // { useLLVM = false; })) tests
|
||||
);
|
||||
llvm = lib.recurseIntoAttrs (
|
||||
lib.mapAttrs (_: mapMultiPlatformTest (system: system // { useLLVM = true; })) tests
|
||||
);
|
||||
|
||||
inherit mbuffer sanity;
|
||||
}
|
||||
|
||||
@@ -87,13 +87,13 @@ with pkgs;
|
||||
};
|
||||
|
||||
llvmTests = recurseIntoAttrs llvmTests;
|
||||
inherit gccTests;
|
||||
gccTests = recurseIntoAttrs gccTests;
|
||||
};
|
||||
|
||||
devShellTools = callPackage ../build-support/dev-shell-tools/tests { };
|
||||
|
||||
stdenv-inputs = callPackage ./stdenv-inputs { };
|
||||
stdenv = callPackage ./stdenv { };
|
||||
stdenv = recurseIntoAttrs (callPackage ./stdenv { });
|
||||
|
||||
hardeningFlags = recurseIntoAttrs (callPackage ./cc-wrapper/hardening.nix { });
|
||||
hardeningFlags-gcc = recurseIntoAttrs (
|
||||
@@ -113,24 +113,28 @@ with pkgs;
|
||||
|
||||
haskell = callPackage ./haskell { };
|
||||
|
||||
hooks = callPackage ./hooks { };
|
||||
hooks = recurseIntoAttrs (callPackage ./hooks { });
|
||||
|
||||
cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
|
||||
cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
|
||||
|
||||
compress-drv = callPackage ../build-support/compress-drv/test.nix { };
|
||||
|
||||
fetchurl = callPackages ../build-support/fetchurl/tests.nix { };
|
||||
fetchtorrent = callPackages ../build-support/fetchtorrent/tests.nix { };
|
||||
fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { };
|
||||
fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; };
|
||||
fetchDebianPatch = callPackages ../build-support/fetchdebianpatch/tests.nix { };
|
||||
fetchzip = callPackages ../build-support/fetchzip/tests.nix { };
|
||||
fetchgit = callPackages ../build-support/fetchgit/tests.nix { };
|
||||
fetchFirefoxAddon = callPackages ../build-support/fetchfirefoxaddon/tests.nix { };
|
||||
fetchPypiLegacy = callPackages ../build-support/fetchpypilegacy/tests.nix { };
|
||||
fetchurl = recurseIntoAttrs (callPackages ../build-support/fetchurl/tests.nix { });
|
||||
fetchtorrent = recurseIntoAttrs (callPackages ../build-support/fetchtorrent/tests.nix { });
|
||||
fetchpatch = recurseIntoAttrs (callPackages ../build-support/fetchpatch/tests.nix { });
|
||||
fetchpatch2 = recurseIntoAttrs (
|
||||
callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; }
|
||||
);
|
||||
fetchDebianPatch = recurseIntoAttrs (callPackages ../build-support/fetchdebianpatch/tests.nix { });
|
||||
fetchzip = recurseIntoAttrs (callPackages ../build-support/fetchzip/tests.nix { });
|
||||
fetchgit = recurseIntoAttrs (callPackages ../build-support/fetchgit/tests.nix { });
|
||||
fetchFirefoxAddon = recurseIntoAttrs (
|
||||
callPackages ../build-support/fetchfirefoxaddon/tests.nix { }
|
||||
);
|
||||
fetchPypiLegacy = recurseIntoAttrs (callPackages ../build-support/fetchpypilegacy/tests.nix { });
|
||||
|
||||
install-shell-files = callPackage ./install-shell-files { };
|
||||
install-shell-files = recurseIntoAttrs (callPackage ./install-shell-files { });
|
||||
|
||||
checkpointBuildTools = callPackage ./checkpointBuild { };
|
||||
|
||||
@@ -138,9 +142,7 @@ with pkgs;
|
||||
|
||||
ld-library-path = callPackage ./ld-library-path { };
|
||||
|
||||
cross = callPackage ./cross { } // {
|
||||
__attrsFailEvaluation = true;
|
||||
};
|
||||
cross = recurseIntoAttrs (callPackage ./cross { });
|
||||
|
||||
php = recurseIntoAttrs (callPackages ./php { });
|
||||
|
||||
@@ -148,18 +150,18 @@ with pkgs;
|
||||
__recurseIntoDerivationForReleaseJobs = true;
|
||||
};
|
||||
|
||||
buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
|
||||
importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
|
||||
buildRustCrate = recurseIntoAttrs (callPackage ../build-support/rust/build-rust-crate/test { });
|
||||
importCargoLock = recurseIntoAttrs (callPackage ../build-support/rust/test/import-cargo-lock { });
|
||||
|
||||
vim = callPackage ./vim { };
|
||||
|
||||
nixos-functions = callPackage ./nixos-functions { };
|
||||
|
||||
nixosOptionsDoc = callPackage ../../nixos/lib/make-options-doc/tests.nix { };
|
||||
nixosOptionsDoc = recurseIntoAttrs (callPackage ../../nixos/lib/make-options-doc/tests.nix { });
|
||||
|
||||
overriding = callPackage ./overriding.nix { };
|
||||
|
||||
texlive = callPackage ./texlive { };
|
||||
texlive = recurseIntoAttrs (callPackage ./texlive { });
|
||||
|
||||
cuda = callPackage ./cuda { };
|
||||
|
||||
@@ -177,7 +179,7 @@ with pkgs;
|
||||
|
||||
dotnet = recurseIntoAttrs (callPackages ./dotnet { });
|
||||
|
||||
makeHardcodeGsettingsPatch = callPackage ./make-hardcode-gsettings-patch { };
|
||||
makeHardcodeGsettingsPatch = recurseIntoAttrs (callPackage ./make-hardcode-gsettings-patch { });
|
||||
|
||||
makeWrapper = callPackage ./make-wrapper { };
|
||||
makeBinaryWrapper = callPackage ./make-binary-wrapper {
|
||||
|
||||
@@ -220,9 +220,6 @@ let
|
||||
in
|
||||
|
||||
{
|
||||
# Disable on Darwin due to assumptions with __bootPackages
|
||||
__attrsFailEvaluation = stdenv.hostPlatform.isDarwin;
|
||||
|
||||
# tests for hooks in `stdenv.defaultNativeBuildInputs`
|
||||
hooks = lib.recurseIntoAttrs (
|
||||
import ./hooks.nix {
|
||||
|
||||
Reference in New Issue
Block a user