Skip to content

Commit 5ac2f87

Browse files
authored
Merge pull request #10287 from haskell/wip/t10283
Only munge internal dependencies when printing when there is no explicit syntax
2 parents 54b4838 + 4019d17 commit 5ac2f87

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Cabal-syntax/src/Distribution/PackageDescription/PrettyPrint.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ preProcessInternalDeps specVer gpd
271271

272272
transformD :: Dependency -> [Dependency]
273273
transformD (Dependency pn vr ln)
274-
| pn == thisPn =
274+
| pn == thisPn && specVer < CabalSpecV3_0 =
275275
if LMainLibName `NES.member` ln
276276
then Dependency thisPn vr mainLibSet : sublibs
277277
else sublibs
@@ -282,9 +282,12 @@ preProcessInternalDeps specVer gpd
282282
]
283283
transformD d = [d]
284284

285+
-- Always perform transformation for mixins as syntax was only introduced in 3.4
286+
-- This guard is uncessary as no transformations take place when cabalSpec >= CabalSpecV3_4 but
287+
-- it more clearly signifies the intent. (See the specVer >= CabalSpecV3_4 line above).
285288
transformM :: Mixin -> Mixin
286289
transformM (Mixin pn (LSubLibName uqn) inc)
287-
| pn == thisPn =
290+
| pn == thisPn && specVer < CabalSpecV3_4 =
288291
mkMixin (unqualComponentNameToPackageName uqn) LMainLibName inc
289292
transformM m = m
290293

Cabal-tests/tests/ParserTests/regressions/issue-6083-b.format

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ library
66
default-language: Haskell2010
77
build-depends:
88
base,
9-
sublib
9+
issue:sublib
1010

1111
library sublib
1212
default-language: Haskell2010
@@ -15,10 +15,10 @@ executable demo-a
1515
main-is: Main.hs
1616
build-depends:
1717
issue,
18-
sublib
18+
issue:sublib
1919

2020
executable demo-b
2121
main-is: Main.hs
2222
build-depends:
2323
issue,
24-
sublib
24+
issue:sublib

cabal-validate/src/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ runHackageTests opts
290290

291291
let
292292
-- See #10284 for why this value is pinned.
293-
hackageTestsIndexState = "--index-state=2024-08-25"
293+
hackageTestsIndexState = "--index-state=2025-01-12"
294294

295295
hackageTest args =
296296
timedWithCwd

0 commit comments

Comments
 (0)