signalapp/ringrtc

Cannot build ringrtc with Xcode 12.3

cemsozens opened this issue · 2 comments

I cannot build ringrtc 2.8.8 for iOS devices when I set Xcode 12.3 path in command "sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer". But if I set Xcode 11.7 url in this command everything works fine.

Specs of system:
Model Name: MacBook Pro
Model Identifier: MacBookPro16,1
Processor Name: 6-Core Intel Core i7
Processor Speed: 2,6 GHz
Number of Processors: 1
Total Number of Cores: 6
L2 Cache (per Core): 256 KB
L3 Cache: 12 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
System Firmware Version: 1554.60.15.0.0 (iBridge: 18.16.13030.0.0,0)
Activation Lock Status: Enabled

This is the error I get:

ERROR at //build/config/mac/mac_sdk.gni:106:7: Script returned non-zero exit code.
exec_script("//build/mac/find_sdk.py", find_sdk_args, "list lines")
^----------
Current dir: /Users/cem/Desktop/ringrtc/out/release/arm64_libs/
Command: python /Users/cem/Desktop/ringrtc/src/webrtc/src/build/mac/find_sdk.py --print_sdk_path --print_bin_path 10.12.1
Returned 1.
stderr:

Traceback (most recent call last):
File "/Users/cem/Desktop/ringrtc/src/webrtc/src/build/mac/find_sdk.py", line 97, in
print(main())
File "/Users/cem/Desktop/ringrtc/src/webrtc/src/build/mac/find_sdk.py", line 80, in main
raise Exception('No %s+ SDK found' % min_sdk_version)
Exception: No 10.12.1+ SDK found

See //build/toolchain/mac/BUILD.gn:15:1: whence it was imported.
import("//build/config/mac/mac_sdk.gni")
^--------------------------------------
See //BUILD.gn:29:3: which caused the file to be included.
group("default") {
^-----------------
Traceback (most recent call last):
File "./tools_webrtc/ios/build_ios_libs.py", line 238, in
sys.exit(main())
File "./tools_webrtc/ios/build_ios_libs.py", line 169, in main
args.use_goma, gn_args)
File "./tools_webrtc/ios/build_ios_libs.py", line 130, in BuildWebRTC
_RunCommand(cmd)
File "./tools_webrtc/ios/build_ios_libs.py", line 76, in _RunCommand
subprocess.check_call(cmd, cwd=SRC_DIR)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '/Users/cem/Desktop/ringrtc/src/webrtc/src/third_party/depot_tools/gn.py', 'gen', '/Users/cem/Desktop/ringrtc/out/release/arm64_libs', '--args=target_os="ios" ios_enable_code_signing=false use_xcode_clang=true is_component_build=false is_debug=false target_cpu="arm64" ios_deployment_target="11.0" rtc_libvpx_build_vp9=false enable_ios_bitcode=false use_goma=false enable_dsyms=true enable_stripping=true']' returned non-zero exit status 1
make: *** [ios/release] Error 1

Hi @cemsozens -

One of our dependencies, WebRTC, is trying to reference a 10.x Mac SDK that doesn't come with the latest Xcode. We currently use Xcode 12.1 for RingRTC library builds, which seems to still have that SDK!

As a work-around, you could copy an SDK from your older Xcode and get 12.3 builds working. Here is an example:

  • From the old Xcode, go to Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
  • You should see a link named MacOSX10.15.sdk (or similar), which points to MacOSX.sdk, copy MacOSX.sdk
  • Put that somewhere and rename it to MacOSX10.15.sdk
  • In the new Xcode (12.3), go to Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
  • There you should see a link named MacOSX11.1.sdk (or similar)...
  • Paste in the MacOSX10.15.sdk folder there, and you should now have both SDKs

Bear in mind that the iOS client team is currently using Xcode 12.2, so I am not sure if you will hit any other building issues along the way. From a RingRTC perspective, I could at least build all the libraries successfully with Xcode 12.3 with these steps.

Thanks @jim-signal for quick reply. I got some warnings during the build phase but the solution worked perfectly.