Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only munge internal dependencies when printing when there is no explicit syntax #10287

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading