CI: fix meson tarball testing with old meson version

The test "tarball+meson" fails on systems with old meson version with
the message "ERROR: Neither directory contains a build file
meson.build". This message is raised when calling `meson dist` from the
build directory.

According to meson documentation, `meson dist` is supported since 0.52,
and older vesions need to execute `ninja dist`.
https://mesonbuild.com/Creating-releases.html

Also, when using meson.add_dist_script, the env variable MESON_SOURCE_ROOT
is not passed in versions < 0.54. As we don't use it in the script,
don't assert for it.

We claim to support down to meson 0.47.3 (we need to raise it because we
are actually using a bit newer features, but that's another topic). Use
`ninja dist` that will work fine on old and new meson.

Fixes: 61f0531509 ('gitlab-ci: test re-buildability of distribution tarballs')
This commit is contained in:
Íñigo Huguet
2024-03-26 15:57:37 +01:00
parent 723ad4c0ad
commit 67eb8c5c2b
2 changed files with 2 additions and 3 deletions

View File

@@ -149,8 +149,8 @@ fi
if check_run_clean tarball+meson; then
BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
pushd ./build
# dist with meson
meson dist
# dist with meson/ninja
ninja dist
# build with autotools
DISTSRC="./distsrc-$RANDOM"

View File

@@ -21,7 +21,6 @@ fi
ensure_var_path "MESON_DIST_ROOT"
ensure_var_path "MESON_BUILD_ROOT"
ensure_var_path "MESON_SOURCE_ROOT"
ninja -C "$MESON_BUILD_ROOT" all libnm-doc NetworkManager-doc