aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-05-25 09:33:17 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-05-25 22:52:30 -0400
commit9b9154017e9edc7b5b3bd93dce74ffa9c8b22a03 (patch)
tree376c4dadeae353dea901e6c87252968eb6a84e12 /mesonbuild/interpreter
parenta6df51aa8c2031aff181a2ad5bc5f0f5b60a44bb (diff)
downloadmeson-9b9154017e9edc7b5b3bd93dce74ffa9c8b22a03.zip
meson-9b9154017e9edc7b5b3bd93dce74ffa9c8b22a03.tar.gz
meson-9b9154017e9edc7b5b3bd93dce74ffa9c8b22a03.tar.bz2
Make a copy of auto_features options when changing its name
This fixes bogus messages "skipped: feature foo disabled" when auto_features=disabled. It was reporting the name of the latest get_option() call instead of the name of the current feature option. This is especially visible in GStreamer summary where it should show a different option name for every subproject but instead shows "tools" everywhere: ``` Subprojects gst-devtools : NO Feature 'tools' disabled gst-editing-services : NO Feature 'tools' disabled ... ```
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreterobjects.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index e59ba6b..9628953 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -88,7 +88,8 @@ class FeatureOptionHolder(ObjectHolder[coredata.UserFeatureOption]):
super().__init__(option, interpreter)
if option and option.is_auto():
# TODO: we need to cast here because options is not a TypedDict
- self.held_object = T.cast('coredata.UserFeatureOption', self.env.coredata.options[OptionKey('auto_features')])
+ auto = T.cast('coredata.UserFeatureOption', self.env.coredata.options[OptionKey('auto_features')])
+ self.held_object = copy.copy(auto)
self.held_object.name = option.name
self.methods.update({'enabled': self.enabled_method,
'disabled': self.disabled_method,