@@ -57,8 +57,8 @@ Where are these environments specified:
57
57
2. The build-depends of `test-runtime-deps` executable in `cabal-testsuite.cabal`
58
58
These dependencies are injected in a special module (`Test.Cabal.ScriptEnv0`) which
59
59
then is consulted in `Test.Cabal.Monad` in order to pass the right environmnet.
60
- This is mechanism by which the `./Setup` tests have access to the in-tree `Cabal`
61
- and `Cabal-syntax` libraries.
60
+ This is the mechanism by which the `./Setup` tests have access to the in-tree
61
+ `Cabal`, `Cabal-syntax` and `Cabal-hooks ` libraries.
62
62
3. No specification, only the `GlobalPackageDb` is available (see
63
63
`testPackageDBStack`) unless the test itself augments the environment with
64
64
`withPackageDb`.
@@ -142,7 +142,8 @@ buildCabalLibsProject projString verb mbGhc dir = do
142
142
, " --project-file=" ++ dir </> " cabal.project-test"
143
143
, " build"
144
144
, " -w" , programPath ghc
145
- , " Cabal" , " Cabal-syntax" ] ) { progInvokeCwd = Just dir })
145
+ , " Cabal" , " Cabal-syntax" , " Cabal-hooks"
146
+ ] ) { progInvokeCwd = Just dir })
146
147
return final_package_db
147
148
148
149
@@ -157,15 +158,18 @@ buildCabalLibsSpecific ver verb mbGhc builddir_rel = do
157
158
csgot <- doesDirectoryExist (dir </> " Cabal-syntax-" ++ ver)
158
159
unless csgot $
159
160
runProgramInvocation verb ((programInvocation cabal [" get" , " Cabal-syntax-" ++ ver]) { progInvokeCwd = Just dir })
160
-
161
- buildCabalLibsProject (" packages: Cabal-" ++ ver ++ " Cabal-syntax-" ++ ver) verb mbGhc dir
161
+ let hooksVerFromVer _ = " 0.1"
162
+ hooksVer = hooksVerFromVer ver
163
+ chgot <- doesDirectoryExist (dir </> " Cabal-hooks-" ++ hooksVer)
164
+ unless chgot $
165
+ runProgramInvocation verb ((programInvocation cabal [" get" , " Cabal-hooks-" ++ hooksVer]) { progInvokeCwd = Just dir })
166
+ buildCabalLibsProject (" packages: Cabal-" ++ ver ++ " Cabal-syntax-" ++ ver ++ " Cabal-hooks-" ++ hooksVer) verb mbGhc dir
162
167
163
168
164
169
buildCabalLibsIntree :: String -> Verbosity -> Maybe FilePath -> FilePath -> IO FilePath
165
170
buildCabalLibsIntree root verb mbGhc builddir_rel = do
166
171
dir <- canonicalizePath (builddir_rel </> " intree" )
167
- buildCabalLibsProject (" packages: " ++ root </> " Cabal" ++ " " ++ root </> " Cabal-syntax" ) verb mbGhc dir
168
-
172
+ buildCabalLibsProject (" packages: " ++ root </> " Cabal" ++ " " ++ root </> " Cabal-syntax" ++ " " ++ root </> " Cabal-hooks" ) verb mbGhc dir
169
173
170
174
main :: IO ()
171
175
main = do
0 commit comments