meson.setupHook: build test targets
In Meson 1.7, these will no longer be built by default [1], so because we're running meson test with --no-rebuild, we need to build them before running the test. Doing this in checkPhase makes more sense than in buildPhase, because allows buildPhase to work without test-only dependencies, something we've had to work around in the past by adding options to packages to disable building the tests. The meson-test-prereq target has been available since Meson 0.63.0 according to the documentation, so we can do this ahead of actually upgrading to Meson 1.7.0. Link: https://mesonbuild.com/Release-notes-for-1-7-0.html#test-targets-no-longer-built-by-default [1]
This commit is contained in:
@@ -58,6 +58,14 @@ mesonCheckPhase() {
|
||||
flagsArray+=("--timeout-multiplier=0")
|
||||
fi
|
||||
|
||||
# Parallel building is enabled by default.
|
||||
local buildCores=1
|
||||
if [ "${enableParallelBuilding-1}" ]; then
|
||||
buildCores="$NIX_BUILD_CORES"
|
||||
fi
|
||||
|
||||
TERM=dumb ninja -j"$buildCores" $ninjaFlags "${ninjaFlagsArray[@]}" meson-test-prereq
|
||||
|
||||
echoCmd 'mesonCheckPhase flags' "${flagsArray[@]}"
|
||||
meson test --no-rebuild --print-errorlogs "${flagsArray[@]}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user