diff --git a/Cabal-syntax/src/Distribution/PackageDescription/PrettyPrint.hs b/Cabal-syntax/src/Distribution/PackageDescription/PrettyPrint.hs index b03b1b99ada..8303a65e7d5 100644 --- a/Cabal-syntax/src/Distribution/PackageDescription/PrettyPrint.hs +++ b/Cabal-syntax/src/Distribution/PackageDescription/PrettyPrint.hs @@ -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 @@ -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. transformM :: Mixin -> Mixin transformM (Mixin pn (LSubLibName uqn) inc) - | pn == thisPn = + | pn == thisPn && specVer < CabalSpecV3_4 = mkMixin (unqualComponentNameToPackageName uqn) LMainLibName inc transformM m = m diff --git a/validate.sh b/validate.sh index ff1c9e139a9..4fd67ffff55 100755 --- a/validate.sh +++ b/validate.sh @@ -419,7 +419,7 @@ CMD="$($CABALLISTBIN Cabal-tests:test:no-thunks-test) $TESTSUITEJOBS --hide-succ # See #10284 for why this value is pinned. -HACKAGE_TESTS_INDEX_STATE="--index-state=2024-08-25" +HACKAGE_TESTS_INDEX_STATE="--index-state=2024-08-28" CMD=$($CABALLISTBIN Cabal-tests:test:hackage-tests) (cd Cabal-tests && timed $CMD read-fields $HACKAGE_TESTS_INDEX_STATE) || exit 1