Commit 4bc3bf4f authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios/rbe] Fix iOS buildwith Goma RBE

Some targets want to copy files from $ios_sdk_platform_abs_path.
Since those points to sub-directory of $root_build_dir when goma
RBE is enabled, this causes failure at "gn gen" time since there
are no target creating those files according to gn.

To fix this, add a new target that pretends to create those files.

Bug: 1061487, webrtc:11429
Change-Id: I9d2330c4c6e041e59f24c459e50fe787602abde6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2102544
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750560}
parent ae1708e6
......@@ -127,3 +127,31 @@ config("xctest_config") {
group("xctest") {
public_configs = [ ":xctest_config" ]
}
# When building with Goma RBE, $ios_sdk_platform_abs_path corresponds to a
# symlink below $root_build_dir that points to the real SDK to use. Because
# the files are below $root_build_dir, it is not possible to list them as a
# target input without gn complaining (as it can't find a target creating
# those files).
#
# The symlinks are created by //build/config/mac/sdk_info.py script invoked
# via exec_script() from //build/config/{ios/ios_sdk.gni,mac/mac_sdk.gni}.
# As the invocation is done by exec_script, there is no target that can list
# those files as output.
#
# 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.
if (ios_use_goma_rbe) {
_xctrunner_path =
"$ios_sdk_platform_abs_path/Developer/Library/Xcode/Agents/XCTRunner.app"
action("copy_xctrunner_app") {
testonly = true
script = "//build/noop.py"
outputs = [
"$_xctrunner_path/Info.plist",
"$_xctrunner_path/PkgInfo",
"$_xctrunner_path/XCTRunner",
]
}
}
......@@ -108,7 +108,7 @@ if (ios_sdk_path == "") {
if (ios_use_goma_rbe) {
ios_sdk_info_args += [
"--create_symlink_at",
rebase_path("$root_build_dir/sdk/xcode_links", "//"),
"sdk/xcode_links",
]
}
script_name = "//build/config/mac/sdk_info.py"
......
......@@ -1904,6 +1904,10 @@ template("ios_xcuitest_test_runner_bundle") {
"-f=xml1",
"-o=" + rebase_path(_output_name, root_build_dir),
] + rebase_path(sources, root_build_dir)
if (ios_use_goma_rbe) {
deps = [ "//build/config/ios:copy_xctrunner_app" ]
}
}
ios_info_plist(_info_plist_target) {
......@@ -1932,6 +1936,10 @@ template("ios_xcuitest_test_runner_bundle") {
sources = [ "$_xctrunner_path/PkgInfo" ]
outputs = [ "{{bundle_contents_dir}}/PkgInfo" ]
if (ios_use_goma_rbe) {
deps = [ "//build/config/ios:copy_xctrunner_app" ]
}
}
_xctest_bundle = invoker.xctest_bundle
......@@ -1961,6 +1969,10 @@ template("ios_xcuitest_test_runner_bundle") {
":$_pkginfo_bundle",
":$_xctest_bundle",
]
if (ios_use_goma_rbe) {
deps = [ "//build/config/ios:copy_xctrunner_app" ]
}
}
}
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script that does nothing successfully."""
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