Skip to content
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

cabal no longer supports package version tags #890

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

cabal no longer supports package version tags #890

bos opened this issue May 24, 2012 · 8 comments

Comments

@bos
Copy link
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
@bos
Copy link
Contributor Author

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
Copy link

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 added a commit to ntc2/haskell-call-trace that referenced this issue Jan 25, 2014
@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 23, 2015
@23Skidoo 23Skidoo modified the milestones: Cabal 1.24, Cabal 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016
@ezyang
Copy link
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
@kolmodin
Copy link
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

@linearray
Copy link
Member

I feel like doing a bit of archeology today.

The issue described seems to have been fixed, cabal/cabal-install 2.2 give a warning about version tags and do not crash:

>cabal install
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Warning: foobar.cabal:0:0: version with tags
Resolving dependencies...
Configuring foobar-0.2.0...
Building foobar-0.2.0...
Installed foobar-0.2.0

The version tag appears to be completely ignored. I suppose that is good enough or do we need to abort when encountering version tags?

@endgame
Copy link

endgame commented Dec 2, 2019

Related: I get "version with tags" warnings if I have something that looks like a tag in the license: version (like GPL-3-or-later), even if I don't have tags in the version number.

@phadej
Copy link
Collaborator

phadej commented Dec 2, 2019 via email

@endgame
Copy link

endgame commented Dec 2, 2019

I had not, but that fixed my issue. Thank you.

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

No branches or pull requests

9 participants