Skip to content

Commit e666eaa

Browse files
committed
Update regression test for issue haskell#3436 after haskell#4909.
haskell#4909 changed the cabal-version of the package under test, so this commit adjusts the versions of the Cabal libraries in the test to be consistent with the cabal-version.
1 parent bf3414e commit e666eaa

File tree

12 files changed

+37
-30
lines changed

12 files changed

+37
-30
lines changed

cabal-testsuite/PackageTests/Regression/T3436/Cabal-99998/Cabal.cabal renamed to cabal-testsuite/PackageTests/Regression/T3436/Cabal-1.2/Cabal.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Cabal
2-
version: 99998
2+
version: 1.2
33
build-type: Simple
44
cabal-version: >= 1.2
55

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module CabalMessage where
2+
3+
message = "This is Cabal-1.2"

cabal-testsuite/PackageTests/Regression/T3436/Cabal-99999/Cabal.cabal renamed to cabal-testsuite/PackageTests/Regression/T3436/Cabal-2.0/Cabal.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Cabal
2-
version: 99999
2+
version: 2.0
33
build-type: Simple
44
cabal-version: >= 1.2
55

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module CabalMessage where
2+
3+
message = "This is Cabal-2.0"

cabal-testsuite/PackageTests/Regression/T3436/Cabal-99998/CabalMessage.hs

Lines changed: 0 additions & 3 deletions
This file was deleted.

cabal-testsuite/PackageTests/Regression/T3436/Cabal-99999/CabalMessage.hs

Lines changed: 0 additions & 3 deletions
This file was deleted.

cabal-testsuite/PackageTests/Regression/T3436/cabal.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Resolving dependencies...
33
Build profile: -w ghc-<GHCVER> -O1
44
In order, the following will be built:
5-
- Cabal-99999 (lib:Cabal) (first run)
5+
- Cabal-2.0 (lib:Cabal) (first run)
66
- custom-setup-1.0 (lib:custom-setup) (first run)
7-
Configuring Cabal-99999...
8-
Preprocessing library for Cabal-99999..
9-
Building library for Cabal-99999..
7+
Configuring Cabal-2.0...
8+
Preprocessing library for Cabal-2.0..
9+
Building library for Cabal-2.0..
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
packages: custom-setup Cabal-99999
1+
packages: custom-setup Cabal-2.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Test.Cabal.Prelude
22
main = cabalTest $ do
3-
-- NB: This test doesn't really test #3436, because Cabal-99998
3+
-- NB: This test doesn't really test #3436, because Cabal-1.2
44
-- isn't in the system database and thus we can't see if the
55
-- depsolver incorrectly chooses it. Worth fixing if we figure
66
-- out how to simulate the "global" database without root.
77
r <- fails $ cabal' "new-build" ["custom-setup"]
8-
assertOutputContains "This is Cabal-99999" r
8+
assertOutputContains "This is Cabal-2.0" r

cabal-testsuite/PackageTests/Regression/T3436/custom-setup/custom-setup.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ version: 1.0
44
build-type: Custom
55

66
custom-setup
7-
setup-depends: base, Cabal >= 99999
7+
setup-depends: base, Cabal >= 2.0
88

99
library

cabal-testsuite/PackageTests/Regression/T3436/sandbox.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Writing a default package environment file to <ROOT>/sandbox.dist/cabal.sandbox.
33
Creating a new sandbox at <ROOT>/sandbox.dist/sandbox
44
# cabal install
55
Resolving dependencies...
6-
Configuring Cabal-99998...
7-
Preprocessing library for Cabal-99998..
8-
Building library for Cabal-99998..
6+
Configuring Cabal-1.2...
7+
Preprocessing library for Cabal-1.2..
8+
Building library for Cabal-1.2..
99
Installing library in <PATH>
10-
Installed Cabal-99998
10+
Installed Cabal-1.2
1111
# cabal sandbox add-source
1212
# cabal install
1313
Resolving dependencies...
14-
Configuring Cabal-99999...
15-
Preprocessing library for Cabal-99999..
16-
Building library for Cabal-99999..
14+
Configuring Cabal-2.0...
15+
Preprocessing library for Cabal-2.0..
16+
Building library for Cabal-2.0..
1717
Installing library in <PATH>
18-
Installed Cabal-99999
18+
Installed Cabal-2.0
1919
Failed to install custom-setup-1.0
2020
cabal: Error: some packages failed to install:
2121
custom-setup-1.0-92JpsxIMpiQHysxYdDtEVq failed during the configure step. The exception was:
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
import Test.Cabal.Prelude
22

33
-- Regression test for issue #3436
4+
--
5+
-- #3436 occurred when a package with a custom setup specified a 'cabal-version'
6+
-- that was newer than the version of the installed Cabal library, even though
7+
-- the solver didn't choose the installed Cabal for the package's setup script.
8+
--
9+
-- This test installs a fake Cabal-1.2 and then tries to build the package
10+
-- custom-setup, which depends on a fake Cabal-2.0 (through cabal-version and
11+
-- setup-depends).
412
main = cabalTest $ do
513
withSandbox $ do
6-
cabal "install" ["./Cabal-99998"]
7-
cabal_sandbox "add-source" ["Cabal-99999"]
14+
cabal "install" ["./Cabal-1.2"]
15+
cabal_sandbox "add-source" ["Cabal-2.0"]
816

9-
-- Install custom-setup, which has a setup dependency on Cabal-99999.
10-
-- cabal should build the setup script with Cabal-99999, but then
11-
-- configure should fail because Setup just prints an error message
17+
-- cabal should build custom-setup's setup script with Cabal-2.0, but
18+
-- then configure should fail because Setup just prints an error message
1219
-- imported from Cabal and exits.
1320
r <- fails $ cabal' "install" ["custom-setup/"]
14-
assertOutputContains "This is Cabal-99999" r
21+
assertOutputContains "This is Cabal-2.0" r

0 commit comments

Comments
 (0)