Skip to content

Commit 397dcbb

Browse files
committed
Filter Setup flags: filter working dir on < 3.13
The --working-dir flag is only available for Cabal >= 3.13. This commit fixes an incorrect conditional: we only filtered out this flag for Cabal < 3.11, instead of < 3.13. Fixes #9940
1 parent bccc59f commit 397dcbb

File tree

1 file changed

+5
-4
lines changed
  • cabal-install/src/Distribution/Client

1 file changed

+5
-4
lines changed

cabal-install/src/Distribution/Client/Setup.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,20 +635,21 @@ filterCommonFlags :: CommonSetupFlags -> Version -> CommonSetupFlags
635635
filterCommonFlags flags cabalLibVersion
636636
-- NB: we expect the latest version to be the most common case,
637637
-- so test it first.
638-
| cabalLibVersion >= mkVersion [3, 11, 0] = flags_latest
638+
| cabalLibVersion >= mkVersion [3, 13, 0] = flags_latest
639+
| cabalLibVersion < mkVersion [3, 13, 0] = flags_3_13_0
639640
| cabalLibVersion < mkVersion [1, 2, 5] = flags_1_2_5
640641
| cabalLibVersion < mkVersion [2, 1, 0] = flags_2_1_0
641642
| cabalLibVersion < mkVersion [3, 11, 0] = flags_3_11_0
642643
| otherwise = error "the impossible just happened" -- see first guard
643644
where
644645
flags_latest = flags
645-
flags_3_11_0 =
646+
flags_3_13_0 =
646647
flags_latest
647648
{ setupWorkingDir = NoFlag
648649
}
649-
-- Cabal < 3.11 does not support the --working-dir flag.
650+
-- Cabal < 3.13 does not support the --working-dir flag.
650651
flags_2_1_0 =
651-
flags_3_11_0
652+
flags_3_13_0
652653
{ -- Cabal < 2.1 doesn't know about -v +timestamp modifier
653654
setupVerbosity = fmap verboseNoTimestamp (setupVerbosity flags_3_11_0)
654655
}

0 commit comments

Comments
 (0)