fix(macos): fix build issues causing crashes under Tahoe and preventing codesigning - #317
Open
kenmcgaugh wants to merge 3 commits into
Open
fix(macos): fix build issues causing crashes under Tahoe and preventing codesigning#317kenmcgaugh wants to merge 3 commits into
kenmcgaugh wants to merge 3 commits into
Conversation
…eventing codesigning. Under macOS Tahoe, xstudio is crashing due to OpenGL compatibility issues as the build was finding libraries under /opt/X11. Forcing the build to find the system OpenGL framework fixes the crash. However vcpkg's glew port was still linking to the OpenGL libraries under /opt/X11 which prevents codesigning, so this installs a patch forcing it to also find the system framework. The xSTUDIO.app could not be codesigned due the bundle structure. This commit fixes this by putting all python and qml files under the app's Resources folder instead of Frameworks. The rpath modifications that was happing durning the post-build stage was also causing issues under Tahoe, forcing the developer to run an ad-hoc codesigning over the app before it could be launched. This commit removes any rpath modifications during build allowing the app to be launchable immediately. The rpath modifications were also causing issues with macdeployqt, requiring further unnecessary cleanup of the resulting install names and rpaths. Many thanks to David Cameron for figuring all this out. Signed-off-by: Ken McGaugh <ken@mcgaugh.co.uk>
This adds a post-install step to macOS builds that runs a macos_finalize_bundle script which strips all absolute rpath's from and codesigns any binaries. By default it does an ad-hoc codesign, but by setting the CODESIGN_IDENTITY and KEYCHAIN_PASSWORD environment variables you can perform a proper codesign. Signed-off-by: Ken McGaugh <ken@mcgaugh.co.uk>
kenmcgaugh
force-pushed
the
pr_mac_fixes
branch
from
August 5, 2026 01:00
d929b63 to
4d710c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under macOS Tahoe, xstudio is crashing due to OpenGL compatibility issues since the build was finding libraries under
/opt/X11. Forcing the build to find the system OpenGL framework fixes the crash. However vcpkg's glew port was still linking to the OpenGL libraries under/opt/X11which prevents codesigning, so this installs a patch forcing it to also find the system framework.Additionally, the app could not be codesigned due the bundle structure. This commit fixes this by putting all python and qml files under the app's
Resourcesfolder instead ofFrameworks.The rpath modifications that was happing durning the post-build stage was also causing issues under Tahoe, forcing the developer to run an ad-hoc codesigning over the app before it could be launched. This commit removes any rpath modifications during build allowing the app to be launchable immediately. The rpath modifications were also causing issues with
macdeployqt, requiring further unnecessary cleanup of the resulting install names and rpaths.This also adds a post-install step to strip all absolute rpath's from and codesign any binaries. By default this does an ad-hoc codesign, but a proper codesign can be done by setting the CODESIGN_IDENTITY and KEYCHAIN_PASSWORD environment variables.
Note this required assigning a poper bundel identifier to the app. We chose
com.dneg.xSTUDIOto match the name of the resulting app. This had to be hard-coded into the Info.plist since that form of the name is not present as a cmake variable. Instead, cmake providesxStudiovia theXSTUDIO_GLOBAL_NAMEvariable. Should the name of the app be changed toxStudio.app?Many thanks to David Cameron for figuring all this out.