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

Add runhaskell Setup.hs command corresponding to cabal check? #10825

Open
mpilgrem opened this issue Mar 8, 2025 · 2 comments
Open

Add runhaskell Setup.hs command corresponding to cabal check? #10825

mpilgrem opened this issue Mar 8, 2025 · 2 comments

Comments

@mpilgrem
Copy link
Collaborator

mpilgrem commented Mar 8, 2025

Describe the feature request
Is there any appetite within the Cabal project to add a runhaskell Setup.hs command that corresponds to cabal check?

It seems to me that a runhaskell Setup.hs check could go hand-in-hand with the existing runhaskell Setup.hs sdist.

Additional context
EDIT: I've since realised that what Stack does (the text below) is not a good motivation for the above. However, perhaps it has merit on its own terms, so I have not closed the issue.

The motivation is that Stack makes use of module Distribution.PackageDescription.Check. However, because there is no runhaskell Setup.hs command that corresponds to cabal check, Stack uses the version of the Cabal package that Stack is built against - which could be older than the version of the Cabal package that a Stack user is building with.~

(I appreciate that Stack could build another small executable to make use of the 'checking' functionality provided by Cabal (the library), but it would be nice if the Setup executable had 'checking' within its scope.)

@ffaf1
Copy link
Collaborator

ffaf1 commented Mar 8, 2025

Stack uses the version of the Cabal package that Stack is built against - which could be older than the version of the Cabal package that a Stack user is building with.

Sorry I am lost on this one. stack is build against a specific version of Cabal, that maskes sense and I understand. What does “than the version of the Cabal package that a Stack user is building with” refer to?

@mpilgrem
Copy link
Collaborator Author

mpilgrem commented Mar 8, 2025

@ffaf1, Stack follows the original Cabal specification and accesses the Cabal 'simple' build infrastructure through an executable compiled from a package's Setup.hs. That 'Setup' executable is often built against a different version of Cabal than Stack itself is built against - normally, by default, the Cabal boot package for the version of GHC that the Stack user has specified.

EDIT1: To make that concrete, Stack 3.1.1 is built against Cabal-3.10.3.0. However, if a Stack user has specified GHC 8.4.1, which shipped with Cabal-2.2.0.0, Stack will be building (by default) with that version of Cabal (the library). None of that is problematic. However, if a user of Stack specifies GHC 9.10.1, Stack will be building with Cabal-3.12.0.0 but 'checking' using Cabal-3.10.3.0.

EDIT2: I've realised that what Stack does is not a good motivation and edited my initial post accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants