waf incompatibility #24

Closed
opened 2012-07-20 02:51:19 +00:00 by rofl0r · 13 comments
rofl0r commented 2012-07-20 02:51:19 +00:00 (Migrated from github.com)

this one is real...

/bin/pkg-config glib-2.0 --cflags --libs
Package --cflags was not found in the pkg-config search path.
Perhaps you should add the directory containing `--cflags.pc'
to the PKG_CONFIG_PATH environment variable
No package '--cflags' found

this is xmms2 0.8
apparently pkgconf expects the -- params first, which seems to be incompatible to pkg-config

this one is real... /bin/pkg-config glib-2.0 --cflags --libs Package --cflags was not found in the pkg-config search path. Perhaps you should add the directory containing `--cflags.pc' to the PKG_CONFIG_PATH environment variable No package '--cflags' found this is xmms2 0.8 apparently pkgconf expects the -- params first, which seems to be incompatible to pkg-config

yes, it's because we use getopt_long().

if you want to work on improving this, it would be helpful. otherwise i'll try to get it done as soon as i have some free time. (probably not this weekend, as i have some projects i need to get finished up at work and they don't sponsor development on pkgconf).

yes, it's because we use getopt_long(). if you want to work on improving this, it would be helpful. otherwise i'll try to get it done as soon as i have some free time. (probably not this weekend, as i have some projects i need to get finished up at work and they don't sponsor development on pkgconf).

to be fair, waf is using pkg-config in a way that does not match the documentation though. so it's invoking undefined behaviour, per the specification.

to be fair, waf is using pkg-config in a way that does not match the documentation though. so it's invoking undefined behaviour, per the specification.

Also, I can't reproduce this:

$ ./pkgconf glib-2.0 --cflags --libs
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0 -lintl
Also, I can't reproduce this: ``` $ ./pkgconf glib-2.0 --cflags --libs -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0 -lintl ```
rofl0r commented 2012-07-20 15:14:39 +00:00 (Migrated from github.com)

i'm using the latest release plus pkgconf is symlinked as pkg-config

root:/src/build$ /bin/pkg-config glib-2.0 --cflags --libs
Package --cflags was not found in the pkg-config search path.
Perhaps you should add the directory containing `--cflags.pc'
to the PKG_CONFIG_PATH environment variable
No package '--cflags' found
root:/src/build$ 
i'm using the latest release plus pkgconf is symlinked as pkg-config ``` root:/src/build$ /bin/pkg-config glib-2.0 --cflags --libs Package --cflags was not found in the pkg-config search path. Perhaps you should add the directory containing `--cflags.pc' to the PKG_CONFIG_PATH environment variable No package '--cflags' found root:/src/build$ ```
rofl0r commented 2012-07-20 15:16:56 +00:00 (Migrated from github.com)

to be fair, waf is using pkg-config in a way that does not match the documentation though. so it's invoking undefined behaviour, per the specification.

well does that matter ? apparently it works with pkg-config. a good emulator has to be bug compatible to the original to play all roms...

> to be fair, waf is using pkg-config in a way that does not match the documentation though. so it's invoking undefined behaviour, per the specification. well does that matter ? apparently it works with pkg-config. a good emulator has to be bug compatible to the original to play all roms...
rofl0r commented 2012-07-20 15:23:59 +00:00 (Migrated from github.com)

one thing to note is that i use musl libc which behaves like POSIX specifies, but not like glibc.

one thing to note is that i use musl libc which behaves like POSIX specifies, but not like glibc.

I also cannot reproduce on uClibc or FreeBSD.

I also cannot reproduce on uClibc or FreeBSD.

Does 'make check' actually pass on musl? There are already tests that depend on the behaviour of commandline flags being passed after a pkg_t entity.

Does 'make check' actually pass on musl? There are already tests that depend on the behaviour of commandline flags being passed after a pkg_t entity.

@rofl0r please test on musl libc, your 'make check' should look like this:

ciaranis:~/dev-src/pkgconf$ make check
CompileExe: main.o
CompileExe: pkg.o
CompileExe: bsdstubs.o
CompileExe: getopt_long.o
CompileExe: fragment.o
CompileExe: argvsplit.o
CompileExe: fileio.o
CompileExe: tuple.o
CompileExe: dependency.o
Link: pkgconf
$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs foo
-L/usr/lib -lfoo 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --cflags --libs foo
-fPIC -I/usr/include/foo -L/usr/lib -lfoo 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exists 'foo > 1.2'; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exists 'foo > 1.2.3'; echo $?
Package dependency requirement 'foo > 1.2.3' could not be satisfied.
Package 'foo' has version '1.2.3', required version is '> 1.2.3'
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exists 'foo' '>' '1.2'; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --uninstalled 'foo'; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --uninstalled 'omg'; echo $?
0
+ [OK]

$ ./pkgconf /home/nenolod/dev-src/pkgconf/tests/lib1/foo.pc --modversion
1.2.3
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1:/home/nenolod/dev-src/pkgconf/tests/lib2 ./pkgconf --libs foo
-L/usr/lib -lfoo 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib2:/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs foo
-L/usr/lib -lbar 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs bar
-L/usr/lib -lfoo -lbar 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs --cflags baz
-fPIC -I/usr/include/foo -L/usr/lib -lbaz 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --static --libs baz
-L/usr/lib -lfoo -lbaz -lzee 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs dos-lineendings
-L/usr/lib/dos-lineendings -ldos-lineendings 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs argv-parse
-llib-3 -llib-1 -llib-2 -lpthread 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --variable=includedir foo
/usr/include
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --modversion pkg-config
0.26
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --variable=prefix foo
/usr
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --define-variable=prefix=/test --variable=prefix foo
/test
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 PKG_CONFIG_SYSROOT_DIR=/test ./pkgconf --cflags baz
-fPIC -I/test/usr/include/foo 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs conflicts; echo $?
Version '1.2.3' of 'foo' conflicts with 'conflicts' due to satisfying conflict rule 'foo <= 1.3'.
It may be possible to ignore this conflict and continue, try the
PKG_CONFIG_IGNORE_CONFLICTS environment variable.
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --ignore-conflicts --libs conflicts; echo $?
-L/usr/lib -lconflicts 
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 1.0 foo; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 2.0 foo; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.0 foo; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.2.3 foo; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 1.0 foo; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 2.0 foo; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 1.0 'foo '; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 2.0 'foo '; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.0 'foo '; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.2.3 'foo '; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 1.0 'foo '; echo $?
1
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 2.0 'foo '; echo $?
0
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf foo --libs
-L/usr/lib -lfoo 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf foo --cflags --libs
-fPIC -I/usr/include/foo -L/usr/lib -lfoo 
+ [OK]

$ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --cflags foo --libs
-fPIC -I/usr/include/foo -L/usr/lib -lfoo 
+ [OK]

37 tests done. All succeeded.
ciaranis:~/dev-src/pkgconf$ 

This is on a uClibc system, using the built-in getopt_long() of pkgconf which we now just use all the time. All 37 tests should pass.

@rofl0r please test on musl libc, your 'make check' should look like this: ``` ciaranis:~/dev-src/pkgconf$ make check CompileExe: main.o CompileExe: pkg.o CompileExe: bsdstubs.o CompileExe: getopt_long.o CompileExe: fragment.o CompileExe: argvsplit.o CompileExe: fileio.o CompileExe: tuple.o CompileExe: dependency.o Link: pkgconf $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs foo -L/usr/lib -lfoo + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --cflags --libs foo -fPIC -I/usr/include/foo -L/usr/lib -lfoo + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exists 'foo > 1.2'; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exists 'foo > 1.2.3'; echo $? Package dependency requirement 'foo > 1.2.3' could not be satisfied. Package 'foo' has version '1.2.3', required version is '> 1.2.3' 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exists 'foo' '>' '1.2'; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --uninstalled 'foo'; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --uninstalled 'omg'; echo $? 0 + [OK] $ ./pkgconf /home/nenolod/dev-src/pkgconf/tests/lib1/foo.pc --modversion 1.2.3 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1:/home/nenolod/dev-src/pkgconf/tests/lib2 ./pkgconf --libs foo -L/usr/lib -lfoo + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib2:/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs foo -L/usr/lib -lbar + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs bar -L/usr/lib -lfoo -lbar + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs --cflags baz -fPIC -I/usr/include/foo -L/usr/lib -lbaz + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --static --libs baz -L/usr/lib -lfoo -lbaz -lzee + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs dos-lineendings -L/usr/lib/dos-lineendings -ldos-lineendings + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs argv-parse -llib-3 -llib-1 -llib-2 -lpthread + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --variable=includedir foo /usr/include + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --modversion pkg-config 0.26 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --variable=prefix foo /usr + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --define-variable=prefix=/test --variable=prefix foo /test + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 PKG_CONFIG_SYSROOT_DIR=/test ./pkgconf --cflags baz -fPIC -I/test/usr/include/foo + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --libs conflicts; echo $? Version '1.2.3' of 'foo' conflicts with 'conflicts' due to satisfying conflict rule 'foo <= 1.3'. It may be possible to ignore this conflict and continue, try the PKG_CONFIG_IGNORE_CONFLICTS environment variable. 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --ignore-conflicts --libs conflicts; echo $? -L/usr/lib -lconflicts 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 1.0 foo; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 2.0 foo; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.0 foo; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.2.3 foo; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 1.0 foo; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 2.0 foo; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 1.0 'foo '; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --atleast-version 2.0 'foo '; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.0 'foo '; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --exact-version 1.2.3 'foo '; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 1.0 'foo '; echo $? 1 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --max-version 2.0 'foo '; echo $? 0 + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf foo --libs -L/usr/lib -lfoo + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf foo --cflags --libs -fPIC -I/usr/include/foo -L/usr/lib -lfoo + [OK] $ PKG_CONFIG_PATH=/home/nenolod/dev-src/pkgconf/tests/lib1 ./pkgconf --cflags foo --libs -fPIC -I/usr/include/foo -L/usr/lib -lfoo + [OK] 37 tests done. All succeeded. ciaranis:~/dev-src/pkgconf$ ``` This is on a uClibc system, using the built-in getopt_long() of pkgconf which we now just use all the time. All 37 tests should pass.
rofl0r commented 2012-07-20 20:53:27 +00:00 (Migrated from github.com)

http://sprunge.us/CWBj

according to dalias:
getopt_long on musl does not do argument permutation. otherwise i think it's pretty close to glibc's

http://sprunge.us/CWBj according to dalias: getopt_long on musl does not do argument permutation. otherwise i think it's pretty close to glibc's

Yes, then my change will fix it. The pkg_getopt_long() function does do argument permutation, which we just now use explicitly. Please verify by using GIT head.

Yes, then my change will fix it. The pkg_getopt_long() function does do argument permutation, which we just now use explicitly. Please verify by using GIT head.
rofl0r commented 2012-07-20 21:25:50 +00:00 (Migrated from github.com)

took a while to get automake and co installed so i can use ./autogen...

git head breaks with this error

getopt_long.h:38:23: fatal error: sys/cdefs.h: No such file or directory
took a while to get automake and co installed so i can use ./autogen... git head breaks with this error ``` getopt_long.h:38:23: fatal error: sys/cdefs.h: No such file or directory ```
rofl0r commented 2012-07-20 22:17:52 +00:00 (Migrated from github.com)

for reference, here is the commit which (hopefully) fixes waf
http://code.google.com/p/waf/source/detail?r=070669067aaaa0b98c0ec8e7963b5286bced57a2

for reference, here is the commit which (hopefully) fixes waf http://code.google.com/p/waf/source/detail?r=070669067aaaa0b98c0ec8e7963b5286bced57a2
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 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#24
There is no content yet.