-
Notifications
You must be signed in to change notification settings - Fork 704
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
pkg-config uses a more general version scheme #163
Comments
(Imported comment by @dcoutts on 2007-11-05) A possibly-better reference for the rpm version string comparison code: |
(Imported comment by guest on 2008-01-26) I got $ cabal install Resolving dependencies... Configuring alsa-core-0.5.0.1... cabal: parsing output of pkg-config --modversion failed cabal: Error: some packages failed to install: alsa-core-0.5.0.1 failed during the configure step. The exception was: ExitFailure 1because $ pkg-config --modversion alsa 1.0.14aI remember that Cabal had functions for parsing version numbers with tags, would this help here? Newer ALSA versions do not seem to have the version tag anymore. |
(Imported comment by guest on 2011-03-05) How about using pkg-config's --atleast-version option? Then Cabal does not need to parse the version number at all. |
(Imported comment by @dcoutts on 2011-03-05) We do need to parse the version because people can use arbitrarily complicated version constraints, not just ">= x.y". I think we just need to do it properly and have pkg-config versions use a different type internally than Version, and use different version comparison code. |
Closing as there's been no activity in years. We're cleaning up the bug tracker to make it useful again and are thus closing bugs that haven't seen any activity in a long time. Please re-open (or file a new bug) if the problem reappears. |
This is still an issue. With
This is due to the
|
@mietek Do you have the ability and/or inclination to help with fixing this issue? If you're keen the Cabal developers are going to be very grateful for any manpower you can offer. Given how long this has gone unaddressed, I fear it'll go on being unresolved otherwise. I propose this be closed -- if @mietek wants he can reopen. (But please only do so if you want to help address it or know somebody who can.) |
@23Skidoo |
I have been observing that when building |
My apologies, this has fallen off my radar for a while now. In #2730 you can see that it got a bit more complicated, and as far as I could tell, clear decisions weren't really reached regarding where the extra tags should be allowed, and whether they should be ignored or actually used for comparison (and, what comparison function should be used). In addition my own reason for needing the fix mostly went away. So, anyone else is certainly free to pick this back up. |
Yet one more package that this bug affects is hlibBladeRF-0.1.0.6 which depends on libbladeRF. Ubuntu 14.04 provides This one almost parses correctly as a tag; the only issue is that simpleParse in Cabal/Distribution/Text.hs assumes tags are Char.isAlphaNum, but the period is not alphanumeric. |
Perhaps, as a stopgap, we should just truncate the version string at the point where it stops looking like a normal version? This should be easy to implement, should be a very small change, and will get more packages compiling than before. |
This still seems to be a problem
|
#5098 is related. |
- #163 Also resolves #5138 Introduce PkgconfigVersion and PkgconfigVersionRange - `PkgconfigVersion` is compared with `rpmvercmp` - `PkgconfigVersionRange` is subset of `VersionRange` - with `cabal-version` before 3.0 it's parsed like `VersionRange`, where version digits are arbitrary integral (leading spaces allowed) - starting from cabal spec 3.0 `== x.y.*` and `^>=` (and set `{ .. }`) are disallowed. Yet, the version literals syntax is relaxed to accept alphanumerical + `-.` strings. E.g. openssl's `1.1.0h` is accepted. Lax `PkgconfigVersion` parser is also used to parse `pkg-config --modversion` output.
- Don't accept leading zeros in Version or VersionRange - Fixes #163 (pkg-config uses a more general version scheme) - Also resolves #5138 - `PkgconfigVersion` is compared with `rpmvercmp` - `PkgconfigVersionRange` is subset of `VersionRange` - with `cabal-version` before 3.0 it's parsed like `VersionRange`, where version digits are arbitrary integral (leading spaces allowed) - starting from cabal spec 3.0 `== x.y.*` and `^>=` (and set `{ .. }`) are disallowed. Yet, the version literals syntax is relaxed to accept alphanumerical + `-.` strings. E.g. openssl's `1.1.0h` is accepted. - Lax `PkgconfigVersion` parser is also used to parse `pkg-config --modversion` output.
- Don't accept leading zeros in Version or VersionRange - Fixes #163 (pkg-config uses a more general version scheme) - Also resolves #5138 - `PkgconfigVersion` is compared with `rpmvercmp` - `PkgconfigVersionRange` is subset of `VersionRange` - with `cabal-version` before 3.0 it's parsed like `VersionRange`, where version digits are arbitrary integral (leading spaces allowed) - starting from cabal spec 3.0 `== x.y.*` and `^>=` (and set `{ .. }`) are disallowed. Yet, the version literals syntax is relaxed to accept alphanumerical + `-.` strings. E.g. openssl's `1.1.0h` is accepted. - Lax `PkgconfigVersion` parser is also used to parse `pkg-config --modversion` output.
- Don't accept leading zeros in Version or VersionRange - Fixes #163 (pkg-config uses a more general version scheme) - Also resolves #5138 - `PkgconfigVersion` is compared with `rpmvercmp` - `PkgconfigVersionRange` is subset of `VersionRange` - with `cabal-version` before 3.0 it's parsed like `VersionRange`, where version digits are arbitrary integral (leading spaces allowed) - starting from cabal spec 3.0 `== x.y.*` and `^>=` (and set `{ .. }`) are disallowed. Yet, the version literals syntax is relaxed to accept alphanumerical + `-.` strings. E.g. openssl's `1.1.0h` is accepted. - Lax `PkgconfigVersion` parser is also used to parse `pkg-config --modversion` output.
- Don't accept leading zeros in Version or VersionRange - Fixes #163 (pkg-config uses a more general version scheme) - Also resolves #5138 - `PkgconfigVersion` is compared with `rpmvercmp` - `PkgconfigVersionRange` is subset of `VersionRange` - with `cabal-version` before 3.0 it's parsed like `VersionRange`, where version digits are arbitrary integral (leading spaces allowed) - starting from cabal spec 3.0 `== x.y.*` and `^>=` (and set `{ .. }`) are disallowed. Yet, the version literals syntax is relaxed to accept alphanumerical + `-.` strings. E.g. openssl's `1.1.0h` is accepted. - Lax `PkgconfigVersion` parser is also used to parse `pkg-config --modversion` output.
@idontgetoutmuch , what does |
In Debian Buster the package
|
But this is very out of date. |
(Imported from Trac #170, reported by @dcoutts on 2007-11-05)
From HsOpenSSL.cabal
For example: Currently Cabal tries to map pkg-config versions to the standard Version type which only allows for a sequence of numbers.pkg-config uses just strings to represent package versions. It uses code lifted from rpm to compare version strings. See the compare_versions function in pkg-gconfig-0.22/pkg.c from http://pkgconfig.freedesktop.org/releases/pkg-config-0.22.tar.gz
The text was updated successfully, but these errors were encountered: