Skip to content

Commit

Permalink
Merge pull request #10287 from haskell/wip/t10283
Browse files Browse the repository at this point in the history
Only munge internal dependencies when printing when there is no explicit syntax
  • Loading branch information
mergify[bot] authored Jan 17, 2025
2 parents 54b4838 + 4019d17 commit 5ac2f87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ preProcessInternalDeps specVer gpd

transformD :: Dependency -> [Dependency]
transformD (Dependency pn vr ln)
| pn == thisPn =
| pn == thisPn && specVer < CabalSpecV3_0 =
if LMainLibName `NES.member` ln
then Dependency thisPn vr mainLibSet : sublibs
else sublibs
Expand All @@ -282,9 +282,12 @@ preProcessInternalDeps specVer gpd
]
transformD d = [d]

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

Expand Down
6 changes: 3 additions & 3 deletions Cabal-tests/tests/ParserTests/regressions/issue-6083-b.format
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ library
default-language: Haskell2010
build-depends:
base,
sublib
issue:sublib

library sublib
default-language: Haskell2010
Expand All @@ -15,10 +15,10 @@ executable demo-a
main-is: Main.hs
build-depends:
issue,
sublib
issue:sublib

executable demo-b
main-is: Main.hs
build-depends:
issue,
sublib
issue:sublib
2 changes: 1 addition & 1 deletion cabal-validate/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ runHackageTests opts

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

hackageTest args =
timedWithCwd
Expand Down

0 comments on commit 5ac2f87

Please sign in to comment.