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

Error when .pc file lists conflicts #27

Open
joelspadin-garmin opened this issue Jan 19, 2023 · 0 comments
Open

Error when .pc file lists conflicts #27

joelspadin-garmin opened this issue Jan 19, 2023 · 0 comments

Comments

@joelspadin-garmin
Copy link

I have a system with the following files:

protobuf.pc

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 3.15.2
Libs: -L${libdir} -lprotobuf -lpthread
Libs.private: -lz 

Cflags: -I${includedir} -pthread
Conflicts: protobuf-lite

protobuf-lite.pc

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 3.15.2
Libs: -L${libdir} -lprotobuf-lite -lpthread
Cflags: -I${includedir} -pthread
Conflicts: protobuf

Running

python pykg-config.py --cflags --libs protobuf

fails because PackageNotFoundError is not defined at

except PackageNotFoundError:
and pkg.name is not defined at
raise PackageConflictError(pkg.name, conflict)

If I fix those issues, it then always raises a PackageConflictError because protobuf and protobuf-lite are mutually exclusive. I'm only trying to use one of them though, so it seems like that shouldn't have a conflict.

I would like to contribute a fix for this, but I'm not sure what the expected behavior here is. Should this conflict checking code maybe just be removed? When I run pkg-config on a PC running Ubuntu 20.04, it doesn't appear to care about conflicts.

$ pkg-config --cflags --libs protobuf
-pthread -lprotobuf -pthread
$ pkg-config --cflags --libs protobuf protobuf-lite
-pthread -lprotobuf -pthread -lprotobuf-lite -pthread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant