mirror of
https://github.com/mesonbuild/meson.git
synced 2026-11-06 05:16:42 +00:00
interpreter: avoid that add_languages_for modifies its arguments
The list can be reused in the next call to add_languages:
success = len(langs) == len(args[0])
success &= self.add_languages(langs, required, MachineChoice.HOST)
success &= self.add_languages(langs, False, MachineChoice.BUILD)
Fixes: 17eb224aa
Fixes: aee7f375b
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
1 parent
5e0f6e9865
commit
3797fba8c4
1 file changed
+8
-4
@@ -1618,10 +1618,14 @@ class Interpreter(InterpreterBase, HoldableObject):
|
||||
langs.update(args)
|
||||
|
||||
# Some languages are added only as implementation details of other
|
||||
# languages. When that happens, we don't want to add those languages to
|
||||
# the project enabled languages, as they are implementation details, not
|
||||
# something the user explicitly asked for, and we don't want to be
|
||||
# forced to keep them forever if the implementation changes.
|
||||
# languages. When that happens, args is modified in place, so make
|
||||
# a copy.
|
||||
args = list(args)
|
||||
|
||||
# We don't want to add those languages to the project enabled languages,
|
||||
# as they are implementation details, not something the user explicitly
|
||||
# asked for, and we don't want to be forced to keep them forever
|
||||
# if the implementation changes.
|
||||
internal: T.Set[Language] = set()
|
||||
|
||||
if 'vala' in langs and 'c' not in langs:
|
||||
|
||||
Reference in new issue
Block a user