Libraries are deduped (differs from pkg-config) #78

Closed
opened 2015-07-13 18:56:34 +00:00 by floppym · 5 comments
floppym commented 2015-07-13 18:56:34 +00:00 (Migrated from github.com)

Given 2 pc files:

% cat foo.pc
Name: foo
Description: test
Version: 1.0
Libs: -lfoo -ldl

% cat bar.pc
Name: bar
Description: test
Version: 1.0
Requires: foo
Libs: -lbar -ldl

pkgconf and pkg-config produce different output.

% pkg-config --libs bar
-lbar -ldl -lfoo -ldl

% pkgconf --libs bar
-lbar -lfoo -ldl

I discovered this while debugging a build failure for the efibootmgr software. In case you are curious to see some of the weird pkgconfig files that people create:

e9626bda6f

Given 2 pc files: ``` % cat foo.pc Name: foo Description: test Version: 1.0 Libs: -lfoo -ldl % cat bar.pc Name: bar Description: test Version: 1.0 Requires: foo Libs: -lbar -ldl ``` pkgconf and pkg-config produce different output. ``` % pkg-config --libs bar -lbar -ldl -lfoo -ldl % pkgconf --libs bar -lbar -lfoo -ldl ``` I discovered this while debugging a build failure for the efibootmgr software. In case you are curious to see some of the weird pkgconfig files that people create: https://github.com/floppym/efivar/commit/e9626bda6fe09892ee5ed73931995f99829334b7

The deduplication is intentional in non-static mode. pkg-config also has naive deduplication code, but ours is better.

I assume that efibootmgr is a static build?

The deduplication is intentional in non-static mode. pkg-config also has naive deduplication code, but ours is better. I assume that efibootmgr is a static build?

Actually, the fix you made seems to break an invalid pkg-config file to be honest.

@bapt what do you think?

Actually, the fix you made seems to break an invalid pkg-config file to be honest. @bapt what do you think?
floppym commented 2015-07-19 21:05:55 +00:00 (Migrated from github.com)

I assume that efibootmgr is a static build?

No, it is not.

Actually, the fix you made seems to break an invalid pkg-config file to be honest.

I don't know what you mean by that.

> I assume that efibootmgr is a static build? No, it is not. > Actually, the fix you made seems to break an invalid pkg-config file to be honest. I don't know what you mean by that.

@floppym

can you drop by #pkgconf on freenode so we can help determine whether this is a pkgconf bug or a bug in the file to begin with? we need more information, as pkgconf does make optimizations that pkg-config doesn't, and generally, those optimizations depend on .pc files being correct. I think the change you made to efivar, for example, fixes the problem and it was just dumb luck that it ever worked on freedesktop's implementation to begin with.

we would like to fix this before releasing 0.9.12 if it really winds up being a problem on our side, but bug-for-bug compatibility, in general, isn't a design goal of pkgconf.

@floppym can you drop by `#pkgconf` on freenode so we can help determine whether this is a pkgconf bug or a bug in the file to begin with? we need more information, as pkgconf does make optimizations that pkg-config doesn't, and generally, those optimizations depend on .pc files being correct. I think the change you made to efivar, for example, fixes the problem and it was just dumb luck that it ever worked on freedesktop's implementation to begin with. we would like to fix this before releasing 0.9.12 if it really winds up being a problem on our side, but bug-for-bug compatibility, in general, isn't a design goal of pkgconf.
16:09 <@bapt> actually given you push back
16:09 <@bapt> is the pc files are properly done
16:09 <@bapt> then the dependency chain will always put things in the right order
16:10 <@bapt> so yes it is not a bug
16:10 <@bapt> it is pkgconf being pedantic on pc files which I think is a good thing
16:13 <@kaniini> i think it's a pkg-config bug

But we should more explicitly document that pkgconf is more pedantic. So I will commit that documentation change soon.

``` 16:09 <@bapt> actually given you push back 16:09 <@bapt> is the pc files are properly done 16:09 <@bapt> then the dependency chain will always put things in the right order 16:10 <@bapt> so yes it is not a bug 16:10 <@bapt> it is pkgconf being pedantic on pc files which I think is a good thing 16:13 <@kaniini> i think it's a pkg-config bug ``` But we should more explicitly document that pkgconf is more pedantic. So I will commit that documentation change soon.
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#78
There is no content yet.