Bug 1953348 - pckgconf and pkg-config produce different outpus
Summary: pckgconf and pkg-config produce different outpus
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: pkgconf
Version: 33
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-25 16:31 UTC by David Arjona
Modified: 2021-11-30 18:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-30 18:40:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description David Arjona 2021-04-25 16:31:51 UTC
Description of problem:

Commands pkgconf and pkg-config produce different results. For example:

[myuser@localhost NLSR]$ pkg-config --cflags --libs PSync
-lPSync 
[myuser@localhost NLSR]$ pkgconf --cflags --libs PSync
-I/usr/local/include -L/usr/local/lib64 -lPSync 

This results in linker failing since it cannot find the libPSync.so library. I must clarify that neither the code I need to compile, nor the library are under my responsibility. Also, this code and library should run in different types of linux systems.


Version-Release number of selected component (if applicable):

Installed Packages
pkgconf.x86_64                                      1.7.3-5.fc33                            @updates
pkgconf-m4.noarch                                   1.7.3-5.fc33                            @updates
pkgconf-pkg-config.x86_64                           1.7.3-5.fc33                            @updates

A similar problem has been previously reported here:
https://access.redhat.com/discussions/4734691

I tried running the suggested instruction "pkgconf --validate /path/to/package.pc", and I get the following message:

/usr/local/lib64/pkgconfig/PSync.pc:7: warning: malformed version field with whitespace, trimming to [0.3.0]

However, the PSync.pc file (which was generated by code) does not contain any extra whitespaces, nor it seems to be malformed:

[myuser@localhost NLSR]$ cat /usr/local/lib64/pkgconfig/PSync.pc
prefix=/usr/local
libdir=/usr/local/lib64
includedir=/usr/local/include

Name: PSync
Description: NDN PSync library
Version: 0.3.0
Libs: -L${libdir} -lPSync
Cflags: -I${includedir}


How reproducible:

Always.


Steps to Reproduce:
1. Run command: pkg-config --cflags --libs <custom_library>
2. Run command: pkgconf --cflags --libs PSync <custom_library>
3. Observe different results

Actual results:

Reported above.


Expected results:

Same output from both commands.


Additional info:

This code and libraries were compiling and linking without problem when using Fedora 30 and previous versions.

Comment 1 Neal Gompa 2021-04-26 13:53:58 UTC
This is by design. If you want "pkg-config" search paths, then use "pkg-config", the "pkgconf" tool has much more restrictive search paths by default compared to "pkg-config".

Comment 2 Neal Gompa 2021-04-26 13:55:18 UTC
To clarify, "pkg-config" also searches and recognizes /usr/local by default when not run in an RPM build environment.

Comment 3 David Arjona 2021-04-26 17:07:42 UTC
(In reply to Neal Gompa from comment #2)
> To clarify, "pkg-config" also searches and recognizes /usr/local by default
> when not run in an RPM build environment.

That is the problem: "pkg-config" is NOT returning the two /usr/local paths that the linker needs.

Comment 4 Neal Gompa 2021-04-28 01:55:52 UTC
(In reply to David Arjona from comment #3)
> (In reply to Neal Gompa from comment #2)
> > To clarify, "pkg-config" also searches and recognizes /usr/local by default
> > when not run in an RPM build environment.
> 
> That is the problem: "pkg-config" is NOT returning the two /usr/local paths
> that the linker needs.

No, pkg-config has /usr/local/include and /usr/local/lib64 as "system paths", which is why they're not there. I guess I can drop that and we'll see how much people complain *again* about this...

Comment 5 David Arjona 2021-04-28 14:20:03 UTC
(In reply to Neal Gompa from comment #4)
> (In reply to David Arjona from comment #3)
> > (In reply to Neal Gompa from comment #2)
> > > To clarify, "pkg-config" also searches and recognizes /usr/local by default
> > > when not run in an RPM build environment.
> > 
> > That is the problem: "pkg-config" is NOT returning the two /usr/local paths
> > that the linker needs.
> 
> No, pkg-config has /usr/local/include and /usr/local/lib64 as "system
> paths", which is why they're not there. I guess I can drop that and we'll
> see how much people complain *again* about this...

Unfortunately, this is not the way pkg-config used to work in previous Fedora releases, and is not they way it works in other Linux distributions. This means that programs that compile and link in other Linuxes, will fail in Fedora.

Do you know if there is a way to modify the "system paths" for pkg-config?

Thanks for your help!

Comment 6 Neal Gompa 2021-04-28 15:21:09 UTC
(In reply to David Arjona from comment #5)
> (In reply to Neal Gompa from comment #4)
> > (In reply to David Arjona from comment #3)
> > > (In reply to Neal Gompa from comment #2)
> > > > To clarify, "pkg-config" also searches and recognizes /usr/local by default
> > > > when not run in an RPM build environment.
> > > 
> > > That is the problem: "pkg-config" is NOT returning the two /usr/local paths
> > > that the linker needs.
> > 
> > No, pkg-config has /usr/local/include and /usr/local/lib64 as "system
> > paths", which is why they're not there. I guess I can drop that and we'll
> > see how much people complain *again* about this...
> 
> Unfortunately, this is not the way pkg-config used to work in previous
> Fedora releases, and is not they way it works in other Linux distributions.
> This means that programs that compile and link in other Linuxes, will fail
> in Fedora.
> 
> Do you know if there is a way to modify the "system paths" for pkg-config?
> 

Yes. pkgconf itself is hardwired to standard system paths (as previous versions of pkgconfig did), pkg-config is a wrapper that adds a bit more based on previous BZes where people have asked for more.

Comment 7 Ben Cotton 2021-11-04 14:37:11 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ben Cotton 2021-11-04 15:35:09 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2021-11-30 18:40:31 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.