From: Eli Schwartz Date: Wed, 27 Jul 2022 01:09:07 +0000 (-0400) Subject: meson: use files in run_command with relativized path X-Git-Tag: v252-rc1~559^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c8892828c0970bb51639923e5b3483c7707e9ca;p=thirdparty%2Fsystemd.git meson: use files in run_command with relativized path Passing a file as a command argument in string form assumes that run_command has the current subdir as its cwd, but Meson's documentation *explicitly* calls this out as undefined and wrong to use. Indeed, muon has a different implementation that uses a different cwd, and this argument cannot be found. Instead, passing a files() object means that it's the job of meson itself to verify the file exists, then pass it to the run_command in some format that guarantees it is a valid path reference. --- diff --git a/src/basic/meson.build b/src/basic/meson.build index 84576efd897..19d3395a49f 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -385,7 +385,7 @@ filesystem_includes = ['linux/magic.h', 'linux/gfs2_ondisk.h'] check_filesystems = find_program('check-filesystems.sh') -r = run_command([check_filesystems, cpp, 'filesystems-gperf.gperf'] + filesystem_includes, check: false) +r = run_command([check_filesystems, cpp, files('filesystems-gperf.gperf')] + filesystem_includes, check: false) if r.returncode() != 0 error('found unknown filesystem(s) defined in kernel headers:\n\n' + r.stdout()) r.stdout()