cabal icon indicating copy to clipboard operation
cabal copied to clipboard

SETUP copy fails if only test or benchmark

Open angerman opened this issue 4 years ago • 2 comments

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?

angerman avatar May 03 '20 05:05 angerman

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

zhenyavinogradov avatar May 04 '20 04:05 zhenyavinogradov

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.

TeofilC avatar Apr 23 '24 12:04 TeofilC