shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

Error in release build for arm64 with dev CDM #203

Open franciscocarodiaz opened 3 years ago

franciscocarodiaz commented 3 years ago

Mac version: macOS Big Sur, 11.0.1

I'm trying to generate version release build for arm64 with dev CDM to test in my device: ../configure --ios --cpu arm64 --release --eme-impl ~/Developer/tvup/libs/widevine_prebuilt_cdm/shaka_plugin/dev_cdm.json

And this is the error message from the console:

Loading required submodules... Downloading GN from cloud storage... Generating files for boringssl... Standard output: ERROR at //build/config/mac/mac_sdk.gni:80:5: Script returned non-zero exit code. exec_script("//build/mac/find_sdk.py", find_sdk_args, "list lines") ^---------- Current dir: /Users/franciscocarodiaz/Developer/tvup/libs/shaka-player-embedded/cdmbuildbeta/ Command: python /Users/franciscocarodiaz/Developer/tvup/libs/shaka-player-embedded/build/mac/find_sdk.py --print_sdk_path --print_bin_path 10.14 Returned 1. stderr:

Traceback (most recent call last): File "/Users/franciscocarodiaz/Developer/tvup/libs/shaka-player-embedded/build/mac/find_sdk.py", line 127, in print(main()) File "/Users/franciscocarodiaz/Developer/tvup/libs/shaka-player-embedded/build/mac/find_sdk.py", line 96, in main raise Exception('No %s+ SDK found' % min_sdk_version) Exception: No 10.14+ SDK found

See //build/toolchain/mac/BUILD.gn:15:1: whence it was imported. import("//build/config/mac/mac_sdk.gni") ^-------------------------------------- See //BUILD.gn:255:1: which caused the file to be included. group("player") { ^----------------

Standard error:

TheModMaker commented 3 years ago

The error log shows Exception: No 10.14+ SDK found, this means we couldn't find Xcode. We need an Xcode install. Make sure to install command-line tools too.

franciscocarodiaz commented 3 years ago

I have installed xcode 12.2 and last version of command-line too.

This is from the terminal:

MacBook-Pro-de-Francisco-2:Developer franciscocarodiaz$ which g++ /usr/bin/g++ MacBook-Pro-de-Francisco-2:Developer franciscocarodiaz$ /usr/bin/xcodebuild -version Xcode 12.2 Build version 12B45b MacBook-Pro-de-Francisco-2:Developer franciscocarodiaz$ xcode-select -p /Applications/Xcode.app/Contents/Developer MacBook-Pro-de-Francisco-2:Developer franciscocarodiaz$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.0 (clang-1200.0.32.27) Target: x86_64-apple-darwin20.1.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

robelor commented 3 years ago

Submodule build(6019ed9) does not support Big Sur on its find_sdk.py. It is fixed on commit bcb7c9351 but shaka-player-embedded does not compile with this version of chromium's build project.

My workaround is to patch find_sdk.py and commit changes and new submodule version to prevent the configure system to overwrite changes. Patch:

diff --git a/mac/find_sdk.py b/mac/find_sdk.py
index 38c288322..cbddff707 100755
--- a/mac/find_sdk.py
+++ b/mac/find_sdk.py
@@ -88,7 +88,7 @@ def main():
     raise SdkError('Install Xcode, launch it, accept the license ' +
       'agreement, and run `sudo xcode-select -s /path/to/Xcode.app` ' +
       'to continue.')
-  sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
+  sdks = [re.findall('^MacOSX(11\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
   sdks = [s[0] for s in sdks if s]  # [['10.5'], ['10.6']] => ['10.5', '10.6']
   sdks = [s for s in sdks  # ['10.5', '10.6'] => ['10.6']
           if parse_version(s) >= parse_version(min_sdk_version)]

Apply and commit changes:

git submodule update --init build
cd build
git apply /path/to/patch.patch
git add mac/find_sdk.py
git commit -m "find_sdk.py quick fix"
cd ..
git add build
git commit -m "Update build submodule version"
franciscocarodiaz commented 3 years ago

I can't find out any solution related to this error. Any advice?

sideround commented 3 years ago

@franciscocarodiaz the workaround as @robelor pointed out is to apply a patch into your local shaka-player-embedded git repository. Problem is that it can not get your mac SDK as the regex only expects a 10 (it used to be 10, now it is 11).

Is there any plan to fix it on the mid-long term? I did not ran the configuration with Chromium's submodule fix (bcb7c9351) but how can we help in order to fix it? It can be a problem to rely on this workaround, especially when we want to automatize this thing.

Megubit commented 3 years ago

If you still have the issue, I fixed mine by doing the following: Check where my SDK path is with xcrun --show-sdk-path It should output something like /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk

then go to the folder, and just make a symbolic link: ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk ./MacOSX10.14.sdk

It's a workaround but worked for me (unless there are some unknown issues that could happen, but I didn't encounter any yet)

Note: you might need to do the same in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

Hope this helps