Skip to content

Commit

Permalink
haskellPackages.mkDerivation: optionally support testTargets
Browse files Browse the repository at this point in the history
This implements support for the testTargets argument introduced in
#306283 for 24.11.
If testTargets is given, it is mapped to testTarget without a warning.
This makes sure that expressions for unstable/25.05 will also work with
24.11 (as seen by the backported configuration changes from #306283
which now work on 24.11 without causing any rebuilds).
  • Loading branch information
sternenseemann committed Feb 14, 2025
1 parent 7f7c535 commit 4eea18b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ self: super: {
# Too strict bounds on doctest which isn't used, but is part of the configuration
jailbreak = true;
# vector-doctest seems to be broken when executed via ./Setup test
testTarget = lib.concatStringsSep " " [
testTargets = [
"vector-tests-O0"
"vector-tests-O2"
];
Expand Down Expand Up @@ -849,7 +849,7 @@ self: super: {
CHXHtml = dontDistribute super.CHXHtml;

# https://github.com/NixOS/nixpkgs/issues/6350
paypal-adaptive-hoops = overrideCabal (drv: { testTarget = "local"; }) super.paypal-adaptive-hoops;
paypal-adaptive-hoops = overrideCabal (drv: { testTargets = [ "local" ]; }) super.paypal-adaptive-hoops;

# Avoid "QuickCheck >=2.3 && <2.10" dependency we cannot fulfill in lts-11.x.
test-framework = dontCheck super.test-framework;
Expand Down Expand Up @@ -2629,7 +2629,7 @@ self: super: {
rm Setup.hs
'';
# doctest suite uses doctest-parallel which still doesn't work in nixpkgs
testTarget = "tests";
testTargets = [ "tests" ];
}) super.conduit-aeson;

# Upper bounds are too strict:
Expand All @@ -2638,7 +2638,7 @@ self: super: {

# Disabling doctests.
regex-tdfa = overrideCabal {
testTarget = "regex-tdfa-unittest";
testTargets = [ "regex-tdfa-unittest" ];
} super.regex-tdfa;

# Missing test files https://github.com/kephas/xdg-basedir-compliant/issues/1
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/haskell-modules/configuration-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ self: super: builtins.intersectAttrs super {
chmod +x "$out/bin/haskell-language-server"
'';
testToolDepends = [ self.cabal-install pkgs.git ];
testTarget = "func-test"; # wrapper test accesses internet
testTargets = [ "func-test" ]; # wrapper test accesses internet
preCheck = ''
export PATH=$PATH:$PWD/dist/build/haskell-language-server:$PWD/dist/build/haskell-language-server-wrapper
export HOME=$TMPDIR
Expand Down Expand Up @@ -379,7 +379,7 @@ self: super: builtins.intersectAttrs super {
digitalocean-kzs = dontCheck super.digitalocean-kzs; # https://github.com/KazumaSATO/digitalocean-kzs/issues/1
github-types = dontCheck super.github-types; # http://hydra.cryp.to/build/1114046/nixlog/1/raw
hadoop-rpc = dontCheck super.hadoop-rpc; # http://hydra.cryp.to/build/527461/nixlog/2/raw
hjsonschema = overrideCabal (drv: { testTarget = "local"; }) super.hjsonschema;
hjsonschema = overrideCabal (drv: { testTargets = [ "local" ]; }) super.hjsonschema;
marmalade-upload = dontCheck super.marmalade-upload; # http://hydra.cryp.to/build/501904/nixlog/1/raw
mongoDB = dontCheck super.mongoDB;
network-transport-tcp = dontCheck super.network-transport-tcp;
Expand Down Expand Up @@ -741,7 +741,7 @@ self: super: builtins.intersectAttrs super {

# Not running the "example" test because it requires a binary from lsps test
# suite which is not part of the output of lsp.
lsp-test = overrideCabal (old: { testTarget = "tests func-test"; }) super.lsp-test;
lsp-test = overrideCabal (old: { testTargets = [ "tests" "func-test" ]; }) super.lsp-test;

# the test suite attempts to run the binaries built in this package
# through $PATH but they aren't in $PATH
Expand Down Expand Up @@ -1301,7 +1301,7 @@ self: super: builtins.intersectAttrs super {
"-p" "!/oeis/"
];
# disco-examples needs network access
testTarget = "disco-tests";
testTargets = [ "disco-tests" ];
}) super.disco;

# Apply a patch which hardcodes the store path of graphviz instead of using
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ in
, pkg-configDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [], benchmarkPkgconfigDepends ? []
, testDepends ? [], testHaskellDepends ? [], testSystemDepends ? [], testFrameworkDepends ? []
, benchmarkDepends ? [], benchmarkHaskellDepends ? [], benchmarkSystemDepends ? [], benchmarkFrameworkDepends ? []
, testTarget ? "", testFlags ? []
, # testTarget is deprecated starting with 25.05. Use testTargets instead.
testTarget ? lib.concatStringsSep " " testTargets
, testTargets ? [], testFlags ? []
, broken ? false
, preCompileBuildDriver ? null, postCompileBuildDriver ? null
, preUnpack ? null, postUnpack ? null
Expand Down

0 comments on commit 4eea18b

Please sign in to comment.