Skip to content

interpreter: remove use of UserFeatureOption#15626

Open
bonzini wants to merge 3 commits intomesonbuild:masterfrom
bonzini:interpreter-no-option
Open

interpreter: remove use of UserFeatureOption#15626
bonzini wants to merge 3 commits intomesonbuild:masterfrom
bonzini:interpreter-no-option

Conversation

@bonzini
Copy link
Contributor

@bonzini bonzini commented Mar 16, 2026

Introduce a dataclass to wrap the result of get_option() for features. This removes a layering violation, where UserFeatureOptions are created outside options.py just to apply modifiers like disable_if().

It's also a tiny first step towards removing the value from option objects and possibly towards fixing #2193.

Signed-off-by: Paolo Bonzini pbonzini@redhat.com

@bonzini bonzini added refactoring No behavior changes options Meson configuration options labels Mar 16, 2026
@bonzini bonzini added this to the 1.12 milestone Mar 16, 2026
@bonzini bonzini changed the title Interpreter no option interpreter: remove use of UserFeatureOption Mar 16, 2026
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini bonzini force-pushed the interpreter-no-option branch from b43409a to 82970bf Compare March 16, 2026 10:13
bonzini added 2 commits March 16, 2026 13:42
Introduce a dataclass to wrap the result of get_option() for features.
This removes a layering violation, where UserFeatureOptions are created
outside options.py just to apply modifiers like disable_if().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
There is no need anymore to perform copies, or to check for None held_object.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini bonzini force-pushed the interpreter-no-option branch from 82970bf to 599a166 Compare March 16, 2026 12:43


@dataclass
class FeatureObject(HoldableObject):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a naming convention for holdable objects I haven't been able to figure it out. What about naming this class simply Feature? It would make some user visible error messages maybe a bit nicer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going by the header of https://mesonbuild.com/Reference-manual_returned_feature.html, but yeah Feature would be nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

options Meson configuration options refactoring No behavior changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants