-
Notifications
You must be signed in to change notification settings - Fork 409
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
Configurator: pkg-config plugin uses pkgconf and --personality=TARGET by default #10937
Changes from all commits
90202ee
c29795b
22d2e26
4c1135e
32a403d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Configurator uses `pkgconf` as pkg-config implementation when available | ||
and forwards it the `target` of `ocamlc -config`. (#10937, @pirbo) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
These tests show that setting `PKG_CONFIG_ARGN` passes extra args to `pkg-config` | ||
|
||
$ dune build 2>&1 | awk '/run:.*bin\/pkg-config/{a=1}/stderr/{a=0}a' | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkg-config --print-errors dummy-pkg | ||
$ dune build 2>&1 | awk '/run:.*bin\/pkgconf/{a=1}/stderr/{a=0}a' | sed s/$(ocamlc -config | sed -n "/^target:/ {s/target: //; p; }")/\$TARGET/g | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this rather be added to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check some of the other tests for how that's done. It feels a bit cleaner to me to do it that way There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How ? Please help! :-)
the outcome keeps being
|
||
run: $TESTCASE_ROOT/_build/default/.bin/pkgconf --print-errors dummy-pkg | ||
-> process exited with code 0 | ||
-> stdout: | ||
| dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkg-config --cflags dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkgconf --personality $TARGET --cflags dummy-pkg | ||
-> process exited with code 0 | ||
-> stdout: | ||
| --personality | ||
| $TARGET | ||
| --cflags | ||
| dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkg-config --libs dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkgconf --personality $TARGET --libs dummy-pkg | ||
-> process exited with code 0 | ||
-> stdout: | ||
| --personality | ||
| $TARGET | ||
| --libs | ||
| dummy-pkg | ||
|
||
$ dune clean | ||
$ PKG_CONFIG_ARGN="--static" dune build 2>&1 | awk '/run:.*bin\/pkg-config/{a=1}/stderr/{a=0}a' | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkg-config --print-errors dummy-pkg | ||
$ PKG_CONFIG_ARGN="--static" dune build 2>&1 | awk '/run:.*bin\/pkgconf/{a=1}/stderr/{a=0}a' | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkgconf --print-errors dummy-pkg | ||
-> process exited with code 0 | ||
-> stdout: | ||
| dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkg-config --static --cflags dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkgconf --static --cflags dummy-pkg | ||
-> process exited with code 0 | ||
-> stdout: | ||
| --static--cflags | ||
| --static | ||
| --cflags | ||
| dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkg-config --static --libs dummy-pkg | ||
run: $TESTCASE_ROOT/_build/default/.bin/pkgconf --static --libs dummy-pkg | ||
-> process exited with code 0 | ||
-> stdout: | ||
| --static--libs | ||
| --static | ||
| --libs | ||
| dummy-pkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if both dummy
pkg_config
andpkgconf
were both built to be able to demonstrate the fallback behavior in tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it some thought even before your remark and that fallback is subtle to demonstrate as it requires to remove the
pkgconf
you have on your system from your PATH else it is favored over the localpkg-config
...If you figure out a way, I can implement it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point, there is no elegant solution to remove thing from the PATH. That said:
It is a bit of a hassle but you could in the test adjust
PATH
to only contain a directory you created that contains symlinks to the binaries you expect (e.g. iterate over thePATH
that the tests starts with, symlink everything butpkgconf
to make sure it still works ifpkgconf
/pkg-config
calls other binaries) and then use that filtered directory as solePATH
for the rest of the test.