Skip to content

fix(macos): fix build issues causing crashes under Tahoe and preventing codesigning - #317

Open
kenmcgaugh wants to merge 3 commits into
AcademySoftwareFoundation:developfrom
kenmcgaugh:pr_mac_fixes
Open

fix(macos): fix build issues causing crashes under Tahoe and preventing codesigning#317
kenmcgaugh wants to merge 3 commits into
AcademySoftwareFoundation:developfrom
kenmcgaugh:pr_mac_fixes

Conversation

@kenmcgaugh

Copy link
Copy Markdown
Contributor

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/X11 which 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 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.

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.xSTUDIO to 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 provides xStudio via the XSTUDIO_GLOBAL_NAME variable. Should the name of the app be changed to xStudio.app?

Many thanks to David Cameron for figuring all this out.

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant