pkgconf doesn't preserve quotes #82
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I authored a pc file against pkgconf, then discovered it didn't work with pkg-config:
pkgconf should probably follow pkg-conf's quoting behavior, i.e. it should preserve rather than discard quote marks.
https://github.com/pkgconf/pkgconf/pull/81 is a draft commit to do this.
pkg-conf seems to always convert to backslash escaping, but I doubt that matters... preserving quotes is probably ok?
#81 seems reasonable. I merged it. Thanks!
Alas, I spoke too soon. I assumed pkg-config could handle that, but I didn't test properly.
Turns out that to write a .pc file for a framework with spaces in its name, you have to use backslashes for it to work with pkg-config. (See worked example at http://kegel.com/cmake/spaces-in-framework-names/ )
Next step would be to write some more tests for quoting corner cases that pass on both pkg-config and pkgconf and/or revert the new behavior.
I'm not so sure, I think that the new behavior is desirable, and it's probably a bug in legacy pkg-config too. I think that perhaps they should just implement the same behavior as us here?
@bapt thoughts?
https://bugs.freedesktop.org/show_bug.cgi?id=3571 seemed to indicate legacy pkg-config wanted to support quotes, but they have never really documented the behavior.
If backslashes turn out to suffice in the real world, there's less motivation for the change.
Are there examples where it doesn't work?
The current behaviour seems fine to me, I also think pkg-config should follow our behaviour here
What's their motivation for changing? Is there an unmet need?
well i think having it as a single fragment without escape is better for consumers outside of the pkgconf(1) tool, such as libpkgconf consumers. stuff like rust/cargo will be moving away from pkgconf(1) and consuming libpkgconf directly in this way. so ideally, we want to solve this in a way that makes it easy for all consumers of the modules I suppose.
IMHO forking the .pc format is a dangerous thing to do, and needs to be done very carefully.
I would not have proposed this patch if I had accurately understood the behavior of legacy pkg-config.
That is true, maybe we revert it for now. I believe pkgconf will respect the backslashes for quoting already.
@bapt thoughts?
@kaniini fine with me.