-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules/wayland: document that scan_xml can take any protocol. #13724
Conversation
mesonbuild/modules/wayland.py
Outdated
@@ -112,11 +112,13 @@ def scan_xml(self, state: ModuleState, args: T.Tuple[T.List[FileOrString]], kwar | |||
'wayland.find_protocol', | |||
KwargInfo('state', str, default='stable', validator=in_set_validator({'stable', 'staging', 'unstable'})), | |||
KwargInfo('version', (int, NoneType)), | |||
KwargInfo('vendored', bool, default=False, since='1.6.0'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I indicate that this should be the next release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just write the next release like you have, if this doesn't make it in till the next release, then we'd review saying "please update this to the next release"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got a couple of small nits for this, but this also deserves a release snippet to be written, as it's a pretty useful change.
mesonbuild/modules/wayland.py
Outdated
@@ -112,11 +112,13 @@ def scan_xml(self, state: ModuleState, args: T.Tuple[T.List[FileOrString]], kwar | |||
'wayland.find_protocol', | |||
KwargInfo('state', str, default='stable', validator=in_set_validator({'stable', 'staging', 'unstable'})), | |||
KwargInfo('version', (int, NoneType)), | |||
KwargInfo('vendored', bool, default=False, since='1.6.0'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just write the next release like you have, if this doesn't make it in till the next release, then we'd review saying "please update this to the next release"
mesonbuild/modules/wayland.py
Outdated
) | ||
def find_protocol(self, state: ModuleState, args: T.Tuple[str], kwargs: FindProtocol) -> File: | ||
base_name = args[0] | ||
xml_state = kwargs['state'] | ||
version = kwargs['version'] | ||
vendored = kwargs['vendored'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you also need to add the vendored
keyword to the FindProtocol
definition.
Hmm, turns out this is already supported, as used by GNOME: https://gitlab.gnome.org/GNOME/gtk/-/blob/2d1367ccdc4c604d8e5f5308763746eab01e6b6e/gdk/wayland/meson.build#L158 I will transition this PR into simply documenting that use case. |
The quick example can be slightly misleading in implying that scan_xml must use find_protocol, which is not the case. So explicitly mention it in the scan_xml docs.
bc5bad2
to
000fe8f
Compare
Ping? |
A lot of projects vendor protocols, since the ones they are using aren't available in default system directories. One example would be kanshi, where I am trying to use the wayland module (see ericonr/kanshi#2).
Right now this PR has a few issues. The main one is that the first configuration works and the project can be built successfully, but then, when I touch any of the
meson.build
files, the reconfiguration fails:I feel like I'm using a totally wrong way of getting the current source directory.
Furthermore, I don't think this is the ideal interface. A "directory" key might work better? For example in cases where people grab the protocol from a git submodule, so they can't have a
meson.build
in the same directory as the protocol definition. I would appreciate guidance on the interface definition and in actually implementing it.