Commit 35383539 authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

Revert "Pull GN via CIPD package"

This reverts commit 0895c797.

Reason for revert: Missed a hardcoded gn location: https://crbug.com/857107.

Original change's description:
> Pull GN via CIPD package
> 
> The gn binary will be downloaded into third_party/gn. This CL rolls
> buildtools forward to a revision where gn is no longer in buildtools.
> 
> Because buildtools has no way to cleanup after itself, add
> build/util/gn_cleanup.py to delete the old binaries so that we don't
> accidentally depend on them.
> 
> Update mb.py to use the new location.
> 
> Update explicit location in ios/web_view/BUILD.gn for the new location.
> 
> Update explicit location in
> tools/traffic_annotation/auditor/traffic_annotation_auditor.cc for the new
> location.
> 
> Update explicit location in tools/licenses.py with for the new location.
> 
> Bug: 855791
> Bug: 794764
> Bug: 856883
> Bug: 856884
> Bug: 856878
> Bug: 856899
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
> Change-Id: I92c908faf4f868850eafa1b4adf6e7c33c365116
> Reviewed-on: https://chromium-review.googlesource.com/1112840
> Commit-Queue: Scott Graham <scottmg@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#570792}

TBR=dpranke@chromium.org,scottmg@chromium.org

Change-Id: I89e180710b5ce483106fa3b4ff6e8dec06780c07
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 855791, 794764, 856883, 856884, 856878, 856899
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/1117219Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570799}
parent d0ed5774
......@@ -121,7 +121,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling build tools
# and whatever else without interference from each other.
'buildtools_revision': 'f45682622e92e65482b3568bd15f39d227b5e078',
'buildtools_revision': '9c9fd97928dd45a0d9738af90f7c03b082f1216f',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling SwiftShader
# and whatever else without interference from each other.
......@@ -648,16 +648,6 @@ deps = {
'src/third_party/googletest/src':
Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + 'ce468a17c434e4e79724396ee1b51d86bfc8a88b',
'src/third_party/gn': {
'packages': [
{
'package': 'gn/gn/${{platform}}',
'version': 'git_revision:f30b5738e20fdd2f00eba6298c536d66c13b09e3',
},
],
'dep_type': 'cipd',
},
# GNU binutils assembler for x86-32.
'src/third_party/gnu_binutils': {
'url': Var('chromium_git') + '/native_client/deps/third_party/gnu_binutils.git' + '@' + 'f4003433b61b25666565690caf3d7a7a1a4ec436',
......@@ -1579,12 +1569,42 @@ hooks = [
'-s', 'src/third_party/skia',
'--header', 'src/skia/ext/skia_commit_hash.h'],
},
# Pull GN binaries. This needs to be before running GYP below.
{
'name': 'gn_win',
'pattern': '.',
'condition': 'host_os == "win"',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--no_auth',
'--bucket', 'chromium-gn',
'-s', 'src/buildtools/win/gn.exe.sha1',
],
},
{
# Clean up old gn binaries in buildtools to ensure we're not using them.
# TODO(scottmg): Remove this if it's 2019. https://crbug.com/855791.
'name': 'gn_cleanup',
'name': 'gn_mac',
'pattern': '.',
'action': ['python', 'src/build/util/gn_cleanup.py'],
'condition': 'host_os == "mac"',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--no_auth',
'--bucket', 'chromium-gn',
'-s', 'src/buildtools/mac/gn.sha1',
],
},
{
'name': 'gn_linux64',
'pattern': '.',
'condition': 'host_os == "linux"',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--no_auth',
'--bucket', 'chromium-gn',
'-s', 'src/buildtools/linux64/gn.sha1',
],
},
# Pull clang-format binaries using checked-in hashes.
{
......
# Copyright 2018 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.
import os
# This script is run as a DEPS hook, so the cwd is where .gclient is.
for p in (('linux64/gn', 'mac/gn', 'win/gn.exe')):
in_buildtools = os.path.join('src', 'buildtools', p)
if os.path.isfile(in_buildtools):
os.unlink(in_buildtools)
......@@ -429,7 +429,7 @@ if (additional_toolchains == [] || current_toolchain == default_toolchain) {
script = "//tools/licenses.py"
inputs = [
"//third_party/gn/gn",
"//buildtools/$host_os/gn",
]
outputs = [
_license_path,
......
......@@ -478,10 +478,19 @@ def FindThirdPartyDirsWithFiles(root):
# Many builders do not contain 'gn' in their PATH, so use the GN binary from
# //third_party/gn.
# //buildtools.
def _GnBinary():
exe = 'gn.exe' if sys.platform == 'win32' else 'gn'
return os.path.join(_REPOSITORY_ROOT, 'third_party', 'gn', exe)
exe = 'gn'
if sys.platform == 'linux2':
subdir = 'linux64'
elif sys.platform == 'darwin':
subdir = 'mac'
elif sys.platform == 'win32':
subdir, exe = 'win', 'gn.exe'
else:
raise RuntimeError("Unsupported platform '%s'." % sys.platform)
return os.path.join(_REPOSITORY_ROOT, 'buildtools', subdir, exe)
def GetThirdPartyDepsFromGNDepsOutput(gn_deps):
......
......@@ -916,8 +916,14 @@ class MetaBuildWrapper(object):
return err, labels
def GNCmd(self, subcommand, path, *args):
exe = 'gn.exe' if self.platform == 'win32' else 'gn'
gn_path = self.PathJoin(self.chromium_src_dir, 'third_party', 'gn', exe)
if self.platform == 'linux2':
subdir, exe = 'linux64', 'gn'
elif self.platform == 'darwin':
subdir, exe = 'mac', 'gn'
else:
subdir, exe = 'win', 'gn.exe'
gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe)
return [gn_path, subcommand, path] + list(args)
......
......@@ -340,7 +340,7 @@ class UnitTest(unittest.TestCase):
# Make sure we log both what is written to args.gn and the command line.
self.assertIn('Writing """', mbw.out)
self.assertIn('/fake_src/third_party/gn/gn gen //out/Default --check',
self.assertIn('/fake_src/buildtools/linux64/gn gen //out/Default --check',
mbw.out)
mbw = self.fake_mbw(win32=True)
......@@ -350,7 +350,7 @@ class UnitTest(unittest.TestCase):
('goma_dir = "c:\\\\goma"\n'
'is_debug = true\n'
'use_goma = true\n'))
self.assertIn('c:\\fake_src\\third_party\\gn\\gn.exe gen //out/Debug '
self.assertIn('c:\\fake_src\\buildtools\\win\\gn.exe gen //out/Debug '
'--check\n', mbw.out)
mbw = self.fake_mbw()
......@@ -581,7 +581,7 @@ class UnitTest(unittest.TestCase):
'is_debug = false\n'
'use_goma = true\n'
'""" to _path_/args.gn.\n\n'
'/fake_src/third_party/gn/gn gen _path_\n'))
'/fake_src/buildtools/linux64/gn gen _path_\n'))
def test_help(self):
orig_stdout = sys.stdout
......
......@@ -620,9 +620,11 @@ bool TrafficAnnotationAuditor::CheckIfCallCanBeUnannotated(
// Check if the file including this function is part of Chrome build.
const base::CommandLine::CharType* args[] = {
#if defined(OS_WIN)
FILE_PATH_LITERAL("third_party/gn/gn.exe"),
#elif defined(OS_MACOSX) || defined(OS_LINUX)
FILE_PATH_LITERAL("third_party/gn/gn"),
FILE_PATH_LITERAL("buildtools/win/gn.exe"),
#elif defined(OS_MACOSX)
FILE_PATH_LITERAL("buildtools/mac/gn"),
#elif defined(OS_LINUX)
FILE_PATH_LITERAL("buildtools/linux64/gn"),
#else
// Fallback to using PATH to find gn.
FILE_PATH_LITERAL("gn"),
......
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