-
Notifications
You must be signed in to change notification settings - Fork 722
Open
Labels
cabal-install: cmd/installcabal-install: cmd/sdistre: mainConcerning the `main-is` fieldConcerning the `main-is` fieldtype: bug
Description
Describe the bug
cabal file containing
executable foo-bar
if flag(wat)
main-is: bar-foo.hs
else
main-is: foo-bar.hs
is rejected with
Ambiguous values for modulePath field: '"bar-foo.hs"' and '"foo-bar.hs"'
CallStack (from HasCallStack):
error, called at src/Distribution/Types/UnqualComponentName.hs:128:7 in Cabal-syntax-3.11.0.0-inplace:Distribution.Types.UnqualComponentName
To Reproduce
$ cat foo.cabal
cabal-version: 3.0
name: foo
version: 0
flag wat
default: False
manual: True
executable foo-bar
if flag(wat)
main-is: bar-foo.hs
else
main-is: foo-bar.hs
hs-source-dirs: src
build-depends: base
$ cabal install
Expected behavior
builds
System information
6.6.12-200.fc39.x86_64 x86_64 GNU/Linux
cabal-install version 3.11.0.0
compiled using version 3.11.0.0 of the Cabal library
ghc-9.6.3
Additional context
with cabal-install 3.10.2.1, the problem can be repaired with indenting else
, see. ucsd-progsys/liquidhaskell#2258 (comment) but cabal-install-3.11 will reject that with
Warning: foo.cabal:12:4: invalid subsection "else"
Warning: foo.cabal:12:4: Inconsistent indentation. Indentation jumps at lines 12
amigalemming
Metadata
Metadata
Assignees
Labels
cabal-install: cmd/installcabal-install: cmd/sdistre: mainConcerning the `main-is` fieldConcerning the `main-is` fieldtype: bug