1 import Test
.Cabal
.Prelude
3 -- The local package, pkg-1.0, depends on build-tool-pkg-1 as a library and
4 -- build-tool-pkg-2 as a build-tool. This test checks that cabal uses the
5 -- correct version of build-tool-pkg for each purpose. pkg imports a version
6 -- number from the build-tool-pkg library and uses the build-tool-pkg executable
7 -- as a preprocessor to insert the executable's version number into the source
8 -- code. Then the pkg executable prints out both versions.
10 -- Issue #5409 caused v2-build to use the same instance of build-tool-pkg for
11 -- the build-depends and build-tool-depends dependencies, even though it
12 -- violated the version constraints.
13 main
= withShorterPathForNewBuildStore
$ \storeDir
->
15 skipUnless
"not v2-build compatible boot Cabal" =<< hasNewBuildCompatBootCabal
17 r1
<- recordMode DoNotRecord
$
18 cabalG
' ["--store-dir=" ++ storeDir
] "v2-build" ["pkg:my-exe"]
21 [ "In order, the following will be built:"
22 , " - build-tool-pkg-1 (lib) (requires build)"
23 , " - build-tool-pkg-2 (lib) (requires build)"
24 , " - build-tool-pkg-2 (exe:build-tool-exe) (requires build)"
25 , " - pkg-1.0 (exe:my-exe) (first run)"
28 assertOutputContains msg r1
30 r2
<- runPlanExe
' "pkg" "my-exe" []
32 "build-tool library version: 1, build-tool exe version: 2" r2