[dart] remove prebuilt-dart-sdk directory
This is no longer used since the prebuilt is managed by cipd.
Change-Id: Ied36de6939b091d332b9beea0cb3a511d45d3544
Reviewed-on: https://fuchsia-review.googlesource.com/c/topaz/+/442716
Reviewed-by: David Murphy <djmurphy@google.com>
Testability-Review: Chase Latta <chaselatta@google.com>
Commit-Queue: Chase Latta <chaselatta@google.com>
diff --git a/tools/prebuilt-dart-sdk/.gitignore b/tools/prebuilt-dart-sdk/.gitignore
deleted file mode 100644
index 607da10..0000000
--- a/tools/prebuilt-dart-sdk/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*-*/
diff --git a/tools/prebuilt-dart-sdk/README.md b/tools/prebuilt-dart-sdk/README.md
deleted file mode 100644
index d0f61fe..0000000
--- a/tools/prebuilt-dart-sdk/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-This directory contains prebuilt Dart SDK packages downloaded from
-[CIPD](https://github.com/luci/luci-go/tree/master/cipd).
-These are built by Fuchsia [bots](https://luci-milo.appspot.com/p/fuchsia/g/dart-prebuilt/console)
-using a [recipe](https://fuchsia.googlesource.com/infra/recipes/+/master/recipes/dart_toolchain.py).
-
-The prebuilt version must match the sources in //third_party/dart exactly.
-The [`update.py` script](update.py) downloads a package for the build host
-that matches the current Dart revision according to `jiri project`. It's
-run automatically by the Jiri [manifest](../../manifest/minimal) but can
-also be run by hand at any time. Run it with `--help` for details.
-
-If there is no prebuilt for your build host, then you'll have to supply your
-own. It's a normal `dart-sdk` built for the build host, but it also needs
-`bin/gen_shapshot.OS-CPU` and `bin/gen_shapshot_product.OS-CPU`. These run
-on the build host but target a corresponding Dart VM built for `OS-CPU`.
-The Fuchsia GN build will run those for both `$host_os-$host_cpu`
-(e.g. `linux-x64`) and `$target_os-$target_cpu` (e.g. `fuchsia-arm64`).
-This all must be built from Dart sources that exactly match the version in
-//third_dart/dart that will be built in the Fuchsia GN build.
-
-The GN build argument `prebuilt_dart_sdk` sets the directory where GN will
-look for Dart. Its default is the `$host_os-$host_cpu` subdirectory here,
-where the [`update.py` script](update.py) unpacks it by default. To use a
-different build of Dart, just set that in `args.gn`.
diff --git a/tools/prebuilt-dart-sdk/update.py b/tools/prebuilt-dart-sdk/update.py
deleted file mode 100755
index fb9f5e0..0000000
--- a/tools/prebuilt-dart-sdk/update.py
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2018 The Fuchsia 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 argparse
-import json
-import os
-import platform
-import pipes
-import subprocess
-import sys
-
-
-SCRIPT_DIR = os.path.dirname(__file__)
-FUCHSIA_ROOT = os.path.normpath(os.path.join(
- SCRIPT_DIR, os.path.pardir, os.path.pardir, os.path.pardir))
-CIPD = os.path.join(FUCHSIA_ROOT, 'buildtools', 'cipd')
-
-DEFAULT_PACKAGE = 'fuchsia/dart-sdk'
-DEFAULT_CHECKOUT = os.path.join(FUCHSIA_ROOT, 'third_party', 'dart')
-VERIFIED_PLATFORMS = [
- 'linux-amd64',
- #'linux-arm64', TODO(mcgrathr): later
- 'mac-amd64',
-]
-
-ARCH_MAP = {
- 'x86_64': ('amd64', 'x64'),
- 'x64': ('amd64', 'x64'),
- 'aarch64': ('arm64', 'arm64'),
-}
-OS_MAP = { 'darwin': 'mac' }
-
-
-def main():
- cipd_arch = platform.machine()
- cipd_arch, gn_arch = ARCH_MAP.get(cipd_arch, (cipd_arch, cipd_arch))
- cipd_os = platform.system().lower()
- cipd_os = OS_MAP.get(cipd_os, cipd_os)
- cipd_platform = '%s-%s' % (cipd_os, cipd_arch)
- gn_platform = '%s-%s' % (cipd_os, gn_arch)
-
- parser = argparse.ArgumentParser(
- add_help=True,
- formatter_class=argparse.ArgumentDefaultsHelpFormatter,
- description='''
-Front-end to [cipd](https://github.com/luci/luci-go/tree/master/cipd)
-for the [Fuchsia dart-sdk prebuilt](https://fuchsia.googlesource.com/infra/recipes/+/master/recipes/dart_toolchain.py).
-''',
- epilog='''
-Verifies the matching version exists for all platforms (%(platforms)s).
-Then downloads and unpacks (if necessary) the package for
-the current host platform (%(host_platform)s) into DIRECTORY.
-
-Default for --version is `git_revision:COMMITHASH`.
-
-Default COMMITHASH is the current `HEAD` in the CHECKOUT directory.
-''' % {
- 'host_platform': cipd_platform,
- 'platforms': ', '.join(VERIFIED_PLATFORMS),
-})
- parser.add_argument('--cipd',
- help='CIPD binary to run',
- metavar='FILE',
- default=CIPD)
- parser.add_argument('--output',
- metavar='DIRECTORY',
- help='Where to unpack the prebuilt',
- default=os.path.relpath(os.path.join(SCRIPT_DIR,
- gn_platform)))
- parser.add_argument('--package',
- help='CIPD package name prefix (before `/PLATFORM`)',
- metavar='PACKAGE',
- default=DEFAULT_PACKAGE)
- parser.add_argument('--platform',
- help='CIPD platform name to download',
- metavar='CIPD_PLATFORM',
- default='${platform}')
- parser.add_argument('--checkout',
- metavar='CHECKOUT',
- help='Directory containing the Dart checkout',
- default=DEFAULT_CHECKOUT)
- parser.add_argument('--revision',
- metavar='COMMITHASH',
- help='dart/sdk git revision of prebuilt to download')
- parser.add_argument('--root',
- metavar='ROOTDIR',
- help='CIPD root (parent of `.cipd` subdirectory)',
- default=SCRIPT_DIR)
- parser.add_argument('--verbose',
- action='store_true',
- help='Show CIPD commands and use -log-level info')
- parser.add_argument('--version',
- help='CIPD tag or ref to search for, e.g. "latest"')
- args = parser.parse_args()
- if args.version and args.revision:
- parser.usage('--version supercedes --revision; cannot use both')
-
- git_cmd = [ 'git', '-C', args.checkout, 'rev-parse', 'HEAD' ]
- version = args.version or ('git_revision:' + (
- args.revision or subprocess.check_output(git_cmd).strip()))
-
- ensure_file = ('$ParanoidMode CheckPresence\n' +
- reduce(lambda file, platform:
- file + ('$VerifiedPlatform %s\n' % platform),
- VERIFIED_PLATFORMS, '') +
- ('@Subdir %s\n' % os.path.relpath(args.output, args.root)) +
- ('%s/%s %s\n' % (args.package, args.platform, version)))
-
- def cipd(verify):
- command = [args.cipd]
- if verify:
- command.append('ensure-file-verify')
- else:
- command += ['ensure', '-root', args.root]
- command += [
- '-ensure-file',
- '-',
- '-log-level',
- 'info' if args.verbose else 'warning',
- ]
- if args.verbose:
- print '+ %s <<\\EOF' % ' '.join(map(pipes.quote, command))
- print ensure_file + 'EOF'
- proc = subprocess.Popen(command, stdin=subprocess.PIPE)
- proc.communicate(ensure_file)
- return proc.returncode
-
- return cipd(True) or cipd(False)
-
-
-if __name__ == "__main__":
- sys.exit(main())