Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


"main-is" misparsed in if/else, only by sdist #807

bos opened this Issue · 1 comment

2 participants


(Imported from Trac #817, reported by @jeffwheeler on 2011-03-22)

An if/else block which sets the main-is value for an executable based on a flag is misparsed when running "cabal sdist" (it's parsed correctly when running "cabal install").

Upon failure, it appears that it's looking for a filename that is the two main-is options concatenated together. E.g., I get the error "cabal: HackerMain?.hsMain.hs doesn't exist".

The problematic bit looks like:

if flag(hacking)

main-is: `HackerMain?`.hs


main-is: Main.hs

My entire config can be found on hpaste: (problematic lines around 268).


(Imported comment by @dcoutts on 2011-03-22)

Another example

Two problems: one is the way sdist uses flatten, and the other is that monoid instance for main-is concatenates rather than picks the last. sdist should not use flatten, it needs to get the collection of values.

@ttuegel ttuegel added this to the _|_ milestone
@ttuegel ttuegel removed the low-priority label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.