@@ -13,6 +13,7 @@ import qualified Distribution.Version as V
13
13
14
14
-- test-framework
15
15
import Test.Tasty as TF
16
+ import Test.Tasty.ExpectedFailure
16
17
17
18
-- Cabal
18
19
import Language.Haskell.Extension
@@ -190,6 +191,9 @@ tests =
190
191
, runTest $ mkTest db12 " baseShim4" [" C" ] (solverSuccess [(" A" , 1 ), (" B" , 1 ), (" C" , 1 )])
191
192
, runTest $ mkTest db12 " baseShim5" [" D" ] anySolverFailure
192
193
, runTest $ mkTest db12 " baseShim6" [" E" ] (solverSuccess [(" E" , 1 ), (" syb" , 2 )])
194
+ , expectFailBecause " #9467" $ runTest $ mkTest db12s " baseShim7" [" A" ] (solverSuccess [(" A" , 1 )])
195
+ , expectFailBecause " #9467" $ runTest $ mkTest db11s " baseShim7-simple" [" A" ] (solverSuccess [(" A" , 1 )])
196
+ , runTest $ mkTest db11s2 " baseShim8" [" A" ] (solverSuccess [(" A" , 1 )])
193
197
]
194
198
, testGroup
195
199
" Base and non-reinstallable"
@@ -1325,6 +1329,61 @@ db12 =
1325
1329
, Right $ exAv " E" 1 [ExFix " base" 4 , ExFix " syb" 2 ]
1326
1330
]
1327
1331
1332
+ -- | A version of db12 where the dependency on base happens via a setup dependency
1333
+ --
1334
+ -- * The setup dependency is solved in it's own qualified scope, so should be solved
1335
+ -- independently of the rest of the build plan.
1336
+ --
1337
+ -- * The setup dependency depends on `base-3` and hence `syb1`
1338
+ --
1339
+ -- * A depends on `base-4` and `syb-2`, should be fine as the setup stanza should
1340
+ -- be solved independently.
1341
+ db12s :: ExampleDb
1342
+ db12s =
1343
+ let base3 = exInst " base" 3 " base-3-inst" [base4, syb1]
1344
+ base4 = exInst " base" 4 " base-4-inst" []
1345
+ syb1 = exInst " syb" 1 " syb-1-inst" [base4]
1346
+ in [ Left base3
1347
+ , Left base4
1348
+ , Left syb1
1349
+ , Right $ exAv " syb" 2 [ExFix " base" 4 ]
1350
+ , Right $
1351
+ exAv " A" 1 [ExFix " base" 4 , ExFix " syb" 2 ]
1352
+ `withSetupDeps` [ExFix " base" 3 ]
1353
+ ]
1354
+
1355
+ -- | A version of db11 where the dependency on base happens via a setup dependency
1356
+ --
1357
+ -- * The setup dependency is solved in it's own qualified scope, so should be solved
1358
+ -- independently of the rest of the build plan.
1359
+ --
1360
+ -- * The setup dependency depends on `base-3`
1361
+ --
1362
+ -- * A depends on `base-4`, should be fine as the setup stanza should
1363
+ -- be solved independently.
1364
+ db11s :: ExampleDb
1365
+ db11s =
1366
+ let base3 = exInst " base" 3 " base-3-inst" [base4]
1367
+ base4 = exInst " base" 4 " base-4-inst" []
1368
+ in [ Left base3
1369
+ , Left base4
1370
+ , Right $
1371
+ exAv " A" 1 [ExFix " base" 4 ]
1372
+ `withSetupDeps` [ExFix " base" 3 ]
1373
+ ]
1374
+
1375
+ -- Works without the base-shimness, choosing different versions of base
1376
+ db11s2 :: ExampleDb
1377
+ db11s2 =
1378
+ let base3 = exInst " base" 3 " base-3-inst" []
1379
+ base4 = exInst " base" 4 " base-4-inst" []
1380
+ in [ Left base3
1381
+ , Left base4
1382
+ , Right $
1383
+ exAv " A" 1 [ExFix " base" 4 ]
1384
+ `withSetupDeps` [ExFix " base" 3 ]
1385
+ ]
1386
+
1328
1387
dbBase :: ExampleDb
1329
1388
dbBase =
1330
1389
[ Right $
0 commit comments