input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
555 stars 240 forks source link

Building derivations exit with non-zero exit code when cabal target only has test-suites #556

Closed felixmulder closed 2 years ago

felixmulder commented 4 years ago
Preprocessing test suite 'bankgiro-engine-systest' for bankgiro-engine-systest-0.0.1..
Building test suite 'bankgiro-engine-systest' for bankgiro-engine-systest-0.0.1..
[1 of 3] Compiling Systest.Bankgiro.NotifySpec
[2 of 3] Compiling Systest.Bankgiro.PersistenceSpec
[3 of 3] Compiling Main
Linking dist/build/bankgiro-engine-systest/bankgiro-engine-systest ...
installing
Setup: No executables and no library found. Nothing to do.

This comes when running build on a derivation defined as:

let
  haskellNix = import (
    builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/930ec0d277097c7cf2252fc41d9a5e0b9972f1c4.tar.gz
  ) {};
  nixpkgsSrc = haskellNix.sources.nixpkgs-1909;
  nixpkgsArgs = haskellNix.nixpkgsArgs;
  pkgs = import nixpkgsSrc nixpkgsArgs;
in

with pkgs.lib;
with pkgs.haskell-nix.haskellLib;

collectChecks (p:
  p.isLocal && (hasSuffix "systest" p.identifier.name)
) (import ./. {})
zhenyavinogradov commented 4 years ago

See https://github.com/input-output-hk/haskell.nix/issues/362

angerman commented 4 years ago

@felixmulder, @zhenyavinogradov, @purefn so this is actually a Cabal bug?

felixmulder commented 4 years ago

Interesting :) Thanks for following up @angerman, with haskell.nix we were actually able to put all tests back into projects next to the library code - so we were able to work around this :)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hamishmack commented 2 years ago

I think @zhenyavinogradov is right and this was a duplicate of #362. It was recently fixed by #1732.