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

Accept + in PkgconfigVersion #6539

Open
phadej opened this issue Feb 14, 2020 · 5 comments
Open

Accept + in PkgconfigVersion #6539

phadej opened this issue Feb 14, 2020 · 5 comments
Assignees
Labels
Cabal: file format re: pkg-config Concerning pkg-config and pkgconfig-depends constraints type: enhancement

Comments

@phadej
Copy link
Collaborator

phadej commented Feb 14, 2020

See #163 (comment)

Currently we have

instance Parsec PkgconfigVersion where
    parsec = PkgconfigVersion . BS8.pack <$> P.munch1 predicate where
        predicate c = isAsciiAlphaNum c || c == '.' || c == '-'

But I think we can accept all non-space, non-comma and non &|<=> characters. (Technically we can accept also &|<=>, but then the space will be required between the "version range operators" and version) Yet it would be really nice if there were some reference what kind of characters are used out there; underspecification of what pkg-config accepts / recommends is not nice, as we need to be able to combine these version strings into larger grammars

@phadej
Copy link
Collaborator Author

phadej commented Feb 14, 2020

cc @amigalemming

This can be fixed in Cabal-3.4, but not earlier as it will extend the syntax.

I'd really like to see if there's any attempts to specify pkg-config version strings, or will some 1.23>45 pop-up next year. (At which point I'd give up).

@phadej
Copy link
Collaborator Author

phadej commented Feb 14, 2020

A small experiment on my machine (Ubuntu 18.04), the current behavior would accept everything, + is not there, except for openblas; so I'm keen to only add plus, +

% pkg-config --modversion blas 
0.2.20+ds
% for f in /usr/share/pkgconfig/*.pc; do pkg-config --modversion $(basename $f | sed 's/.pc$//'); done
3.28.0
1.4.2
2.8
1.1.2
0.4.2
1.2.1
2.3.1
2.8
1.2
5.0
2.1.3
1.3.1
1.4.17
2.3.2
3.79
1.0.7
1.7.0
20170310
0.4.8
1.2
1.6.0
1.14.2
0.11.1
1.2.0
1.2.2
1.9
237
237
007
2.3.3
1.13
1.0.4
1.1.1
1.2.2
7.3.0
1.2.0
2.1
2.1.1
2.3.1
1.2.1
1.3.1
2.23.1
1.11
7.0.32
1.3.5
3.20.1
% for f in /usr/lib/pkgconfig/*.pc; do pkg-config --modversion $(basename $f | sed 's/.pc$//'); done
1.9.14
0.9.20131130
3.4.4
% for f in /usr/lib/x86_64-linux-gnu/pkgconfig/*.pc; do pkg-config --modversion $(basename $f | sed 's/.pc$//'); done
1.1.3
2.26.2
2.28.1
2.28.0
3.7.1
0.2.20+ds
0.2.20+ds
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.15.10
1.12.2
0.2.0
0.4.0
0.4.0
19.2.8
19.2.8
1.4.3
2.2.5
3.3.7
3.3.7
3.3.7
3.3.7
2.12.6
6.1.20180127
21.0.15
3.22.30
3.22.30
2.36.11
2.36.11
3.22.30
3.22.30
2.4.7
2.56.4
2.56.4
19.2.8
2.56.4
19.2.8
9.0.0
2.56.4
2.56.4
2.56.4
2.56.4
1.56.1
1.56.1
3.0.1
2.4
2.56.4
3.22.30
3.22.30
3.22.30
3.22.30
3.22.30
1.7.2
1.7.2
1.7.2
1.5.17
1.0.9
60.2
60.2
1.0.3
50.0.0
60.2
60.2
2.26.3
3.7.1
0.2.20+ds
0.2.20+ds
1.0.2n
2.4.99
2.4.99
2.4.99
2.4.99
2.4.99
3.2.1
1.0.0

5.2.2
8.39
8.39
8.39
8.39
8.39
1.6.34
1.6.34
10.10
11.1
11.1
11.1
2.62.1
1.0.2n
237
237
1.18.0
2.9.4
6.1.20180127
2.0.0
0.31.1
0.31.1
0.31.1
6.1.20180127
6.1.20180127
0.2.20
1.0.2n
6.1.20180127
1.40.14
1.40.14
1.40.14
1.40.14
0.34.0
3.0.0
3.0.0
0.3
2.5.0
2.5.0
2.0.8
2.0.14
1.2.2
6.1.20180127
6.1.20180127
1.16.0
1.16.0
18.1.0
1.16.0
1.16.0
2.26.3
2.26.3
1.6.4
1.6.4
1.0.8
1.13
1.13
1.13
1.13
1.13
1.13
1.13
1.13
1.13
1.13
1.13
0.4.4
1.1.15
1.1.4
1.1.2
1.3.3
5.0.3
2.3.2
1.1.3
1.7.9
0.8.2
1.5.1
0.9.10
1.2.2
1.3
1.1.5
1.2.3
1.0.11
1.1.4
1.2.11

phadej added a commit to phadej/cabal that referenced this issue Feb 14, 2020
@amigalemming
Copy link
Contributor

amigalemming commented Feb 14, 2020 via email

@phadej
Copy link
Collaborator Author

phadej commented Feb 14, 2020

That's directly less expressive than current pkgconfig-depends syntax, so it's way more code that in #6541

@phadej
Copy link
Collaborator Author

phadej commented Feb 14, 2020

To clarify, this issue is so you can write pkgconfig-depends: blas >= 0.2.20+ds2, for which we need to accept + character. #6541 fixes when the .pc file contains pluses, so cabal doesn't crash on weird versions in the database (e.g. when you don't really care that much about particular version).

phadej added a commit to phadej/cabal that referenced this issue Feb 14, 2020
phadej added a commit to phadej/cabal that referenced this issue Feb 14, 2020
@phadej phadej added this to the 3.4 milestone Mar 11, 2020
@phadej phadej self-assigned this Mar 11, 2020
@andreasabel andreasabel added the re: pkg-config Concerning pkg-config and pkgconfig-depends constraints label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cabal: file format re: pkg-config Concerning pkg-config and pkgconfig-depends constraints type: enhancement
Projects
None yet
Development

No branches or pull requests

4 participants