New issue
Advanced search Search tips

Issue 619921 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug

Blocked on:
issue 651267

Blocking:
issue 650421



Sign in to add a comment

Allow use of non-default Xcode in GN

Project Member Reported by rohitrao@chromium.org, Jun 14 2016

Issue description

I'd like to be able to run "gn args" and set a variable that allows me to use a non-default Xcode.app.  My use case is that I need to compile with multiple SDKs, and I'd like to avoid having separate checkouts.  I'd also like to avoid running xcode-select to switch SDKs, because I will inevitably forget to do so.




I tried running "gn args" to override all of the following variables:
ios_sdk_path 
ios_sdk_name
ios_sdk_version 
ios_sdk_platform 
ios_sdk_build
xcode_version
xcode_build
machine_os_build 
ios_platform_build

This worked ok for the ios side, but I got the following mac-related error:

Generating files...
ERROR at //build/config/mac/rules.gni:46:23: Undefined identifier in string expansion.
      "MAC_SDK_BUILD=$mac_sdk_build",
                      ^------------
"mac_sdk_build" is not currently in scope.
See //build/config/mac/rules.gni:159:3: whence it was called.
  mac_info_plist(_info_plist_target) {
  ^-----------------------------------
See //ui/base/BUILD.gn:949:3: whence it was called.
  mac_framework_bundle("ui_unittests_framework") {
  ^-----------------------------------------------
See //ios/chrome/tools/strings/BUILD.gn:11:5: which caused the file to be included.
    "//ui/base:ui_data_pack",
    ^-----------------------





If I also override mac_sdk_build, I get:

ERROR at //build/toolchain/mac/BUILD.gn:11:1: Value collision.
import("//build/config/mac/mac_sdk.gni")
^--------------------------------------
This import contains "mac_sdk_build"
See //build/config/mac/mac_sdk.gni:51:19: defined here.
  mac_sdk_build = _mac_sdk_result.sdk_build
                  ^------------------------
Which would clobber the one in your current scope
See build arg file (use "gn args <out_dir>" to edit):20:17: defined here.
mac_sdk_build = "16A201w"
                ^--------
Executing import should not conflict with anything in the current
scope unless the values are identical.
See //BUILD.gn:63:1: which caused the file to be included.
group("gn_all") {
^----------------





If I edit build/config/mac/mac_sdk.gni to conditionally set the xcode-related variables, I get:

ERROR at build arg file (use "gn args <out_dir>" to edit):20:17: Build argument has no effect.
mac_sdk_build = "16A201w"
                ^--------
The variable "mac_sdk_build" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

 
Ideally I'd want to set a single "xcode_developer_dir" variable somewhere, and then magic would happen.  No idea if that's possible or not.
Cc: rsesek@chromium.org
Labels: OS-Mac
+rsesek

Comment 3 by tapted@chromium.org, Jun 15 2016

Status: Available (was: Untriaged)
[mac triage] Up for grabs
Owner: sdefresne@chromium.org
Status: Assigned (was: Available)
Blocking: 650421
Blockedon: 651267
Issue 670523 has been merged into this issue.

Sign in to add a comment