]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4450] Hammer: use abs path for meson install
authorTomek Sawka <tsawka@isc.org>
Sun, 3 May 2026 15:29:35 +0000 (15:29 +0000)
committerTomek Sawka <tsawka@isc.org>
Tue, 5 May 2026 18:01:13 +0000 (20:01 +0200)
hammer.py

index 4e32ec2e152f68cfaf29cd9f8a0c0d6772fa7325..c86ce499c819b550c6f1369ce5a2f5977e95834e 100755 (executable)
--- a/hammer.py
+++ b/hammer.py
@@ -2435,7 +2435,16 @@ def _build_binaries_and_run_ut(system, revision, features, tarball_paths, env, c
         aggr.write('aggregated_tests.xml')
 
     if 'install' in features:
-        execute('sudo meson install -C build', timeout=2 * 60,
+
+        # Try to use full path for meson install due to some distros (i.e. rocky)
+        # do not have /usr/local/bin in secure_path. As result 'meson' is not found with sudo.
+        res, meson_cmd = execute('command -v meson', capture=True, quiet=True, raise_error=False)
+        if res != 0:
+            meson_cmd = 'meson'
+        else:
+            meson_cmd = meson_cmd.rstrip()
+
+        execute(f'sudo {meson_cmd} install -C build', timeout=2 * 60,
                 cwd=src_path, env=env, check_times=check_times, dry_run=dry_run)
         if system != 'alpine':
             execute('sudo ldconfig', dry_run=dry_run, env=env)