-
Notifications
You must be signed in to change notification settings - Fork 696
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
Task: make cabal-testsuite
use non-bleeding lib:Cabal for its Setup.hs
#5916
Comments
@hvr i.e. you suggest that |
@phadej something like that yeah, could even be just via See also cabal/cabal-testsuite/Test/Cabal/Script.hs Lines 50 to 64 in 0c97920
IOW, the main challenge here is how to encode the ProgrammDB and the PackageDbStack in a portable format. Maybe we don't even need actual ProgrammDB/PackageDBStacks in the testsuite code and might get away with simpler data. |
|
Actually, I just remembered that the IMO easiest robust approach would in fact be to use |
@hvr yes, that's essentially what |
This needs more refinement and is a first draft trying to address haskell#5916
This needs more refinement and is a first draft trying to address haskell#5916
This needs more refinement and is a first draft trying to address haskell#5916
This needs more refinement and is a first draft trying to address haskell#5916
This might require more refinement in future and is a first iteration trying to address haskell#5916
This might require more refinement in future and is a first iteration trying to address haskell#5916
This might require more refinement in future and is a first iteration trying to address haskell#5916
A recurring problem everytime we have to bump the major version in cabal is
cabal-testsuite
's dependency on thelib:Cabal
version used for its setup script; in fact, the.cabal
file contains the note:The problem here is that in order to use a
lib:Cabal
we also need a correspondingcabal
executable that's capable of talking to such a bleedinglib:Cabal
-based Setup.hs, and in general, it's not guaranteed that e.g.cabal-install-2.0
is able to able to communicate with alib:Cabal-3.0
-basedSetup.hs
.Moreover, it's not possible to perfectly synchronise as cabal treats
setup
components as qualified goals and we can easily end up e.g. picking a subtly different instance of lib:Cabal than the one that the library component was linked against.The actual reason for requiring the
setup
component and the testsuite library/executable component is primarily so that library can read theLocalBuildInfo
in order to construct aScriptEnv
,cabal/cabal-testsuite/Test/Cabal/Script.hs
Lines 34 to 41 in 0c97920
and this is constructed via a LBI which was written out by the Setup.hs, at
cabal/cabal-testsuite/Test/Cabal/Monad.hs
Lines 243 to 245 in 0c97920
and
cabal/cabal-testsuite/main/cabal-tests.hs
Lines 113 to 116 in e8a8287
and in fact, this is also explained in the
Setup.hs
file:How to resolve the issue
However, if we avoid requiring binary format compatibility for the binary encoded LBI, and instead dump out the minimum needed information to construct the
ScriptEnv
structure we can avoid needing to synchronise theCabal
version of the setup component with the rest.The text was updated successfully, but these errors were encountered: