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

SETUP copy fails if only test or benchmark #6750

Closed
angerman opened this issue May 3, 2020 · 2 comments · Fixed by #9926
Closed

SETUP copy fails if only test or benchmark #6750

angerman opened this issue May 3, 2020 · 2 comments · Fixed by #9926

Comments

@angerman
Copy link
Collaborator

angerman commented May 3, 2020

As we can see in

checkHasLibsOrExes =
unless (hasLibs pkg_descr || hasForeignLibs pkg_descr || hasExes pkg_descr) $
die' verbosity "No executables and no library found. Nothing to do."

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?

@zhenyavinogradov
Copy link

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

MatthewCroughan added a commit to ArdanaLabs/dUSD that referenced this issue May 31, 2022
Since we are making the Haskell code just to test a Purescript project,
we have ended up with no library or executable in the cabal file, which
means we have to specify a null one.

haskell/cabal#6750
MatthewCroughan added a commit to ArdanaLabs/dUSD that referenced this issue May 31, 2022
Since we are making the Haskell code just to test a Purescript project,
we have ended up with no library or executable in the cabal file, which
means we have to specify a null one.

haskell/cabal#6750
@TeofilC
Copy link
Collaborator

TeofilC commented Apr 23, 2024

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 added a commit that referenced this issue Apr 24, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
TeofilC added a commit that referenced this issue Apr 24, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
TeofilC added a commit that referenced this issue Apr 24, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
TeofilC added a commit that referenced this issue Apr 29, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
TeofilC added a commit that referenced this issue Apr 29, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
TeofilC added a commit that referenced this issue Apr 30, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
Mikolaj pushed a commit that referenced this issue May 3, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
Mikolaj pushed a commit that referenced this issue May 6, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750
@mergify mergify bot closed this as completed in #9926 May 6, 2024
sheaf pushed a commit to mpickering/cabal that referenced this issue May 7, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves haskell#6750
mergify bot pushed a commit that referenced this issue Jun 6, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750

(cherry picked from commit 312a412)

# Conflicts:
#	Cabal/src/Distribution/Simple/Install.hs
ulysses4ever pushed a commit that referenced this issue Jun 7, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750

(cherry picked from commit 312a412)

# Conflicts:
#	Cabal/src/Distribution/Simple/Install.hs
ulysses4ever pushed a commit that referenced this issue Jun 7, 2024
This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750

(cherry picked from commit 312a412)

# Conflicts:
#	Cabal/src/Distribution/Simple/Install.hs
mergify bot added a commit that referenced this issue Jun 7, 2024
…10076)

* Downgrade NoLibraryFound from an error to a warning

This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves #6750

(cherry picked from commit 312a412)

# Conflicts:
#	Cabal/src/Distribution/Simple/Install.hs

* fixup! fix conflicts

---------

Co-authored-by: Teo Camarasu <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants