-
Notifications
You must be signed in to change notification settings - Fork 245
freeglut: require GL/glu.h #2118
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
base: master
Are you sure you want to change the base?
Conversation
de8d1bf
to
94e3882
Compare
Seems like the MacOS build failure is caused by a github-actions issue: actions/runner-images#9966 |
Yeah, testing this locally works fine... |
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.
Thank you for coming up with a fix for my issue https://gitlab.freedesktop.org/mesa/demos/-/issues/50. The diff looks good to me.
required: false, | ||
) | ||
# GLU is part of OpenGL.Framework | ||
if not dep_glu.found() and host_machine.system() != 'darwin' |
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 don't require the dependency on macOS, then?
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.
What do you mean? Just because GLU is part of OpenGL.Framework doesn't mean Freeglut isn't useful on macOS, no?
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.
Did you perhaps mix up GLU and GLUT?
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.
Why does this check include and host_machine.system() != 'darwin'
? The dependency()
call specifies required: false
, and on macOS we don't do the followup cc.find_library()
call with implicit required: true
, so the wrap ends up requiring GLU except on macOS.
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.
GLU is always required to build FreeGLUT, on all platforms.
I don't have a mac system at hand to test with, but my understanding is that on macOS, dep_glu will not be found, but because it doesn't have disabler: true
, including it in freeglut_deps
is benign. And on macOS, GLU will be available through dependency('gl')
, which is already part of freeglut_deps
.
So I'm not really sure what you think the problem is here. GLU will be found, just through another dependency on macOS.
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.
And on macOS, GLU will be available through
dependency('gl')
That answers it, thanks. Might be good to mention that in a comment, since it's not clear by inspection.
Freeglut requires GL/glu.h, which isn't always installed. Make sure we check for it, so we can get a meaningful error message early on instead of just failing to compile. Because not all platforms has glu as a dependency, we also need to fall back to searching for the library. This search is copied from Mesa's demos project.
Seems there's an issue where recent python versions will conflict with the version provided by the runner-image. Let's try to work around it. This feels a bit hacky, because we need to hard-code the specific version, suggestions for improvements welcome. See this ticket for details: actions/runner-images#9966
6d4eff0
to
9fe557a
Compare
@@ -196,6 +196,10 @@ jobs: | |||
python3 -m pip install license-expression | |||
python3 -m pip install --pre meson | |||
|
|||
- name: Work around runner-images issue 9966 | |||
run: | | |||
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done |
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 seems a bit long as a one-liner. Any reason not to keep the original formatting?
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 because that's what it seemed others were doing. I don't know YAML and formatting details well enough to know if the multi-line version would work or not without testing both.
I suppose I can try and see if it helps?
Freeglut requires GL/glu.h, which isn't always installed. Make sure we check for it, so we can get a meaningful error message early on instead of just failing to compile.
Because not all platforms has glu as a dependency, we also need to fall back to searching for the library. This search is copied from Mesa's demos project.