diff options
| author | Eli Schwartz <eschwartz93@gmail.com> | 2023-11-12 12:19:58 -0500 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-11-12 20:39:49 +0200 |
| commit | 76e6340f4bd5ee0d3dffaa84c5cdd10fbee61f7f (patch) | |
| tree | 9788014bed501e3ae87249937b6bc55547a25c75 | |
| parent | 97dc8801a691b0712b59d283416727c3f84b1115 (diff) | |
| download | meson-76e6340f4bd5ee0d3dffaa84c5cdd10fbee61f7f.tar.gz | |
fix regression in converting build_target kwargs to typed_kwargs
We haven't actually verified that these kwargs are equal to what we had
before, and should probably revert the entire series. But I have
multiple reports in the wild of projects that no longer build because of
`install: [true, false, get_option('foobar')]` which was always
incorrect and always equal to just dropping values all over the floor
and treating it the same as "bool(value) == True".
Special case this particular typed kwarg and allow it with a sternly
worded warning that it was always wrong and should never ever ever be
done.
Fixes: https://bugs.gentoo.org/917118
Fixes: http://qa-logs.debian.net/2023/11/11/rhythmbox_3.4.7-1_unstable_meson-exp.log
Thanks to the Gentoo Tinderbox project, and Lucas Nussbaum of the Debian
project.
| -rw-r--r-- | mesonbuild/interpreter/interpreter.py | 7 | ||||
| -rw-r--r-- | mesonbuild/interpreter/type_checking.py | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 2fba33486..e885010b2 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -3318,6 +3318,13 @@ class Interpreter(InterpreterBase, HoldableObject): # backwards compatibility anyway sources = [s for s in sources if not isinstance(s, (build.BuildTarget, build.ExtractedObjects))] + + # due to lack of type checking, these are "allowed" for legacy reasons + if not isinstance(kwargs['install'], bool): + FeatureBroken.single_use('install kwarg with non-boolean value', '1.3.0', self.subproject, + 'This was never intended to work, and is essentially the same as using `install: true` regardless of value.', + node) + sources = self.source_strings_to_files(sources) objs = kwargs['objects'] kwargs['dependencies'] = extract_as_list(kwargs, 'dependencies') diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index e7edc1939..06ded7298 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -573,7 +573,8 @@ _ALL_TARGET_KWS: T.List[KwargInfo] = [ OVERRIDE_OPTIONS_KW, KwargInfo('build_by_default', bool, default=True, since='0.38.0'), KwargInfo('extra_files', ContainerTypeInfo(list, (str, File)), default=[], listify=True), - INSTALL_KW, + # Accursed. We allow this for backwards compat and warn in the interpreter. + KwargInfo('install', object, default=False), INSTALL_MODE_KW, KwargInfo('implicit_include_directories', bool, default=True, since='0.42.0'), NATIVE_KW, |
