Closed mfine closed 6 years ago
Looks like this is an upstream bug in Cabal, I have opened https://github.com/haskell/cabal/issues/4863 with a repro. This version of stack now depends on Cabal 2.0 rather than Cabal 1.24. One of the big changes that has made the release long to allow for fixes.
Since stack-1.6 will be released imminently, I don't think there will be time for this to be fixed and a new version of it released. So, in order to make this clearer in the future, I have pushed a change which adds the following warning:
Thanks for digging into this @mgsloan!!!
@mfine No problem!
Based on the discussion in https://github.com/haskell/cabal/issues/4863 , it sounds like this is fixed in development versions of Cabal. However, there are various experimental features that might change, and they are migrating to a new parser. It may still be worth a shot to try out:
Using the version of Cabal right after the fix was committed. The fix is in a quite large change, so unfortunately I doubt it would be straightforward to backport atop latest stable.
As suggested by @phadej , be sure to reject cabal-version: 2.1
and later in cabal files.
Since there's a fix in Cabal development version, I've updated the output:
Warning: Bug detected in Cabal library. ((parse . render . parse) === id) does not hold for the cabal file
at /home/mgsloan/fpco/stack/stack.cabal
This seems to be fixed in development versions of Cabal, but at time of writing, the fix is not in any released versions.
Please see this GitHub issue for status: https://github.com/commercialhaskell/stack/issues/3549
If the issue is closed as resolved, then you may be able to fix this by upgrading to a newer version of stack
via stack upgrade for latest stable version or stack upgrade --git for the latest development version.
If the issue is fixed, but updating doesn't solve the problem, please check if there are similar open issues,
and if not, report a new issue to the stack issue tracker, at
https://github.com/commercialhaskell/stack/issues/new
If the issue is not fixed, feel free to leave a comment on it indicating that you would like it to be fixed.
I don't think this is a Cabal 2.0 bug specifically. I can reproduce this with Cabal-1.24.2.0 itself. Any workarounds for upload to hackage ?
@psibi I believe if you modify stack.yaml in stack repo to use Cabal from git, this should work. Might need to fix build errors if APIs changed. May be helpful to publish a branch with this change, others might benefit from it.
Just to update this issue with conclusions from elsewhere:
I think the takeaway here is simply that pvp-bounds will be unusable in Stack 1.6, and will continue to be unusable until a patched version of Cabal is officially released.
This looks resolved!
With 1.6.5:
Building sdist tarball for /Users/mark/repos/shakers/
Warning: Bug detected in Cabal library. ((parse . render . parse) === id) does not hold for the cabal file at /Users/mark/repos/shakers/shakers.cabal
This seems to be fixed in development versions of Cabal, but at time of writing, the fix is not in any released versions.
Please see this GitHub issue for status: https://github.com/commercialhaskell/stack/issues/3549
If the issue is closed as resolved, then you may be able to fix this by upgrading to a newer version of stack via stack upgrade for latest stable version or stack upgrade --git for the latest
development version.
If the issue is fixed, but updating doesn't solve the problem, please check if there are similar open issues, and if not, report a new issue to the stack issue tracker, at
https://github.com/commercialhaskell/stack/issues/new
If the issue is not fixed, feel free to leave a comment on it indicating that you would like it to be fixed.
Checking package 'shakers' for common mistakes
Package check reported the following warnings:
Packages using 'cabal-version: >= 1.10' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field.
With 1.7.0.1:
Building sdist tarball for /Users/mark/repos/shakers/
Checking package 'shakers' for common mistakes
Package check reported the following warnings:
Packages relying on Cabal 1.12 or later should specify a version range of the form 'cabal-version: x.y'. Use 'cabal-version: 1.22'.
The cabal stanzas for library and executable look fixed too:
With 1.6.5:
library
exposed-modules:
Development.Shakers
build-depends:
base >=4.8 && <5,
basic-prelude >=0.7.0,
directory >=1.3.0.2,
lifted-base >=0.2.3.12,
shake >=0.16.3
default-language: Haskell2010
hs-source-dirs: src
ghc-options: -Wall
executable shake-shakers
main-is: Shakefile.hs
With 1.7.0.1:
library
exposed-modules:
Development.Shakers
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
build-depends:
base >=4.8 && <5,
basic-prelude >=0.7.0,
directory >=1.3.0.2,
lifted-base >=0.2.3.12,
shake >=0.16.3
executable shake-shakers
main-is: Shakefile.hs
default-language: Haskell2010
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends:
base >=4.10.1.0,
shakers -any
Thanks! Feel free to close if you think this is also resolved.
Awesome, thanks for checking on this!
General summary/comments
Uploading with
pvp-bounds: lower
is removing things from the cabal file in 1.6.0.Steps to reproduce
Publish a package to hackage containing an executable with a dependency on the package's library with a stack.yaml containing
pvp-bounds: lower
.Expected
I expected the bounds to be set on the dependencies for the executable.
Actual
There were missing fields:
Before:
After:
Missing
default-language
,ghc-options
, andbuild-depends
.Here's the verbose output of sdist:
Stack version
See above ^^^.
Method of installation
Installed from HEAD.