Commit b884b9b2 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Revert "[ios] Always use symbolic links to system Xcode in build_root_dir"

This reverts commit a06a6eb7.

Reason for revert: Seems to break non-goma builds on macos.

Original change's description:
> [ios] Always use symbolic links to system Xcode in build_root_dir
>
> Goma RBE only supports paths that are relative to the source dir
> while build not using Goma or using old Goma backend supports both
> so always use symbolic link to system Xcode on iOS.
>
> This fix the compilation for people using Goma as Goma RBE is now
> the default backend and without this change, the build would fall
> back to local compilation, drastically slowing the build.
>
> Stop using the ios_enable_relative_sdk_path and ios_use_goma_rbe
> gn variables as they are now always expected to be `true`. Keep
> the variable ios_use_goma_rbe to avoid breaking the bots that do
> override the value but ignore it (bot set it to true anyway).
>
> Bug: none
> Change-Id: I2a3c098304594fb20491ab92100e9a4101a048db
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2555117
> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#830616}

TBR=thakis@chromium.org,sdefresne@chromium.org

Change-Id: I5aed7d701a1d2d04d389cb4d746bc975e80b0f0f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561019Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831019}
parent a100f65b
......@@ -19,7 +19,7 @@ if (current_cpu == "arm" || current_cpu == "arm64") {
import("//build/config/arm.gni")
}
if (is_apple) {
if (is_mac) {
import("//build/config/mac/symbols.gni")
}
......@@ -216,7 +216,7 @@ declare_args() {
# official builders.
strip_absolute_paths_from_debug_symbols_default =
is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
is_chromeos || (is_apple && !enable_dsyms)
is_chromeos || (is_mac && !enable_dsyms) || ios_use_goma_rbe
# If the platform uses stripped absolute paths by default, then we don't expose
# it as a configuration option. If this is causing problems, please file a bug.
......
......@@ -87,11 +87,14 @@ config("compiler") {
# that is iOS-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler.
config("runtime_library") {
# The variable ios_sdk_path is relative to root_out_dir for goma RBE. As it
# is passed to the compiler via cflags, ldflags which do not rebase the
# values (since they are compiler flags, not paths), it has to rebased. Use
# a local variable to avoid repeating the rebase invocation.
_sdk_root = rebase_path(ios_sdk_path, root_build_dir)
# The variable ios_sdk_path may be relative to root_out_dir on the bots. As
# it is passed to the compiler via cflags, ldflags which do not rebase the
# values (since they are compiler flags, not paths), it may be required to
# rebase it. Use a local variable to avoid repeating the rebase invocation.
_sdk_root = ios_sdk_path
if (ios_enable_relative_sdk_path) {
_sdk_root = rebase_path(ios_sdk_path, root_build_dir)
}
common_flags = [
"-isysroot",
......@@ -219,14 +222,16 @@ _xctrunner_path =
#
# To workaround this, add a target that pretends to create those files
# (but does nothing). See https://crbug.com/1061487 for why this is needed.
action("copy_xctrunner_app") {
testonly = true
script = "//build/noop.py"
outputs = [
"$_xctrunner_path/Info.plist",
"$_xctrunner_path/PkgInfo",
"$_xctrunner_path/XCTRunner",
]
if (ios_use_goma_rbe) {
action("copy_xctrunner_app") {
testonly = true
script = "//build/noop.py"
outputs = [
"$_xctrunner_path/Info.plist",
"$_xctrunner_path/PkgInfo",
"$_xctrunner_path/XCTRunner",
]
}
}
# When creating the test runner for an XCUITest, the arm64e slice of the binary
......@@ -246,5 +251,7 @@ action("xctest_runner_without_arm64e") {
xcode_version,
]
deps = [ ":copy_xctrunner_app" ]
if (ios_use_goma_rbe) {
deps = [ ":copy_xctrunner_app" ]
}
}
......@@ -58,6 +58,9 @@ declare_args() {
# You can also pass the value via "--args" parameter for "gn gen" command by
# using the syntax --args='additional_target_cpus=["arm"] target_cpu="arm64"'.
additional_target_cpus = []
# TODO(crbug.com/1015730): remove this flag because ios_use_goma_rbe covers.
ios_enable_relative_sdk_path = ios_use_goma_rbe
}
declare_args() {
......@@ -127,8 +130,6 @@ if (ios_sdk_path == "") {
ios_sdk_info_args = [
"--get_sdk_info",
"--get_machine_info",
"--create_symlink_at",
"sdk/xcode_links",
]
ios_sdk_info_args += [ ios_sdk_name ]
if (ios_sdk_developer_dir != "") {
......@@ -137,6 +138,12 @@ if (ios_sdk_path == "") {
ios_sdk_developer_dir,
]
}
if (ios_use_goma_rbe) {
ios_sdk_info_args += [
"--create_symlink_at",
"sdk/xcode_links",
]
}
script_name = "//build/config/mac/sdk_info.py"
_ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
ios_sdk_path = _ios_sdk_result.sdk_path
......
......@@ -433,8 +433,15 @@ template("create_signed_bundle") {
code_signing_args += [ "--disable-code-signature" ]
}
if (defined(invoker.extra_system_frameworks)) {
# All framework in extra_system_frameworks are expected to be system
# framework and the path to be already system absolute so do not use
# rebase_path here unless ios_enable_relative_sdk_path is trued.
foreach(_framework, invoker.extra_system_frameworks) {
_framework_path = rebase_path(_framework, root_build_dir)
if (ios_enable_relative_sdk_path) {
_framework_path = rebase_path(_framework, root_build_dir)
} else {
_framework_path = _framework
}
code_signing_args += [ "-F=$_framework_path" ]
}
}
......@@ -1967,7 +1974,9 @@ template("ios_xcuitest_test_runner_bundle") {
"-o=" + rebase_path(_output_name, root_build_dir),
] + rebase_path(sources, root_build_dir)
deps = [ "//build/config/ios:copy_xctrunner_app" ]
if (ios_use_goma_rbe) {
deps = [ "//build/config/ios:copy_xctrunner_app" ]
}
}
ios_info_plist(_info_plist_target) {
......@@ -1997,7 +2006,9 @@ template("ios_xcuitest_test_runner_bundle") {
outputs = [ "{{bundle_contents_dir}}/PkgInfo" ]
public_deps = [ "//build/config/ios:copy_xctrunner_app" ]
if (ios_use_goma_rbe) {
public_deps = [ "//build/config/ios:copy_xctrunner_app" ]
}
}
_xctest_bundle = invoker.xctest_bundle
......
......@@ -77,7 +77,7 @@ if (!use_system_xcode) {
}
# put system xcode under src to avoid absolute path.
if (use_system_xcode) {
if (use_system_xcode && ios_use_goma_rbe) {
sdk_info_args += [
"--get_sdk_info",
"--create_symlink_at",
......@@ -89,7 +89,7 @@ sdk_info_args += [ mac_sdk_name ]
_mac_sdk_result = exec_script(script_name, sdk_info_args, "scope")
xcode_version = _mac_sdk_result.xcode_version
xcode_build = _mac_sdk_result.xcode_build
if (mac_sdk_path == "" && use_system_xcode) {
if (mac_sdk_path == "" && use_system_xcode && ios_use_goma_rbe) {
mac_sdk_path = _mac_sdk_result.sdk_path
}
......
......@@ -25,9 +25,8 @@ declare_args() {
# TODO(crbug.com/726475): true if use_goma = true in the future.
use_java_goma = false
# Deprecated and ignored as Goma RBE is now the default. Still exists
# to avoid breaking the build on the bots. Will be removed when all
# bots have been configured to not set this variable.
# Auto-configure for Goma RBE backend.
# TODO(crbug.com/1015730): true if use_goma = true in the future.
ios_use_goma_rbe = false
}
......
......@@ -328,23 +328,6 @@ ask there. As mentioned above, be sure that the
[waterfall](https://build.chromium.org/buildbot/waterfall/) is green and the tree
is open before checking out. This will increase your chances of success.
### Debugging
To help with reproductible builds, and to work with Goma, the path to source
files in debugging symbols are relative to source directory. To allow Xcode
to find the source files, you need to ensure to have an `~/.lldbinit-Xcode`
file with the following lines into it (substitute {SRC} for your actual path
to the root of Chromium's sources):
```
script sys.path[:0] = ['{SRC}/tools/lldb']
script import lldbinit
```
This will also allow you to see the content of some of Chromium types in the
debugger like `base::string16`, ... If you want to use `lldb` directly, name
the file `~/.lldbinit` instead of `~/.lldbinit-Xcode`.
### Changing the version of Xcode
To change the version of Xcode used to build Chromium on iOS, please follow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment