Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions lib/tests/release.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{ pkgs ? import ((import ../.).cleanSource ../..) {} }:

pkgs.stdenv.mkDerivation {
name = "nixpkgs-lib-tests";
buildInputs = [ pkgs.nix ];
pkgs.runCommandNoCC "nixpkgs-lib-tests" {
buildInputs = [ pkgs.nix (import ./check-eval.nix) ];
NIX_PATH="nixpkgs=${pkgs.path}";

buildCommand = ''
} ''
datadir="${pkgs.nix}/share"
export TEST_ROOT=$(pwd)/test-tmp
export NIX_BUILD_HOOK=
Expand All @@ -22,10 +20,5 @@ pkgs.stdenv.mkDerivation {
cd ${pkgs.path}/lib/tests
bash ./modules.sh

[[ "$(nix-instantiate --eval --strict misc.nix)" == "[ ]" ]]

[[ "$(nix-instantiate --eval --strict systems.nix)" == "[ ]" ]]

touch $out
'';
}
''
17 changes: 2 additions & 15 deletions pkgs/top-level/make-tarball.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, officialRelease
, pkgs ? import nixpkgs.outPath {}
, nix ? pkgs.nix
, lib-tests ? import ../../lib/tests/release.nix { inherit pkgs; }
}:

with pkgs;
Expand All @@ -18,7 +19,7 @@ releaseTools.sourceTarball rec {
version = pkgs.lib.fileContents ../../.version;
versionSuffix = "pre${toString nixpkgs.revCount}.${nixpkgs.shortRev}";

buildInputs = [ nix.out jq ];
buildInputs = [ nix.out jq lib-tests ];

configurePhase = ''
eval "$preConfigure"
Expand Down Expand Up @@ -60,20 +61,6 @@ releaseTools.sourceTarball rec {
exit 1
fi

# Run the regression tests in `lib'.
if
# `set -e` doesn't work inside here, so need to && instead :(
res="$(nix-instantiate --eval --strict lib/tests/misc.nix --show-trace)" \
&& [[ "$res" == "[ ]" ]] \
&& res="$(nix-instantiate --eval --strict lib/tests/systems.nix --show-trace)" \
&& [[ "$res" == "[ ]" ]]
then
true
else
echo "regression tests for lib failed, got: $res"
exit 1
fi

# Check that all-packages.nix evaluates on a number of platforms without any warnings.
for platform in i686-linux x86_64-linux x86_64-darwin; do
header "checking Nixpkgs on $platform"
Expand Down