Skip to content

Commit

Permalink
Make a copy of auto_features options when changing its name
Browse files Browse the repository at this point in the history
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
    ...
```
  • Loading branch information
xclaesse authored and eli-schwartz committed May 26, 2022
1 parent a6df51a commit 9b91540
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mesonbuild/interpreter/interpreterobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def __init__(self, option: coredata.UserFeatureOption, interpreter: 'Interpreter
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,
Expand Down

0 comments on commit 9b91540

Please sign in to comment.