-
Notifications
You must be signed in to change notification settings - Fork 182
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
Fix build for wayland #199
Conversation
Thanks for this! Can you explain this PR a little bit.
|
These files come from these lines: https://github.com/glfw/glfw/blob/master/src/CMakeLists.txt#L42-L49. During the compilation, cmake generates the 4 files using the extra cmake module defined here. The commands I talked about were the
|
I see. I'm not on Wayland so I can't test this but since it didn't compile at all before this PR I'm inclined to merge this anyway. |
As a side note, it would actually be really cool if we could have a wayland-scanner that generated Go code. |
Hey @elmindreda, if I may bug you about this, do you know whether vendoring copies of these Those files are not expected to be available on the user's Wayland system, are they? I'm asking because I know you're likely more familiar with this, and I have no idea about Wayland, so your expertise would be helpful. Thanks, and no worries if you don't have bandwidth to deal with this. |
@shurcooL Sorry, I'm really not an expert on Wayland. The expert (and author) wrt these protocols is @jadahl. Those C files are not packaged anywhere, as far as I know; only the XML files are. From what I gather from wayland-protocols it seems relatively safe for you to bundle them, as they're using something similar to semantic versioning and neither the protocols nor the scanner have seen recent updates. Generating the files yourselves with |
5567f56
to
382fdf9
Compare
@shurcooL We juste need to run (in directory |
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.
We should really use the installed protocol files and generate them on the fly. Is there no way to do that using whatever this new build system is?
@jadahl I think we can use The final |
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.
Thanks for info @elmindreda.
Including the generated .c
and .h
files is good, then. Users are not going to be doing the go generate
step, only we the developers are, so it needs to be a part of the repo when users do go get
.
It's great that this can be made a little more reproducible via go:generate
directives.
I have the following change requests:
-
Add a new section to https://github.com/go-gl/glfw/wiki/Development, at the bottom, and document the steps a developer would need to run to regenerate the
.c
/.h
files when XML source files change.It can be a short section. As I understand, it's just a matter of installing/having the
wayland-scanner
binary, then runninggo generate
on the package. But it's a good place for you to write where one can installwayland-scanner
binary from, and where latest XML files can be found. -
Decide if you're going to include the XML files or if they'll be fetched from somewhere else.
If you do keep them, move them to a
wayland
subdirectory, I think that'd be cleaner.
I have not tested this (because I don't actively use Linux). But at a high level, this looks good. Thanks for your work!
@shurcooL There you go: https://github.com/go-gl/glfw/wiki/Development#generating-wayland-sourceheader-files To keep the repo clean, it is probably best to regenerate the files from the up-to-date repositories. Can you try the small bash script added in the wiki and let me know if it work on a different machine than mine? |
Sounds good.
Great, thanks! Does it need to be done on a Linux machine? I tried on macOS and got:
If it's meant to be done on Linux only, we should mention that in the wiki section. |
@@ -0,0 +1,3 @@ | |||
pointer-constraints-unstable-v1.xml | |||
relative-pointer-unstable-v1.xml | |||
|
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.
Let's not add a .gitignore file, it's not needed.
Instead, we can add a rm pointer-constraints-unstable-v1.xml relative-pointer-unstable-v1.xml
line at the end of https://github.com/go-gl/glfw/wiki/Development#generating-wayland-sourceheader-files and the repo will be clean.
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.
This still needs to be addressed.
I did Installing Afterwards, the only missing step was adding the
Otherwise it wasn't finding With all that, I was able to rebuild the wayland .c/.h files and they pretty much matched the ones in this PR generated by you, except some comments were different because I generated with a newer version of So, overall, I confirm that with the minor tweaks above, it works. However, one big question I have is this. It seems there's an APT package that offers a binary version of |
Friendly ping @thomasruiz. Are you still interesting in completing this? If so, did you see my question above? When you answer it, we can proceed. |
@shurcooL I was sure I answered that already. Good catches for the missing steps to compile Yes, there is an APT package for it on debian and ubuntu, but I am not sure whether it exists on other distributions, but now I'm thinking about it, it's probably best to tell in the docs to try and install the package provided if it exists. |
Okay, thanks. Here is my suggestion. I think we should change the wiki page to list instructions for installing The only reason I went about building |
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 want to help communicate what still needs to be done to get this into mergeable state. See inline comment.
@@ -0,0 +1,3 @@ | |||
pointer-constraints-unstable-v1.xml | |||
relative-pointer-unstable-v1.xml | |||
|
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.
This still needs to be addressed.
Hi! What's the status of this? Does #212 supersede it? Can I help with testing? It's not totally clear to me what is outstanding, or how I might test it. If this is merged now as-is, does it regress anything? |
I'll update #212 with some more information. Let's continue there. |
I'm closing this one then thanks |
Follows up #198
Regarding the files
wayland-pointer-constraints-unstable-v1-client-protocol.c
,wayland-pointer-constraints-unstable-v1-client-protocol.h
,wayland-relative-pointer-unstable-v1-client-protocol.c
andwayland-relative-pointer-unstable-v1-client-protocol.h
, they were generated using thewayland-scanner
binary and the protocols defined on https://github.com/wayland-project/wayland-protocols.I am not entirely sure we can add these files to the repo, but at least it builds correctly with no warning.