fuchsia: Download the toolchain to distinct directories per build host

I like to share a single Crashpad checkout between my non-virtual
machine and some virtual machines. Downloaded toolchains, which vary by
build host configuration, must go in paths named for the build host.
(Chromium doesn’t do this, and it bugs me.)

Rather than downloading the Fuchsia toolchain to
third_party/fuchsia/clang, this puts it in
third_party/fuchsia/clang/{mac,linux}-amd64.

The Fuchsia SDK is only published on cipd for linux-amd64, but the
sysroot that it contains ought to be perfectly functional on any
suitably-equipped build host, so this also checks out that package
unconditionally.

Bug: crashpad:196
Change-Id: Iabd4f2dd1e2c06a3f7208b5c40432619983919ea
Reviewed-on: https://chromium-review.googlesource.com/794537
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Mark Mentovai 2017-11-29 10:08:56 -05:00 committed by Commit Bot
parent 2bb56fafe3
commit 5e16410ad4
2 changed files with 75 additions and 54 deletions

110
DEPS
View File

@ -38,9 +38,9 @@ hooks = [
{
'name': 'clang_format_mac',
'pattern': '.',
'condition': 'host_os == "mac"',
'action': [
'download_from_google_storage',
'--platform=^darwin$',
'--no_resume',
'--no_auth',
'--bucket=chromium-clang-format',
@ -48,25 +48,12 @@ hooks = [
'buildtools/mac/clang-format.sha1',
],
},
{
'name': 'clang_format_win',
'pattern': '.',
'action': [
'download_from_google_storage',
'--platform=^win32$',
'--no_resume',
'--no_auth',
'--bucket=chromium-clang-format',
'--sha1_file',
'buildtools/win/clang-format.exe.sha1',
],
},
{
'name': 'clang_format_linux',
'pattern': '.',
'condition': 'host_os == "linux"',
'action': [
'download_from_google_storage',
'--platform=^linux2?$',
'--no_resume',
'--no_auth',
'--bucket=chromium-clang-format',
@ -75,11 +62,24 @@ hooks = [
],
},
{
'name': 'gn_mac',
'name': 'clang_format_win',
'pattern': '.',
'condition': 'host_os == "win"',
'action': [
'download_from_google_storage',
'--no_resume',
'--no_auth',
'--bucket=chromium-clang-format',
'--sha1_file',
'buildtools/win/clang-format.exe.sha1',
],
},
{
'name': 'gn_mac',
'pattern': '.',
'condition': 'host_os == "mac"',
'action': [
'download_from_google_storage',
'--platform=^darwin$',
'--no_resume',
'--no_auth',
'--bucket=chromium-gn',
@ -87,25 +87,12 @@ hooks = [
'buildtools/mac/gn.sha1',
],
},
{
'name': 'gn_win',
'pattern': '.',
'action': [
'download_from_google_storage',
'--platform=^win32$',
'--no_resume',
'--no_auth',
'--bucket=chromium-gn',
'--sha1_file',
'buildtools/win/gn.exe.sha1',
],
},
{
'name': 'gn_linux',
'pattern': '.',
'condition': 'host_os == "linux"',
'action': [
'download_from_google_storage',
'--platform=^linux2?$',
'--no_resume',
'--no_auth',
'--bucket=chromium-gn',
@ -114,14 +101,67 @@ hooks = [
],
},
{
'name': 'fuchsia_clang',
'name': 'gn_win',
'pattern': '.',
'condition': 'host_os == "win"',
'action': [
'download_from_google_storage',
'--no_resume',
'--no_auth',
'--bucket=chromium-gn',
'--sha1_file',
'buildtools/win/gn.exe.sha1',
],
},
{
# This uses “cipd install” so that mac-amd64 and linux-amd64 can coexist
# peacefully. “cipd ensure” would remove the Linux package when running on a
# macOS build host and vice-versa. https://crbug.com/789364.
'name': 'fuchsia_clang_mac',
'pattern': '.',
'condition': 'checkout_fuchsia and host_os == "mac"',
'action': [
'cipd',
'install',
'fuchsia/clang/mac-amd64',
'latest',
'-root', 'crashpad/third_party/fuchsia/clang/mac-amd64',
'-log-level', 'info',
],
},
{
# This uses “cipd install” so that mac-amd64 and linux-amd64 can coexist
# peacefully. “cipd ensure” would remove the macOS package when running on a
# Linux build host and vice-versa. https://crbug.com/789364.
'name': 'fuchsia_clang_linux',
'pattern': '.',
'condition': 'checkout_fuchsia and host_os == "linux"',
'action': [
'cipd',
'install',
'fuchsia/clang/linux-amd64',
'latest',
'-root', 'crashpad/third_party/fuchsia/clang/linux-amd64',
'-log-level', 'info',
],
},
{
# The SDK is keyed to the host system because it contains build tools.
# Currently, linux-amd64 is the only SDK published (see
# https://chrome-infra-packages.appspot.com/#/?path=fuchsia/sdk). As long as
# this is the case, use that SDK package even on other build hosts. The
# sysroot (containing headers and libraries) and other components are
# related to the target and should be functional with an appropriate
# toolchain that runs on the build host (fuchsia_clang, above).
'name': 'fuchsia_sdk',
'pattern': '.',
'condition': 'checkout_fuchsia',
'action': [
'cipd',
'ensure',
'-ensure-file', 'crashpad/third_party/fuchsia/toolchain.ensure',
'-root', 'crashpad/third_party/fuchsia',
'install',
'fuchsia/sdk/linux-amd64',
'latest',
'-root', 'crashpad/third_party/fuchsia/sdk/linux-amd64',
'-log-level', 'info',
],
},

View File

@ -1,19 +0,0 @@
# Copyright 2017 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@Subdir clang
fuchsia/clang/${os}-${arch} latest
@Subdir sdk
fuchsia/sdk/${os=linux}-${arch} latest