New issue
Advanced search Search tips

Issue 763924 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug



Sign in to add a comment

"missing DEVELOPER_DIR path" during gn gen targeting iOS

Project Member Reported by kjellander@chromium.org, Sep 11 2017

Issue description

After rolling out the hermetic toolchain all and well for Mac and iOS on the bots (https://chromium.googlesource.com/external/webrtc/+/ec2c93e9479c3c6b8abffa2252a15475ab75f6dd) it turns out everyone that is not a bot gets this error when targeting iOS:


$ gn gen out/arm32-Debug --args='target_os="ios" ios_enable_code_signing=false is_component_build=false target_cpu="arm"'
ERROR at //build/config/ios/ios_sdk.gni:106:21: Script returned non-zero exit code.
  _ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
                    ^----------
Current dir: /Users/kjellander/dev/webrtc/src/out/arm32-Debug/
Command: python -- /Users/kjellander/dev/webrtc/src/build/config/mac/sdk_info.py --developer_dir /Users/kjellander/dev/webrtc/src/build/ios_files/Xcode.app iphoneos
Returned 1.
stderr:

xcrun: error: missing DEVELOPER_DIR path: /Users/kjellander/dev/webrtc/src/build/ios_files/Xcode.app
Traceback (most recent call last):
  File "/Users/kjellander/dev/webrtc/src/build/config/mac/sdk_info.py", line 70, in <module>
    FillXcodeVersion(settings)
  File "/Users/kjellander/dev/webrtc/src/build/config/mac/sdk_info.py", line 26, in FillXcodeVersion
    lines = subprocess.check_output(['xcodebuild', '-version']).splitlines()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['xcodebuild', '-version']' returned non-zero exit status 1

See //build/config/ios/rules.gni:5:1: whence it was imported.
import("//build/config/ios/ios_sdk.gni")
^--------------------------------------
See //webrtc/webrtc.gni:32:3: whence it was imported.
  import("//build/config/ios/rules.gni")
  ^------------------------------------
See //BUILD.gn:9:1: whence it was imported.
import("webrtc/webrtc.gni")
^-------------------------


I haven't been able to figure out why it's looking in build/ios_files. The toolchain is downloaded into build/mac_files and I got the impression that the iOS toolchain is not yet rolled out?
 
Cc: mbonadei@chromium.org oprypin@chromium.org
The root cause seems to be that Chromium has not yet switched to use hermetic toolchain for iOS locally, only on bots.
    
    $ build/mac/should_use_hermetic_xcode.py ios
    0

https://cs.chromium.org/chromium/build/scripts/slave/recipe_modules/ios/api.py?q=FORCE_MAC_TOOLCHAIN

The behavior of the download script currently matches between WebRTC and Chromium.

    $ /Users/oprypin/chromium/src$ build/mac_toolchain.py
    Using local toolchain for ios.
    Toolchain (8E2002-3) is already up to date.

But the local build behavior does not seem to match.
https://chromium.googlesource.com/external/webrtc/+/ec2c93e9479c3c6b8abffa2252a15475ab75f6dd/build_overrides/build.gni#39
https://cs.chromium.org/chromium/src/build_overrides/build.gni?q=use_system_xcode
    
We need to find out why Chromium does not use hermetic toolchain locally for iOS, and either do what Chromium does, or fix this script to download iOS toolchain locally.


I tried just copying the stuff from Chromium's build.gni but it says "The use of exec_script use is restricted in this build."
That's correct -- hermetic is only supported for the bots and not for local builds.  This is due to some of the internal tools used by the iOS build (specifically actool) that makes it difficult to build and use Xcode as an IDE at the same time.

You can set FORCE_MAC_TOOLCHAIN and use hermetic locally if you wish, but it's not on by default.
#3: thanks for your reply. I think we are going to only use it on the bots then. Is seems unsafe to use it locally since Xcode is usually used as an IDE.
mbonadei@ Sorry for the trouble.  Xcode 9 has added some promising changes to how ibtool/actool/CoreSimulator work, so it's possible we can revisit this -- although the dependency chain for actool has grown to be 'all of Xcode', so the bundle will be very large.
Owner: oprypin@chromium.org
Status: Started (was: Untriaged)
Thanks for chiming in justincohen@, I rushed to roll out this hermetic toolchain last week after seeing breakages due to the Xcode 9 requirement etc. I didn't anticipate that local builds would differ from the bot (which in itself is an unfortunate state to be in, but I know these things are complicated).

We have https://codereview.webrtc.org/3013003002/ in progress now and will land shortly.

Regarding FORCE_MAC_TOOLCHAIN=1 I think it would be best for all if we can find another way to make the bots behave differently. Environment variables causes a lot of bad stuff, all the time.
Err, sorry about saying "we" in #6: it was thanks to Oleh and Mirko this got solved.
I didn't do any of the hard work here since I had to be out for a couple of hours. Kudos to them stepping up and solving this!
Status: Fixed (was: Started)

Sign in to add a comment