@@ -153,6 +153,16 @@ tests = [
153
153
solverFailure (isInfixOf " only already installed instances can be used" )
154
154
, runTest $ allowBootLibInstalls $ mkTest dbBase " Install base with --allow-boot-library-installs" [" base" ] $
155
155
solverSuccess [(" base" , 1 ), (" ghc-prim" , 1 ), (" integer-gmp" , 1 ), (" integer-simple" , 1 )]
156
+ , runTest $ mkTest dbGHCDepend " Refuse to install newer version of ghc requested by another library" [" A" ] $
157
+ solverFailure . isInfixOf $
158
+ " Could not resolve dependencies:\n "
159
+ ++ " [__0] trying: A-1.0.0 (user goal)\n "
160
+ ++ " [__1] next goal: ghc (dependency of A)\n "
161
+ ++ " [__1] rejecting: ghc-1.0.0/installed-1 (conflict: A => ghc==2.0.0)\n "
162
+ ++ " [__1] rejecting: ghc-2.0.0 (constraint from non-upgradeable package requires installed instance)\n "
163
+ ++ " [__1] fail (backjumping, conflict set: A, ghc)\n "
164
+ ++ " After searching the rest of the dependency tree exhaustively, "
165
+ ++ " these were the goals I've had most trouble fulfilling: A, ghc"
156
166
]
157
167
, testGroup " reject-unconstrained" [
158
168
runTest $ onlyConstrained $ mkTest db12 " missing syb" [" E" ] $
@@ -1123,6 +1133,16 @@ dbBase = [
1123
1133
, Right $ exAv " integer-gmp" 1 []
1124
1134
]
1125
1135
1136
+ dbGHCDepend :: ExampleDb
1137
+ dbGHCDepend =
1138
+ let base = exInst " base" 1 " base-1" []
1139
+ in [
1140
+ Left base
1141
+ , Left $ exInst " ghc" 1 " ghc-1" [base]
1142
+ , Right $ exAv " ghc" 2 []
1143
+ , Right $ exAv " A" 1 [ExFix " ghc" 2 ]
1144
+ ]
1145
+
1126
1146
db13 :: ExampleDb
1127
1147
db13 = [
1128
1148
Right $ exAv " A" 1 []
0 commit comments