Failed to find "gl.h" on macOS 11.3

Viewed 516

I've got XCode 12.5 up and running on macOS 11.3 (M1 chip) in Github Actions as a self-hosted runner.

While my macOS workflow is able to find gl.h in the github-hosted machine just fine, my own self-hosted one reports this:

  CMake Error at /Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
  Error:   Failed to find "gl.h" in
    "/System/Library/Frameworks/OpenGL.framework/Headers;/System/Library/Frameworks/AGL.framework/Headers".
  Call Stack (most recent call first):
    /Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:202 (include)
    3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:555 (_find_package)
    /Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:94 (find_package)
    3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:555 (_find_package)
    /Users/administrator/actions-runner/_work/Mudlet/Qt/5.14.2/clang_64/lib/cmake/Qt5UiTools/Qt5UiToolsConfig.cmake:219 (find_package)
    3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:555 (_find_package)
    3rdparty/edbee-lib/edbee-lib/CMakeLists.txt:177 (FIND_PACKAGE)

The code responsible is this line:

FIND_PACKAGE(Qt5UiTools REQUIRED)

What could be the reason that gl.h is not locatable?

2 Answers

I got this problem when I updated to MacOS Big Sur (11.6.2) when trying to make a qt app.

This was the error I got:

CMake Error at /usr/local/Qt-5.5.1/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
  Failed to find "gl.h" in
  "/System/Library/Frameworks/OpenGL.framework/Headers;/System/Library/Frameworks/AGL.framework/Headers".
Call Stack (most recent call first):
  /usr/local/Qt-5.5.1/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:139 (include)

My google-fu found this from 2019 [https://github.com/ziglang/zig/issues/2208] https://github.com/ziglang/zig/issues/2208 :

The new path to the framework is:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks

I looked, and gl.h was found in several places, including OpenGL.framework.

As a work-around, I changed the library path in /usr/local/Qt-5.5.1/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 from:

set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers")

to:

set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks")

running on macOS 11.3 (M1 chip) in Github Actions as a self-hosted runner.

Try again with the latest version of self-hosted runners, since (Aug. 2022):

GitHub Actions: Self-hosted runners now support Apple M1 hardware

Actions runner support for Apple silicon hardware, such as the M1 chip, is now generally available.

This provides teams with the capability to run self-hosted macOS workflows in a macOS ARM64 runtime.
Now the Actions runner supports M1 and the ARM64 runtime meaning developers can run it on their own M1 or M2 hardware.

Based on initial testing, there are currently two issues to be aware of:

  • macOS ARM64 does not support node12.
    Therefore, the runner will automatically use node16 to execute any javascript Action written for node12.
  • All actions provided by GitHub are compatible with the runner except for a known issue with setup-python. The fix for that can be tracked here.

For additional information on how to set up a self-hosted macOS ARM64 runner, please refer to our documentation.
If you have any feedback or questions for Actions self-hosted Apple silicon support, you can submit an issue in the runner repository.

Related