Handling of Requires.private #60

Closed
opened 2014-01-07 16:16:31 +00:00 by andrewshadura · 4 comments
andrewshadura commented 2014-01-07 16:16:31 +00:00 (Migrated from github.com)

Sebastian Ramacher (@sebastinas) writes:

So there are two cases where pkgconf behavior is not consistent with
that from pkg-config:

  • It treats Requires.Private the same as Requires.private which
    pkg-config does not.
  • It errors out if a package given in Requires.private is missing
    although --static is not passed on the command line. pkg-config does
    not fail in that case.

IMHO these issues need to be fixed if pkgconf wants to provide
/usr/bin/pkg-config.

For more details, see Debian bug #734491.

Sebastian Ramacher (@sebastinas) writes: > So there are two cases where pkgconf behavior is not consistent with > that from pkg-config: > - It treats Requires.Private the same as Requires.private which > pkg-config does not. > - It errors out if a package given in Requires.private is missing > although --static is not passed on the command line. pkg-config does > not fail in that case. > > IMHO these issues need to be fixed if pkgconf wants to provide > /usr/bin/pkg-config. For more details, see Debian bug [#734491](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734491).
sebastinas commented 2014-01-07 17:16:24 +00:00 (Migrated from github.com)

The second point was a error on my part. The first one still applies. I think the handling of the case of field name should be the same in both tools.

The second point was a error on my part. The first one still applies. I think the handling of the case of field name should be the same in both tools.

I am not convinced that 100% compatibility with pkgconfig is a requirement. If anything, the latter behaviour is a bug in pkg-config, as quite a few other fields there are in fact case-insensitive.

I am not convinced that 100% compatibility with pkgconfig is a requirement. If anything, the latter behaviour is a bug in pkg-config, as quite a few other fields there are in fact case-insensitive.
sebastinas commented 2014-01-12 19:47:44 +00:00 (Migrated from github.com)

Which keyword names does pkg-config compare case-insensitive? The only keyword that gets special treatment by pkg-config is Cflags where CFlags is also allowed. Also, in pkg-config variable names are case-sensitive, in pkgconfig they are not. This gives surprising results with the following file:

foo=3
Foo=4

Name: foo
Description: foo
Version: 1
Requires: gtk+-${foo}.0

Let's run some commands:

$ pkgconf foo --variable=foo
4
$ pkgconf foo --variable=Foo
4
$ pkgconf foo --libs
Package gtk+-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-4.0', required by 'foo', not found
$ pkg-config foo --variable=foo
3
$ pkg-config foo --variable=Foo
4
$ pkg-config foo --libs
-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0

And by rearranging the definitions of foo and Foo you get totally different behavior from pkgconf. That's not what I'd expect.

Which keyword names does pkg-config compare case-insensitive? The only keyword that gets special treatment by pkg-config is Cflags where CFlags is also allowed. Also, in pkg-config variable names are case-sensitive, in pkgconfig they are not. This gives surprising results with the following file: ``` foo=3 Foo=4 Name: foo Description: foo Version: 1 Requires: gtk+-${foo}.0 ``` Let's run some commands: ``` $ pkgconf foo --variable=foo 4 $ pkgconf foo --variable=Foo 4 $ pkgconf foo --libs Package gtk+-4.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-4.0.pc' to the PKG_CONFIG_PATH environment variable Package 'gtk+-4.0', required by 'foo', not found $ pkg-config foo --variable=foo 3 $ pkg-config foo --variable=Foo 4 $ pkg-config foo --libs -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 ``` And by rearranging the definitions of foo and Foo you get totally different behavior from pkgconf. That's not what I'd expect.

I have made variables case-sensitive, and some fields on the .pc file case-sensitive. CFLAGS and LIBS (and their .private counterparts) remain as they are.

I feel this is the best approach.

I have made variables case-sensitive, and some fields on the .pc file case-sensitive. `CFLAGS` and `LIBS` (and their `.private` counterparts) remain as they are. I feel this is the best approach.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#60
There is no content yet.