Makefile: Set PKG_CONFIG_PATH env for 'make check'
Phil Sutter
reviewerPATCH 1/1 Makefile: Set PKG_CONFIG_PATH env for 'make check'
When building nftables git HEAD, I use a script which also builds libmnl and libnftnl in their respective repositories and populates PKG_CONFIG_PATH variable so nftables is linked against them instead of host libraries. This is mandatory as host-installed libraries are chronically outdated and linking against them would fail.
Same situation exists with build test suite. Luckily the PKG_CONFIG_PATH variable value used to build the project is cached in Makefiles and Automake supports populating test runners' environment.
---
Pablo: Could you please confirm this does not break your workflow? I recall you relied upon build test suite while it never passed for me due to the reasons described above.
--- Makefile.am | 1 + 1 file changed, 1 insertion(+)
Makefile.am +1 -0
@@ -450,6 +450,7 @@ tools/nftables.service: tools/nftables.service.in ${top_builddir}/config.status endif if !BUILD_DISTCHECK +AM_TESTS_ENVIRONMENT = PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) TESTS = tests/build/run-tests.sh \ tests/json_echo/run-test.py \ tests/monitor/run-tests.sh \
Signature · 1 line
2.51.0
Pablo Neira Ayuso
maintainerQuoted 5 lines · Phil Sutter
When building nftables git HEAD, I use a script which also builds libmnl and libnftnl in their respective repositories and populates
PKG_CONFIG_PATHvariable so nftables is linked against them instead of host libraries. This is mandatory as host-installed libraries are chronically outdated and linking against them would fail.
How do you use this?
Quoted 9 lines
Same situation exists with build test suite. Luckily the
PKG_CONFIG_PATHvariable value used to build the project is cached in Makefiles and Automake supports populating test runners' environment.Signed-off-by Phil Sutter <[email protected]>---
Pablo: Could you please confirm this does not break your workflow? I recall you relied upon build test suite while it never passed for me due to the reasons described above.
Just run `make distcheck' or tests/build/ to check, I think that should be enough.
Quoted 19 lines
--- Makefile.am | 1 + 1 file changed, 1 insertion(+)Makefile.am +1
-0@@ -450,6 +450,7 @@ tools/nftables.service: tools/nftables.service.in ${top_builddir}/config.status endif if !BUILD_DISTCHECK +AM_TESTS_ENVIRONMENT = PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) TESTS = tests/build/run-tests.sh \ tests/json_echo/run-test.py \ tests/monitor/run-tests.sh \Signature · 1 line
2.51.0
Phil Sutter
reviewerQuoted 8 lines · Pablo Neira Ayuso
Quoted 5 lines · Phil Sutter
When building nftables git HEAD, I use a script which also builds libmnl and libnftnl in their respective repositories and populates
PKG_CONFIG_PATHvariable so nftables is linked against them instead of host libraries. This is mandatory as host-installed libraries are chronically outdated and linking against them would fail.How do you use this?
Please kindly find aforementioned build script attached to this mail. Then I just call 'make check' in the built nftables source tree.
This patch's logic is: "If a custom PKG_CONFIG_PATH was needed to build the sources, it is needed for build test suite as well."
Quoted 4 lines
Quoted 4 lines
Same situation exists with build test suite. Luckily the
PKG_CONFIG_PATHvariable value used to build the project is cached in Makefiles and Automake supports populating test runners' environment.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Phil Sutter <[email protected]>---
Pablo: Could you please confirm this does not break your workflow? I recall you relied upon build test suite while it never passed for me due to the reasons described above.Just run `make distcheck' or tests/build/ to check, I think that should be enough.
Well, 'make distcheck' should not be affected by this patch since it does not run the test suites (df19bf51d49be ("Makefile: Enable support for 'make check'")).
But you have a point there, the logic from above applies to the VPATH build performed by 'make distcheck', too. I'll respin with added chunk:
| --- a/Makefile.am | +++ b/Makefile.am | @@ -23,7 +23,8 @@ libnftables_LIBVERSION = 2:0:1 | ############################################################################### | | ACLOCAL_AMFLAGS = -I m4 | -AM_DISTCHECK_CONFIGURE_FLAGS = --enable-distcheck | +AM_DISTCHECK_CONFIGURE_FLAGS = --enable-distcheck \ | + PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) | | EXTRA_DIST = | BUILT_SOURCES =
Thanks, Phil
Phil Sutter
reviewerQuoted 8 lines · Phil Sutter
Quoted 7 lines · Pablo Neira Ayuso
Quoted 5 lines · Phil Sutter
When building nftables git HEAD, I use a script which also builds libmnl and libnftnl in their respective repositories and populates
PKG_CONFIG_PATHvariable so nftables is linked against them instead of host libraries. This is mandatory as host-installed libraries are chronically outdated and linking against them would fail.
Quoted 4 lines
Quoted 1 line
How do you use this?
Please kindly find aforementioned build script attached to this mail. Then I just call 'make check' in the built nftables source tree.
Gna. Attached now.
Quoted 37 lines
This patch's logic is: "If a custom
PKG_CONFIG_PATHwas needed to build the sources, it is needed for build test suite as well."Quoted 4 lines
Quoted 4 lines
Same situation exists with build test suite. Luckily the
PKG_CONFIG_PATHvariable value used to build the project is cached in Makefiles and Automake supports populating test runners' environment.Quoted 8 lines
Quoted 5 lines
Signed-off-by Phil Sutter <[email protected]>---
Pablo: Could you please confirm this does not break your workflow? I recall you relied upon build test suite while it never passed for me due to the reasons described above.Just run `make distcheck' or tests/build/ to check, I think that should be enough.
Well, 'make distcheck' should not be affected by this patch since it does not run the test suites (
df19bf51d49be("Makefile: Enable support for 'make check'")).But you have a point there, the logic from above applies to the VPATH build performed by 'make distcheck', too. I'll respin with added chunk:
| --- a/Makefile.am | +++ b/Makefile.am | @@ -23,7 +23,8 @@ libnftables_LIBVERSION = 2:0:1 | ############################################################################### | | ACLOCAL_AMFLAGS = -I m4 | -AM_DISTCHECK_CONFIGURE_FLAGS = --enable-distcheck | +AM_DISTCHECK_CONFIGURE_FLAGS = --enable-distcheck \ | + PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) | | EXTRA_DIST = | BUILT_SOURCES =Thanks, Phil