Would be great to have a way to validate a give .pc file to make make sure everything is up to snuff. pkg-config already catches some errorsin the course of its other modes, but it would be useful for authors to be able to check "is this file syntactically correct?" before distributing it. Also, lots of packages distribute a .pc.in and construct the .pc on-the-fly, so validating the result would protect against bugs in the template replacement definitions. Already there are some warnings if there are missing essential fields and if a ${foo} but no definition of foo. But it doesn't catch illegal variable names (foo-libs, for example). And using parens instead of curly-braces is apparently an easy mistake to make, so should warn about that. foo-libs
Daniel Macks Do you still experience this issue with newer drivers ? Please check the status of your issue.
I am using the latest drivers and other system software. But since the issue is not even remotely related to any hardware or involving interfacing to other systems, I'm not sure why that would affect this RFE?
I think --validate would be easy enough to do. Basically, --exists with Requires processing turned off. pkg-config does a full parse when it collects the package into its database. However, there's also the part where the parser would need to be beefed up to detect illegal things. I'll take a look at it.
Created attachment 79462 [details] [review] Add --validate option to check .pc syntax without dependencies Provide developers a way to check their .pc files prior to release. This works the same as --exists except that package dependencies are not processed. That allows the .pc file to be checked in complete isolation of others. Freedesktop #7000 (https://bugs.freedesktop.org/show_bug.cgi?id=7000) Can you try this patch and see if it's what you're looking for?
Sorry I've been away from this for so long! The proposed patch from Comment #4 works well for me against 0.28 (adjusting as necessary so it applies cleanly). And with it, authors could avoid installing files that trigger Bug #76791
And now it's my time to apologize for being slow! Applied in 0e847a2.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.