Build Issue for Shaka Packager on macOS Mohave
System info
Operating System: macOS Mohave Shaka Packager Version: HEAD
Issue and steps to reproduce the problem
I am trying to build Shaka Packager from source based on the instructions online: https://github.com/google/shaka-packager/blob/master/docs/source/build_instructions.md. However, I am seeing a bunch of compilation failures.
Packager Command:
ninja -C out/Release
Extra steps to reproduce the problem? (1) Follow the instructions on MacOS Mohave
What is the expected result?
Compilation Succeeds correctly
What happens instead?
Compilation Failues
Emm, there are build conflicts with latest MacOSX 10.15 SDK. Base needs to be updated: https://github.com/google/shaka-packager/blob/master/DEPS#L16.
@kqyang which version of Python does Shaka Packager need to build on Linux? It's failing to compile with version 2.6.9 and 3.6.5.
Same for GCC, which version of GCC do you require?
@ronak2121 It works with both python 2.6 and python 3.6. As for GCC, it requires a version that supports C++11. I don't remember the exact version, maybe gcc 4.8?
It's failing to compile with version 2.6.9 and 3.6.5.
What is your Linux distribution and version? Can you share the error log?
You can work around this in the short term by using 10.14 SDK. The culprit is a change in 10.15.
Download from here: https://github.com/phracker/MacOSX-SDKs/releases/tag/10.14-beta4 Then extract into your XCode SDK folder. i.e./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
You may need to change your env variables as well. DISCLAIMER If you have other build jobs on the same machine that require 10.15, this could cause a problem. Please use with caution.
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
export CMAKE_OSX_DEPLOYMENT_TARGET=10.14
I ran gclient config ... and sync for good measure to ensure the ninja files are rebuilt as they will likely point to 10.15.
Then re-run ninja command.
This should resolve the redefinition issues, such as:
error: typedef redefinition with different types ('struct OpaqueSecTrustRef *' vs 'struct __SecACL *')
Ok. When would we be able to get true support for the latest macOS SDKs?
I'll try building Shaka on Linux again and let you know what happens.
@ronak2121 We don't have bandwidth to work on it in the near term. Hopefully we will have some bandwidth next year.
Any progress on updating for OSX 10.15.4? I used the workaround and that seems to work but not really an enterprise solution.
No, unfortunately.
I used the Docker container and that worked perfectly. It actually makes more sense to use instead of an env specific shaka-packager configuration. Easier to set up too instead of getting gclient, ninja, etc.
Cool. I am glad that docker works for you. You can also find prebuilt osx binaries in our releases: https://github.com/google/shaka-packager/releases.
Had to also change the MinimumSDKVersion here to 10.14 in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
Thanks @samidhtalsania. Does it address the problem mentioned in https://github.com/google/shaka-packager/issues/868#issuecomment-757075782?
Most likely the fix above should also fix the issue mentioned in #868 (comment). I had the same error, "its version (10.14) is below required minimum (10.15) for the macosx platform."
Thanks yeah that worked. 👍🏽 Just a note if it helps anyone else you might need to have Read+Write permissions on file
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist in order to update it.
We have made several changes to the build system recently, but we don't have macOS 10.14 Mojave to test with. Can anyone confirm if this is still an issue with the latest Shaka Packager source?
@joeyparrish yeah doesn't work still for me.. I am trying now on macOS Big Sur and macOS Monterey.. Also the newest xcode versions also don't have the Info.plist file in the location mentioned in above comments so trying right now to find where could I change that to be able to run any builds with this hack.
In GitHub Actions, we are building with XCode 10.3, SDK 10.14, and macOS 10.15.
We don't have a better solution yet, as it would require us to upgrade all of our chromium-based build infrastructure. It might be better to rip it out instead.
Yeah true.. I agree. I also noticed on couple open PR including mine. The builds are not passing on the macOS builds from Github Actions so there might be other problems with those with current setup in Actions.
I've just fixed macOS builds. There are still issues with the CI on our Linux-arm64 and Windows builds, plus completely separate issues with our Docker builds. I'm working on it, but progress is slow.
The ancient gyp build system is going away, and we are migrating to CMake and git submodules. This should resolve all build issues on every OS and version. If you would like to help with this effort, please see https://github.com/shaka-project/shaka-packager/issues/1047#issuecomment-1282870835 to volunteer. Thanks!
No longer an issue in the cmake branch, which we will merge to main soon.