Skip to content

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

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

Open
bos opened this issue May 24, 2012 · 8 comments
Open

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

bos opened this issue May 24, 2012 · 8 comments
Labels
Cabal: other Cabal: parser old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: bug
Milestone

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(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

else

main-is: Main.hs

My entire config can be found on hpaste: http://hpaste.org/44939/yicabal (problematic lines around 268).

@bos
Copy link
Contributor Author

bos commented May 24, 2012

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

Another example http://hpaste.org/48025

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 Apr 23, 2015
@BardurArantsson
Copy link
Collaborator

Sounds... obsolete. Suggest close...?

@BardurArantsson
Copy link
Collaborator

Will most likely be subsumed by #2865 which seems like it's going to be getting in sometime soonish. Closing.

@phadej
Copy link
Collaborator

phadej commented Nov 7, 2015

I'd rather keep this open, and check if it really solved. We can (should?) write tests for this kind of regressions before closing.

@phadej phadej reopened this Nov 7, 2015
@BardurArantsson
Copy link
Collaborator

Ok, fair enough. I really mostly just wanted to (indirectly) call your attention to this.

@phadej
Copy link
Collaborator

phadej commented Nov 7, 2015

👍

@ttuegel ttuegel self-assigned this Mar 10, 2016
@BardurArantsson
Copy link
Collaborator

@phadej Is this fixed?

I just noticed it because I was looking at the GH Projects tab about the Parsec-based parser. That GH Project should probably be closed as well?

@phadej
Copy link
Collaborator

phadej commented May 27, 2018 via email

@ttuegel ttuegel removed their assignment May 28, 2018
@andreabedini andreabedini added the old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cabal: other Cabal: parser old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: bug
Projects
None yet
Development

No branches or pull requests

5 participants