cabal no longer supports package version tags #890

Open
bos opened this Issue May 24, 2012 · 4 comments

Projects

None yet

6 participants

Contributor
bos commented May 24, 2012

(Imported from Trac #900, reported by guest on 2011-11-20)

The following cabal file below triggers an assertion fail on the second install:

$ cabal --version
cabal-install version 0.13.3
using version 1.13.3 of the Cabal library
$ cabal install
Resolving dependencies...
Configuring foobar-0.2.0...
Building foobar-0.2.0...
Preprocessing library foobar-0.2.0...
[1 of 1] Compiling FooBar           ( FooBar.hs, dist/build/FooBar.o )
[1 of 1] Compiling FooBar           ( FooBar.hs, dist/build/FooBar.p_o )
Registering foobar-0.2.0...
Installing library in /home/hvr/.cabal/lib/foobar-0.2.0/ghc-7.2.2
Registering foobar-0.2.0...
$ cabal install
Resolving dependencies...
Configuring foobar-0.2.0...
cabal: Distribution/Simple/PackageIndex.hs:123:8-13: Assertion failed
Only when I unregister the installed package via ghc-pkg unregister foobar I can configure the package again...

The cabal file causing this behaviour:

name:                foobar
version:             0.2.0-git20111120
synopsis:            none
license:             BSD3
license-file:        LICENSE
author:              foo
maintainer:          foo@bar
build-type:          Simple
cabal-version:       >=1.10
library
  default-language: Haskell2010
  exposed-modules: FooBar
  build-depends: base
The FooBar module is just a dummy empty module. This used to work previously, e.g. with
$ cabal-0.11.2  --version
cabal-install version 0.11.2
using version 1.12.0 of the Cabal library
Contributor
bos commented May 24, 2012

(Imported comment by @dcoutts on 2011-11-20)

Package version tags are no longer supported. We should make this explicit and fail up front with a better error message.

ntc2 commented Jan 25, 2014

I just ran into this. Very confusing, since I'd never heard of Cabal tags. I added a version to the version number documentation: http://www.haskell.org/haskellwiki/Package_versioning_policy#Warning.21.

If the solution is to not support tags on the front end, then the fix is simple: just edit

Data.Version.parseVersion

and remove support for parsing tags (source).

@ntc2 ntc2 added a commit to ntc2/haskell-call-trace that referenced this issue Jan 25, 2014
@ntc2 ntc2 Support 'cabal install' and add 'cabal sandbox' related 'make' targets.
Ran into an obscure Cabal but along the way:

haskell/cabal#890?source=cc
8f90771
@ttuegel ttuegel added the easy label Apr 23, 2015
@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 23, 2015
@potomak potomak added a commit to SumAll/aws that referenced this issue Oct 2, 2015
@potomak potomak Fix version number
Cabal doesn't support version tags anymore.

See also:

* https://wiki.haskell.org/Package_versioning_policy
* haskell/cabal#890
317b40d
@potomak potomak referenced this issue in SumAll/aws Oct 2, 2015
Merged

Fix version number #2

@23Skidoo 23Skidoo modified the milestone: Cabal 1.24, Cabal 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016
Contributor
ezyang commented Sep 6, 2016

We still don't warn if there is a tag in the version number.

@ezyang ezyang added this to the Triaged milestone Sep 6, 2016
Member
kolmodin commented Sep 6, 2016

At least hackage should reject packages using version tags.
https://github.com/haskell/hackage-server/blob/master/Distribution/Server/Packages/Unpack.hs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment