-
Notifications
You must be signed in to change notification settings - Fork 841
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
stack upload
fails when using pvp-bounds
and an if
statement in my cabal file
#2927
Comments
This bug was noticed because of the following PR: cdepillabout/pretty-simple#1 |
Hmm, I can't directly reproduce the issue. With upload it does indeed try to upload. I can also create a --pvp-bounds tarball:
The resulting cabal file does look a bit different for that stanza
Seems like cabal is doing some simplification? |
@mgsloan Thanks for looking into this. That's really strange. I'm still getting the same error on the same repo. Here's how I'm reproducing this: $ stack --version
Version 1.3.2 x86_64 hpack-0.15.0
$ git clone [email protected]:cdepillabout/pretty-simple.git
$ cd pretty-simple
$ git checkout v2.0.0.0
$ stack sdist --pvp-bounds both
Getting file list for /home/me/git/pretty-simple-test/
Building sdist tarball for /home/me/git/pretty-simple-test/
Unable to parse cabal file /tmp/stack20626/pretty-simple-2.0.0.0/pretty-simple.cabal: FromString "'then' branch of 'if' is empty" (Just 53) If we're using the same version of |
Actually, I'm on the latest git version of stack, which I believe includes a newer version of the Cabal library than v1.3.2. Can you give |
$ stack upgrade --git
Current Stack version: 1.3.2, available download version: 1.3.2
Skipping binary upgrade, your version is already more recent
$ Maybe you meant for me to try the latest I tried it with the latest $ stack --version
Version 1.3.3, Git revision aae28fe5929af966e36b5ad075d455087a255b30 (4527 commits) x86_64 hpack-0.17.0
$ git clone [email protected]:cdepillabout/pretty-simple.git
$ cd pretty-simple
$ git checkout v2.0.0.0
$ stack sdist --pvp-bounds both
Getting file list for /home/me/git/pretty-simple-test/
Building sdist tarball for /home/me/git/pretty-simple-test/
Checking package 'pretty-simple' for common mistakes
Wrote sdist tarball to /home/me/git/pretty-simple/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/pretty-simple-2.0.0.0.tar.gz So I guess this has been fixed by a newer version of the |
Cool! I'm surprised that |
General summary/comments
stack upload
fails when usingpvp-bounds: both
and anif
statement in my cabal file.Steps to reproduce
I am trying to upload the pretty-simple package to Hackage.
Here is how the bug can be reproduced:
stack upload .
You might need to edit the
pretty-simple.cabal
file so the package name is different. I'm not sure what will happen if you try to upload a package that conflicts with another package.Expected
If I only use an
if
statements in my.cabal
file (and not specifypvp-bounds: both
in thestack.yaml
file), then the upload succeeds.If I only use
pvp-bounds: both
and don't use anyif
statements in my.cabal
file, then the upload succeeds.Actual
If I specify
pvp-bounds: both
and use anif
statement in my.cabal
file, then I get the following error:The very last line seems to be the culprit:
This error is about the following
executable
section in the cabal file:The error looks like it is saying that there is no
then
branch of theif
statement, but as far as I can tell, there is athen
branch.Stack version
Method of installation
stack upgrade
The text was updated successfully, but these errors were encountered: