Commit e1713367 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios] Fix definition of ios_sdk_platform_path when using Goma RBE

Assigning a relative value to ios_sdk_platform_path does not work
as the variable is used by more than one target/config as some of
them are from a different level in the directory hierarchy (thus
they require a different rebased value).

Instead change build/config/mac/sdk_info.py to output a path that
is relative to root_source_dir (i.e. a path starting with //) and
fixes the different usage of the ios_sdk_platform_path variable
to do the rebase_path as required.

Bug: 1058221
Change-Id: I41545765dbf66efb96b8d00246bfe1856dba9bea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087219
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarSimon Que <sque@chromium.org>
Reviewed-by: default avatarYoshisato Yanagisawa <yyanagisawa@google.com>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747181}
parent 99da215c
...@@ -73,10 +73,17 @@ config("compiler") { ...@@ -73,10 +73,17 @@ config("compiler") {
# that is iOS-only. Please see that target for advice on what should go in # that is iOS-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler. # :runtime_library vs. :compiler.
config("runtime_library") { config("runtime_library") {
common_flags = [ if (ios_enable_relative_sdk_path) {
"-isysroot", common_flags = [
sysroot, "-isysroot",
] rebase_path(sysroot, root_build_dir),
]
} else {
common_flags = [
"-isysroot",
sysroot,
]
}
if (use_ios_simulator) { if (use_ios_simulator) {
common_flags += [ "-mios-simulator-version-min=$ios_deployment_target" ] common_flags += [ "-mios-simulator-version-min=$ios_deployment_target" ]
......
...@@ -111,14 +111,8 @@ if (ios_sdk_path == "") { ...@@ -111,14 +111,8 @@ if (ios_sdk_path == "") {
script_name = "//build/config/mac/sdk_info.py" script_name = "//build/config/mac/sdk_info.py"
_ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope") _ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
ios_sdk_platform_abs_path = _ios_sdk_result.sdk_platform_path ios_sdk_platform_abs_path = _ios_sdk_result.sdk_platform_path
if (ios_enable_relative_sdk_path) { ios_sdk_path = _ios_sdk_result.sdk_path
ios_sdk_path = rebase_path(_ios_sdk_result.sdk_path, root_build_dir) ios_sdk_platform_path = _ios_sdk_result.sdk_platform_path
ios_sdk_platform_path =
rebase_path(_ios_sdk_result.sdk_platform_path, root_build_dir)
} else {
ios_sdk_path = _ios_sdk_result.sdk_path
ios_sdk_platform_path = _ios_sdk_result.sdk_platform_path
}
ios_sdk_version = _ios_sdk_result.sdk_version ios_sdk_version = _ios_sdk_result.sdk_version
ios_sdk_build = _ios_sdk_result.sdk_build ios_sdk_build = _ios_sdk_result.sdk_build
xcode_version = _ios_sdk_result.xcode_version xcode_version = _ios_sdk_result.xcode_version
......
...@@ -365,11 +365,16 @@ template("create_signed_bundle") { ...@@ -365,11 +365,16 @@ template("create_signed_bundle") {
code_signing_args += [ "--disable-code-signature" ] code_signing_args += [ "--disable-code-signature" ]
} }
if (defined(invoker.extra_system_frameworks)) { if (defined(invoker.extra_system_frameworks)) {
# All framework in extra_system_frameworks are expected to be # All framework in extra_system_frameworks are expected to be system
# system framework and the path to be already system absolute # framework and the path to be already system absolute so do not use
# so do not use rebase_path here. # rebase_path here unless ios_enable_relative_sdk_path is trued.
foreach(_framework, invoker.extra_system_frameworks) { foreach(_framework, invoker.extra_system_frameworks) {
code_signing_args += [ "-F=" + _framework ] if (ios_enable_relative_sdk_path) {
_framework_path = rebase_path(_framework, root_build_dir)
} else {
_framework_path = _framework
}
code_signing_args += [ "-F=$_framework_path" ]
} }
} }
if (defined(invoker.partial_info_plist)) { if (defined(invoker.partial_info_plist)) {
...@@ -1800,9 +1805,8 @@ template("ios_xctest_test") { ...@@ -1800,9 +1805,8 @@ template("ios_xctest_test") {
# Xcode needs the following frameworks installed in the application (and # Xcode needs the following frameworks installed in the application (and
# signed) for the XCTest to run, so install them using # signed) for the XCTest to run, so install them using
# extra_system_frameworks. # extra_system_frameworks.
_ios_platform_library = "$ios_sdk_platform_path/Developer/Library"
extra_system_frameworks = [ extra_system_frameworks = [
"$_ios_platform_library/Frameworks/XCTest.framework", "$ios_sdk_platform_path/Developer/Library/Frameworks/XCTest.framework",
"$ios_sdk_platform_path/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework", "$ios_sdk_platform_path/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework",
"$ios_sdk_platform_path/Developer/usr/lib/libXCTestBundleInject.dylib", "$ios_sdk_platform_path/Developer/usr/lib/libXCTestBundleInject.dylib",
] ]
......
...@@ -13,10 +13,13 @@ import re ...@@ -13,10 +13,13 @@ import re
import subprocess import subprocess
import sys import sys
# src directory
ROOT_SRC_DIR = os.path.dirname(
os.path.dirname(
os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
# src/build/xcode_links # src/build/xcode_links
XCODE_LINK_DIR = os.path.join( XCODE_LINK_DIR = os.path.join(ROOT_SRC_DIR, "build", "xcode_links")
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.realpath(__file__)))), "xcode_links")
# This script prints information about the build system, the operating # This script prints information about the build system, the operating
# system and the iOS or Mac SDK (depending on the platform "iphonesimulator", # system and the iOS or Mac SDK (depending on the platform "iphonesimulator",
...@@ -112,7 +115,8 @@ def CreateXcodeSymlinkUnderChromiumSource(src): ...@@ -112,7 +115,8 @@ def CreateXcodeSymlinkUnderChromiumSource(src):
if os.path.islink(dst): if os.path.islink(dst):
os.unlink(dst) os.unlink(dst)
os.symlink(src, dst) os.symlink(src, dst)
return dst
return '//' + os.path.relpath(dst, ROOT_SRC_DIR)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -29,9 +29,8 @@ template("ios_eg2_test_app_host") { ...@@ -29,9 +29,8 @@ template("ios_eg2_test_app_host") {
# Xcode needs the following frameworks installed in the application (and # Xcode needs the following frameworks installed in the application (and
# signed) for the XCTest to run, so install them using # signed) for the XCTest to run, so install them using
# extra_system_frameworks. # extra_system_frameworks.
_ios_platform_library = "$ios_sdk_platform_path/Developer/Library"
extra_system_frameworks = [ extra_system_frameworks = [
"$_ios_platform_library/Frameworks/XCTest.framework", "$ios_sdk_platform_path/Developer/Library/Frameworks/XCTest.framework",
"$ios_sdk_platform_path/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework", "$ios_sdk_platform_path/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework",
] ]
......
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