]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use files in run_command with relativized path
authorEli Schwartz <eschwartz93@gmail.com>
Wed, 27 Jul 2022 01:09:07 +0000 (21:09 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 30 Jul 2022 04:58:22 +0000 (13:58 +0900)
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.

src/basic/meson.build

index 84576efd897061af409ecd1db867af3fbeb85903..19d3395a49fbaa1c4d51e1228b3fb39a94c74070 100644 (file)
@@ -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()