]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: fix broken boolean kwarg 24154/head
authorEli Schwartz <eschwartz93@gmail.com>
Wed, 27 Jul 2022 01:49:48 +0000 (21:49 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 30 Jul 2022 04:58:22 +0000 (13:58 +0900)
Everywhere else that `conf.get('ENABLE_*')` is used as a boolean key for
something (for example in if statements) it always checks if == 1, but
in this one case it neglects to do so. This is important because
conf.get yields the same int that was stored, but if statements require
booleans.

So does executable's "install" kwarg, at least according to the
documentation. In actuality, it accepts all types without sanity
checking, then uses python "if bool(var)", so you can actually do
`install: 'do not'` and that's treated identical to `true`. This is a
type-checking bug which Meson will eventually fix.

muon fails on the same code, today.

meson.build

index 2189abddc77246c4db7fca36bbe34db9bc721a6a..6bbb2db55d14d4028398a0169912c3c54f72f48c 100644 (file)
@@ -2229,7 +2229,7 @@ exe = executable(
         dependencies : [versiondep,
                         libseccomp],
         install_rpath : rootpkglibdir,
-        install : conf.get('ENABLE_ANALYZE'))
+        install : conf.get('ENABLE_ANALYZE') == 1)
 public_programs += exe
 
 if want_tests != 'false'