Quoting of Libs: is broken on MSYS2 when prefix has spaces #238

Open
opened 2021-11-15 18:48:27 +00:00 by nirbheek · 2 comments
nirbheek commented 2021-11-15 18:48:27 +00:00 (Migrated from github.com)

System: MSYS2-MinGW64 (latest)

$ pkgconf --version
1.8.0

How to reproduce:

$ mkdir pcfiles/
$ cd pcfiles/
$ cat > libfoo.pc <<<"prefix=/usr/with\ spaces
libdir=${prefix}/lib
includedir=${prefix}/include

foo=bar
datadir=${prefix}/data

Name: libfoo
Description: A foo library.
Version: 1.0
Requires: libanswer
Libs: -L${libdir} -lfoo
Cflags: -I${includedir} -DLIBFOO
"
$ cat > libanswer.pc <<<"prefix=/usr/with\ spaces
libdir=${prefix}/lib
includedir=${prefix}/include

Name: libanswer
Description: An answer library.
Version: undefined
Libs: -L${libdir} -lanswer
Cflags: -I${includedir} -DLIBFOO
"
$ export PKG_CONFIG_PATH=$PWD
$ pkgconf --libs libfoo
-L/usr/with\ -lfoo spaces/lib -lanswer
# This should be -L/usr/with\ spaces/lib -lanswer -lfoo
System: MSYS2-MinGW64 (latest) ```sh $ pkgconf --version 1.8.0 ``` How to reproduce: ```sh $ mkdir pcfiles/ $ cd pcfiles/ $ cat > libfoo.pc <<<"prefix=/usr/with\ spaces libdir=${prefix}/lib includedir=${prefix}/include foo=bar datadir=${prefix}/data Name: libfoo Description: A foo library. Version: 1.0 Requires: libanswer Libs: -L${libdir} -lfoo Cflags: -I${includedir} -DLIBFOO " $ cat > libanswer.pc <<<"prefix=/usr/with\ spaces libdir=${prefix}/lib includedir=${prefix}/include Name: libanswer Description: An answer library. Version: undefined Libs: -L${libdir} -lanswer Cflags: -I${includedir} -DLIBFOO " $ export PKG_CONFIG_PATH=$PWD $ pkgconf --libs libfoo -L/usr/with\ -lfoo spaces/lib -lanswer # This should be -L/usr/with\ spaces/lib -lanswer -lfoo ```
nirbheek commented 2021-11-15 18:49:34 +00:00 (Migrated from github.com)

Forgot to mention: this doesn't happen with pkgconf --libs libanswer, so it's some interaction with the Requires: line.

Forgot to mention: this doesn't happen with `pkgconf --libs libanswer`, so it's some interaction with the `Requires:` line.

This bug gets even more awesome if you have something like this:

pkgconf --cflags
-IC:/path/to\ somewhere -Dfoo

and then call `pkgconf --cflags-only-I

-Ic:/path/to\

So I guess I'm going to look into this...

This bug gets even more awesome if you have something like this: ``` pkgconf --cflags -IC:/path/to\ somewhere -Dfoo ``` and then call `pkgconf --cflags-only-I ``` -Ic:/path/to\ ``` So I guess I'm going to look into this...
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#238
There is no content yet.