Reland: [infra] Roll buildtools to c72a1c5aadde06505b7bb4641720880f3db28ff9

Tries to work around update.py race by setting up symlinks for 'git cl format'
instead of copying.

Change-Id: I4ed9b99254803feea5ea0e8d30db23fc982e9562
Reviewed-on: https://dart-review.googlesource.com/c/85427
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This commit is contained in:
Zach Anderson 2018-11-27 23:02:59 +00:00 committed by commit-bot@chromium.org
parent 232aa553fb
commit ad69aaef62
4 changed files with 36 additions and 27 deletions

2
DEPS
View file

@ -42,7 +42,7 @@ vars = {
# Fuchsia. This revision should be kept up to date with the revision pulled # Fuchsia. This revision should be kept up to date with the revision pulled
# by the Flutter engine. If there are problems with the toolchain, contact # by the Flutter engine. If there are problems with the toolchain, contact
# fuchsia-toolchain@. # fuchsia-toolchain@.
"buildtools_revision": "446d5b1019dcbe7835236dc85261e91cf29a9239", "buildtools_revision": "9e69ccfa6c1d3d9d3d0498c2b73338c169ed4377",
# Scripts that make 'git cl format' work. # Scripts that make 'git cl format' work.
"clang_format_scripts_rev": "c09c8deeac31f05bd801995c475e7c8070f9ecda", "clang_format_scripts_rev": "c09c8deeac31f05bd801995c475e7c8070f9ecda",

View file

@ -63,18 +63,16 @@ if (is_android) {
# Subdirectories inside android_ndk_root that contain the sysroot for the # Subdirectories inside android_ndk_root that contain the sysroot for the
# associated platform. # associated platform.
if (current_cpu == "x64" || current_cpu == "arm64") { if (current_cpu == "x64" || current_cpu == "arm64") {
_android_api_level = 22 android_api_level = 22
} else { } else {
_android_api_level = 16 android_api_level = 16
} }
x86_android_sysroot_subdir = x86_android_sysroot_subdir = "platforms/android-${android_api_level}/arch-x86"
"platforms/android-${_android_api_level}/arch-x86" arm_android_sysroot_subdir = "platforms/android-${android_api_level}/arch-arm"
arm_android_sysroot_subdir =
"platforms/android-${_android_api_level}/arch-arm"
x86_64_android_sysroot_subdir = x86_64_android_sysroot_subdir =
"platforms/android-${_android_api_level}/arch-x86_64" "platforms/android-${android_api_level}/arch-x86_64"
arm64_android_sysroot_subdir = arm64_android_sysroot_subdir =
"platforms/android-${_android_api_level}/arch-arm64" "platforms/android-${android_api_level}/arch-arm64"
# Toolchain root directory for each build. The actual binaries are inside # Toolchain root directory for each build. The actual binaries are inside
# a "bin" directory inside of these. # a "bin" directory inside of these.
@ -90,25 +88,29 @@ if (is_android) {
# like the toolchain roots. # like the toolchain roots.
if (current_cpu == "x86") { if (current_cpu == "x86") {
android_prebuilt_arch = "android-x86" android_prebuilt_arch = "android-x86"
_binary_prefix = "i686-linux-android" android_target_triple = "i686-linux-android"
android_toolchain_root = "$x86_android_toolchain_root" android_toolchain_root = "$x86_android_toolchain_root"
android_sysroot_subdir = "$x86_android_sysroot_subdir"
} else if (current_cpu == "arm") { } else if (current_cpu == "arm") {
android_prebuilt_arch = "android-arm" android_prebuilt_arch = "android-arm"
_binary_prefix = "arm-linux-androideabi" android_target_triple = "arm-linux-androideabi"
android_toolchain_root = "$arm_android_toolchain_root" android_toolchain_root = "$arm_android_toolchain_root"
android_sysroot_subdir = "$arm_android_sysroot_subdir"
} else if (current_cpu == "x64") { } else if (current_cpu == "x64") {
android_prebuilt_arch = "android-x86_64" android_prebuilt_arch = "android-x86_64"
_binary_prefix = "x86_64-linux-android" android_target_triple = "x86_64-linux-android"
android_toolchain_root = "$x86_64_android_toolchain_root" android_toolchain_root = "$x86_64_android_toolchain_root"
android_sysroot_subdir = "$x86_64_android_sysroot_subdir"
} else if (current_cpu == "arm64") { } else if (current_cpu == "arm64") {
android_prebuilt_arch = "android-arm64" android_prebuilt_arch = "android-arm64"
_binary_prefix = "aarch64-linux-android" android_target_triple = "aarch64-linux-android"
android_toolchain_root = "$arm64_android_toolchain_root" android_toolchain_root = "$arm64_android_toolchain_root"
android_sysroot_subdir = "$arm64_android_sysroot_subdir"
} else { } else {
assert(false, "Need android libgcc support for your target arch.") assert(false, "Need android libgcc support for your target arch.")
} }
android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" android_tool_prefix = "$android_toolchain_root/bin/$android_target_triple-"
android_readelf = "${android_tool_prefix}readelf" android_readelf = "${android_tool_prefix}readelf"
android_objcopy = "${android_tool_prefix}objcopy" android_objcopy = "${android_tool_prefix}objcopy"
android_gdbserver = android_gdbserver =

View file

@ -246,11 +246,14 @@ config("compiler") {
ldflags += [ "-pthread" ] ldflags += [ "-pthread" ]
if (is_clang) { if (is_clang) {
if (current_cpu == "arm") { if (current_cpu == "arm") {
cflags += [ "--target=arm-linux-gnueabihf" ] cflags += [ "--target=armv7-linux-gnueabihf" ]
ldflags += [ "--target=arm-linux-gnueabihf" ] ldflags += [ "--target=armv7-linux-gnueabihf" ]
} else if (current_cpu == "arm64") { } else if (current_cpu == "arm64") {
cflags += [ "--target=aarch64-linux-gnu" ] cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ]
} else if (current_cpu == "x86") {
cflags += [ "--target=i386-linux-gnu" ]
ldflags += [ "--target=i386-linux-gnu" ]
} }
} }
} }
@ -278,6 +281,7 @@ config("compiler") {
"-ffunction-sections", "-ffunction-sections",
"-funwind-tables", "-funwind-tables",
"-fno-short-enums", "-fno-short-enums",
"-nostdinc++",
] ]
if (!is_clang) { if (!is_clang) {
# Clang doesn't support these flags. # Clang doesn't support these flags.
@ -444,14 +448,17 @@ config("runtime_library") {
# strange errors. The include ordering here is important; change with # strange errors. The include ordering here is important; change with
# caution. # caution.
cflags += [ cflags += [
"-isystem" + "-isystem" + rebase_path("$android_libcpp_root/include", root_build_dir),
rebase_path("$android_libcpp_root/libcxx/include", root_build_dir),
"-isystem" + rebase_path( "-isystem" + rebase_path(
"$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include", "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/include",
root_build_dir), root_build_dir),
"-isystem" + "-isystem" +
rebase_path("$android_ndk_root/sources/android/support/include", rebase_path("$android_ndk_root/sources/android/support/include",
root_build_dir), root_build_dir),
"-isystem" + rebase_path(
"$android_ndk_root/sysroot/usr/include/$android_target_triple",
root_build_dir),
"-D__ANDROID_API__=$android_api_level",
] ]
lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ]
@ -692,7 +699,7 @@ if (is_win) {
"-Wl,--gc-sections", "-Wl,--gc-sections",
] ]
if (is_clang) { if (is_clang && !using_sanitizer) {
# Identical code folding to reduce size. # Identical code folding to reduce size.
# Warning: This changes C/C++ semantics of function pointer comparison. # Warning: This changes C/C++ semantics of function pointer comparison.
common_optimize_on_ldflags += [ "-Wl,--icf=all" ] common_optimize_on_ldflags += [ "-Wl,--icf=all" ]

View file

@ -24,7 +24,7 @@ DEPOT_PATH = find_depot_tools.add_depot_tools_to_path()
def Update(): def Update():
path = os.path.join(BUILDTOOLS, 'update.sh') path = os.path.join(BUILDTOOLS, 'update.sh')
command = ['/bin/bash', path, '--clang', '--gn'] command = ['/bin/bash', path ]
return subprocess.call(command, cwd=DART_ROOT) return subprocess.call(command, cwd=DART_ROOT)
@ -72,9 +72,9 @@ def UpdateClangFormatOnWindows():
return subprocess.call(download_cmd) return subprocess.call(download_cmd)
# On Mac and Linux we copy clang-format and gn to the place where git cl format # On Mac and Linux we symlink clang-format and gn to the place where
# expects them to be. # 'git cl format' expects them to be.
def CopyClangFormat(): def LinksForGitCLFormat():
if sys.platform == 'darwin': if sys.platform == 'darwin':
platform = 'darwin' platform = 'darwin'
tools = 'mac' tools = 'mac'
@ -95,8 +95,8 @@ def CopyClangFormat():
os.makedirs(dest_dir) os.makedirs(dest_dir)
clang_format_dest = os.path.join(dest_dir, 'clang-format') clang_format_dest = os.path.join(dest_dir, 'clang-format')
gn_dest = os.path.join(dest_dir, 'gn') gn_dest = os.path.join(dest_dir, 'gn')
shutil.copy2(clang_format, clang_format_dest) os.symlink(clang_format, clang_format_dest)
shutil.copy2(gn, gn_dest) os.symlink(gn, gn_dest)
return 0 return 0
@ -113,7 +113,7 @@ def main(argv):
return UpdateClangFormatOnWindows() return UpdateClangFormatOnWindows()
if Update() != 0: if Update() != 0:
return 1 return 1
return CopyClangFormat() return LinksForGitCLFormat()
if __name__ == '__main__': if __name__ == '__main__':