cabal
cabal copied to clipboard
SETUP copy fails if only test or benchmark
As we can see in
https://github.com/haskell/cabal/blob/7fec503aa7b27d1aa57e8c30a38c78cd03d1d6ea/Cabal/Distribution/Simple/Install.hs#L88-L90
If a package has only a test-suite or a benchmark, we'll end up with
Setup: No executables and no library found. Nothing to do.
for the copy action, despite there being artefacts to be copied.
This came up in input-output-hk/haskell.nix#362 and input-output-hk/haskell.nix#556.
Now I'm wondering if hasExes
should yield True
for benchmarks and test (they are after all exes as well, or if we should just include those two in the above check as well?
It looks like a deliberate design of SETUP copy
and SETUP install
to copy only the library and executables and not tests and benchmarks. These commands are used for installing the artefacts into your local system, and tests are not something you want to install
Would it be possible to make Cabal exit successfully in this case? I don't really see why this should lead to an error.
I would be happy to write a patch.