Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backpack test #2266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions test/backpack/cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
allow-newer:
, unpacked-containers:*
, unpacked-unordered-containers:*

source-repository-package
type: git
location: https://github.com/ekmett/unpacked-containers
tag: 7dc56993a57511b58257b5d389473e638a7082d2
--sha256: 1vijp2hs9ynfm8k2yrv06ccpfi1n2s2b5bqvzrjdd3gqn4bi66q4
subdir:
unpacked-containers
unpacked-unordered-containers

62 changes: 62 additions & 0 deletions test/backpack/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{ stdenv
, lib
, fetchFromGitHub
, cabalProject'
, haskellLib
, recurseIntoAttrs
, compiler-nix-name
, evalPackages
, ...
}:


let
project = cabalProject' {
inherit compiler-nix-name evalPackages;
src = fetchFromGitHub {
owner = "ekmett";
repo = "unpacked-containers";
rev = "7dc56993a57511b58257b5d389473e638a7082d2";
hash = "sha256-BBsTF7H4jdZk/huvsoQWNkR3GTNgZy8mqs76pKG4Mu4=";
};
cabalProjectLocal = ''
allow-newer:
, unpacked-containers:*
, unpacked-unordered-containers:*
'';

};

packages = haskellLib.selectProjectPackages project.hsPkgs;
components = lib.concatMap haskellLib.getAllComponents (lib.attrValues packages);

in
recurseIntoAttrs {
ifdInputs = {
plan-nix = lib.addMetaAttrs
{
platforms = lib.platforms.all;
# Making this work for cross compilers will be difficult.
disabled = stdenv.buildPlatform != stdenv.hostPlatform;
}
project.plan-nix;
};

run = stdenv.mkDerivation {
name = "backpack-test";

buildCommand = ''
printf ${lib.concatStringsSep " " components}
touch $out
'';

meta = {
platforms = lib.platforms.all;
};

passthru = {
# Used for debugging with nix repl
inherit project packages;
};
};
}
1 change: 1 addition & 0 deletions test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ let

# All tests.
allTests = {
backpack = callTest ./backpack { };
cabal-simple = callTest ./cabal-simple { inherit util; };
cabal-simple-debug = callTest ./cabal-simple-debug { inherit util; };
cabal-simple-prof = callTest ./cabal-simple-prof { inherit util; };
Expand Down
Loading