From f3482700474a791dabe9c4783568ed0fe512b04d Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 17 Jul 2019 11:35:58 -0700 Subject: [PATCH] Simplify buildtools (#9875) Move GN, only get clang --- .gitignore | 3 +++ DEPS | 34 +++++++++++++++++++------------ ci/check_gn_format.py | 2 +- ci/format.sh | 2 +- ci/licenses_golden/tool_signature | 2 +- tools/gn | 11 ++-------- tools/licenses/lib/main.dart | 23 +++++++++++---------- 7 files changed, 41 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 225943503..9fe4f1b42 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ pubspec.lock .vscode/ docs/doxygen/ xcuserdata + +third_party/gn/ + diff --git a/DEPS b/DEPS index 3ac22bfbc..ebce54998 100644 --- a/DEPS +++ b/DEPS @@ -107,8 +107,6 @@ vars = { # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', - 'buildtools_revision': 'bac220c15490dcf7b7d8136f75100bbc77e8d217', - # Checkout Android dependencies only on platforms where we build for Android targets. 'download_android_deps': 'host_os == "mac" or host_os == "linux"', @@ -163,9 +161,6 @@ deps = { # As part of integrating with Fuchsia, we should eventually remove all these # Chromium-style dependencies. - 'src/buildtools': - Var('fuchsia_git') + '/buildtools' + '@' + Var('buildtools_revision'), - 'src/ios_tools': Var('chromium_git') + '/chromium/src/ios.git' + '@' + Var('ios_tools_revision'), @@ -473,6 +468,27 @@ deps = { 'dep_type': 'cipd', }, + 'src/flutter/third_party/gn': { + 'packages': [ + { + 'package': 'gn/gn/${{platform}}', + 'version': 'git_revision:bdb0fd02324b120cacde634a9235405061c8ea06' + }, + ], + 'dep_type': 'cipd', + }, + + 'src/buildtools/{host_os}-x64/clang': { + 'packages': [ + { + 'package': 'fuchsia/clang/${{platform}}', + 'version': 'git_revision:de39621f0f03f20633bdfa50bde97a3908bf6e98' + } + ], + 'condition': 'host_os == "mac" or host_os == "linux"', + 'dep_type': 'cipd', + }, + # Get the SDK from https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core at the 'latest' tag # Get the toolchain from https://chrome-infra-packages.appspot.com/p/fuchsia/clang at the 'goma' tag @@ -546,14 +562,6 @@ hooks = [ 'src/flutter/tools/android_support/download_android_support.py', ], }, - { - 'name': 'buildtools', - 'pattern': '.', - 'action': [ - 'python', - 'src/tools/buildtools/update.py', - ], - }, { 'name': 'generate_package_files', 'pattern': '.', diff --git a/ci/check_gn_format.py b/ci/check_gn_format.py index 528287452..f4f37a228 100755 --- a/ci/check_gn_format.py +++ b/ci/check_gn_format.py @@ -43,7 +43,7 @@ def main(): if subprocess.call(gn_command + [ gn_file ]) != 0: print "ERROR: '%s' is incorrectly formatted." % os.path.relpath(gn_file, args.root_directory) print "Format the same with 'gn format' using the 'gn' binary in //buildtools." - print "Or, run ./ci/check_gn_format.py with '--dry-run false'" + print "Or, run ./ci/check_gn_format.py with '--dry-run false'" return -1 return 0 diff --git a/ci/format.sh b/ci/format.sh index e3c8533af..ceacb5af0 100755 --- a/ci/format.sh +++ b/ci/format.sh @@ -75,4 +75,4 @@ if [[ ! -z "$TRAILING_SPACES" ]]; then fi # Check GN format consistency -./ci/check_gn_format.py --dry-run true --root-directory . --gn-binary "../buildtools/$OS/gn" +./ci/check_gn_format.py --dry-run true --root-directory . --gn-binary "third_party/gn/gn" diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index c6230444b..15ae884bb 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: 028d24b0ed18e117e64d68853b628ca9 +Signature: aceb453d2bca05fab3734ed5f7949c51 diff --git a/tools/gn b/tools/gn index 4ea925918..0a6b29fdd 100755 --- a/tools/gn +++ b/tools/gn @@ -345,17 +345,10 @@ def parse_args(args): def main(argv): args = parse_args(argv) - if sys.platform.startswith(('cygwin', 'win')): - subdir = 'win' - elif sys.platform == 'darwin': - subdir = 'mac-x64' - elif sys.platform.startswith('linux'): - subdir = 'linux-x64' - else: - raise Error('Unknown platform: ' + sys.platform) + exe = '.exe' if sys.platform.startswith(('cygwin', 'win')) else '' command = [ - '%s/buildtools/%s/gn' % (SRC_ROOT, subdir), + '%s/flutter/third_party/gn/gn%s' % (SRC_ROOT, exe), 'gen', '--check', ] diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index e190fc990..1a55dcc42 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -926,17 +926,18 @@ class _RepositoryDirectory extends _RepositoryEntry implements LicenseSource { List<_RepositoryDirectory> get virtualSubdirectories => <_RepositoryDirectory>[]; bool shouldRecurse(fs.IoNode entry) { - return entry.name != '.cipd' && - entry.name != '.git' && - entry.name != '.github' && - entry.name != '.gitignore' && - entry.name != '.vscode' && - entry.name != 'test' && - entry.name != 'test.disabled' && - entry.name != 'test_support' && - entry.name != 'tests' && - entry.name != 'javatests' && - entry.name != 'testing'; + return !entry.fullName.endsWith('third_party/gn') && + entry.name != '.cipd' && + entry.name != '.git' && + entry.name != '.github' && + entry.name != '.gitignore' && + entry.name != '.vscode' && + entry.name != 'test' && + entry.name != 'test.disabled' && + entry.name != 'test_support' && + entry.name != 'tests' && + entry.name != 'javatests' && + entry.name != 'testing'; } _RepositoryDirectory createSubdirectory(fs.Directory entry) { -- GitLab