From b40326875cd9b3374fb8d02b14cf1bf588343abe Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 13 Dec 2018 21:56:53 +0100 Subject: [PATCH] Remove prebuilt v8 support --- Docs.md | 11 ------- libdeno/BUILD.gn | 25 ++-------------- libdeno/deno.gni | 5 ---- prebuilt/.gitignore | 2 -- prebuilt/linux64/libv8.a.sha1 | 1 - prebuilt/mac/libv8.a.sha1 | 1 - prebuilt/win/v8.lib.sha1 | 1 - prebuilt/win/v8_debug.lib.sha1 | 1 - tools/gcloud_upload.py | 54 ---------------------------------- tools/prebuilt.py | 35 ---------------------- tools/setup.py | 2 -- 11 files changed, 3 insertions(+), 135 deletions(-) delete mode 100644 prebuilt/.gitignore delete mode 100644 prebuilt/linux64/libv8.a.sha1 delete mode 100644 prebuilt/mac/libv8.a.sha1 delete mode 100644 prebuilt/win/v8.lib.sha1 delete mode 100644 prebuilt/win/v8_debug.lib.sha1 delete mode 100755 tools/gcloud_upload.py delete mode 100644 tools/prebuilt.py diff --git a/Docs.md b/Docs.md index 4dee6979a1..8aa1c42447 100644 --- a/Docs.md +++ b/Docs.md @@ -387,17 +387,6 @@ We use Flatbuffers to define common structs and enums between TypeScript and Rust. These common data structures are defined in https://github.com/denoland/deno/blob/master/src/msg.fbs -### Internal: Updating prebuilt binaries - -V8 takes a long time to build - on the order of an hour. We use pre-built V8 -libraries stored in a Google Storage bucket instead of rebuilding it from -scratch each time. Our build system is however setup such that we can build V8 -as part of the Deno build if necessary (useful for debugging or changing various -configurations in V8, or building the pre-built binaries themselves). To control -whether to use a pre-built V8 or not use the `use_v8_prebuilt` GN argument. - -Use `tools/gcloud_upload.py` to upload new prebuilt files. - ## Contributing See diff --git a/libdeno/BUILD.gn b/libdeno/BUILD.gn index 92c5b804e0..c9471e5bde 100644 --- a/libdeno/BUILD.gn +++ b/libdeno/BUILD.gn @@ -41,28 +41,9 @@ v8_static_library("libdeno") { "file_util.h", "internal.h", ] - if (!use_prebuilt_v8) { - public_deps = [ - ":v8", - ] - } else { - # TODO(ry) It would be nice to have a standalone target for the prebuilt - # library that could simply be added to the deps here, but it wasn't - # obvious how to accomplish that in gn. - if (is_mac) { - libs = [ "//prebuilt/mac/libv8.a" ] - } else if (is_linux) { - libs = [ "//prebuilt/linux64/libv8.a" ] - } else if (is_win) { - if (is_debug) { - libs = [ "//prebuilt/win/v8_debug.lib" ] - } else { - libs = [ "//prebuilt/win/v8.lib" ] - } - } else { - assert(false, "We don't have prebuilt binaries for this platform yet.") - } - } + public_deps = [ + ":v8", + ] } v8_executable("snapshot_creator") { diff --git a/libdeno/deno.gni b/libdeno/deno.gni index d81fedc72d..64869a284c 100644 --- a/libdeno/deno.gni +++ b/libdeno/deno.gni @@ -1,11 +1,6 @@ # Copyright 2018 the Deno authors. All rights reserved. MIT license. import("//build/compiled_action.gni") -declare_args() { - # Use prebuilt V8 libraries from //prebuilt/ - use_prebuilt_v8 = true -} - template("run_node") { action(target_name) { forward_variables_from(invoker, "*") diff --git a/prebuilt/.gitignore b/prebuilt/.gitignore deleted file mode 100644 index 09cabcb079..0000000000 --- a/prebuilt/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.a -*.lib diff --git a/prebuilt/linux64/libv8.a.sha1 b/prebuilt/linux64/libv8.a.sha1 deleted file mode 100644 index 4438635822..0000000000 --- a/prebuilt/linux64/libv8.a.sha1 +++ /dev/null @@ -1 +0,0 @@ -3728bfff7eb91e4e2c96999d974573e4d697e663 \ No newline at end of file diff --git a/prebuilt/mac/libv8.a.sha1 b/prebuilt/mac/libv8.a.sha1 deleted file mode 100644 index 2f2fcce0c1..0000000000 --- a/prebuilt/mac/libv8.a.sha1 +++ /dev/null @@ -1 +0,0 @@ -597ca3bbcdc6edbaf23905988f9ca9911bb23250 \ No newline at end of file diff --git a/prebuilt/win/v8.lib.sha1 b/prebuilt/win/v8.lib.sha1 deleted file mode 100644 index 724cbca6ee..0000000000 --- a/prebuilt/win/v8.lib.sha1 +++ /dev/null @@ -1 +0,0 @@ -052b261b8f8a7fc3f1babeb510d5bd73af0bcece \ No newline at end of file diff --git a/prebuilt/win/v8_debug.lib.sha1 b/prebuilt/win/v8_debug.lib.sha1 deleted file mode 100644 index ed962c241a..0000000000 --- a/prebuilt/win/v8_debug.lib.sha1 +++ /dev/null @@ -1 +0,0 @@ -e080ce76661b4d90f6e7879e58273d64344a9680 \ No newline at end of file diff --git a/tools/gcloud_upload.py b/tools/gcloud_upload.py deleted file mode 100755 index b919a1ed98..0000000000 --- a/tools/gcloud_upload.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# Prereq: -# - gcloud auth login -# - gcloud config set project deno-223616 -# This program uploads the specified file to GCloud Storage in the denoland -# bucket. It places a checksum file into the current directory using the base -# filename of the specified file. - -import os -import sys -import hashlib -from util import root_path, run -from third_party import tp - - -def print_usage(): - print "Usage: ./tools/gcloud_upload.py target/release/libv8.a" - sys.exit(1) - - -def compute_sha1(filename): - m = hashlib.sha1() - with open(filename) as f: - m.update(f.read()) - return m.hexdigest() - - -def main(argv): - if len(argv) != 2: - print_usage() - os.chdir(root_path) - - filename = sys.argv[1] - basename = os.path.basename(filename) - - sha1 = compute_sha1(filename) - print sha1 - - gs_url = "gs://denoland/" + sha1 - - #gsutil = tp("depot_tools/gsutil.py") - gsutil = "gsutil" # standalone installation - - run([gsutil, "cp", filename, gs_url]) - run([gsutil, "acl", "ch", "-u", "AllUsers:R", gs_url]) - - target_filename = basename + ".sha1" - with open(target_filename, 'w') as f: - f.write(sha1) - print "Wrote", target_filename - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/tools/prebuilt.py b/tools/prebuilt.py deleted file mode 100644 index 46763cc9f3..0000000000 --- a/tools/prebuilt.py +++ /dev/null @@ -1,35 +0,0 @@ -import sys -from util import run -from third_party import tp, google_env - - -def download_v8_prebuilt(): - if sys.platform == 'win32': - download_prebuilt("prebuilt/win/v8.lib.sha1") - # TODO Ideally we wouldn't have to download both builds of V8. - download_prebuilt("prebuilt/win/v8_debug.lib.sha1") - elif sys.platform.startswith('linux'): - download_prebuilt("prebuilt/linux64/libv8.a.sha1") - elif sys.platform == 'darwin': - download_prebuilt("prebuilt/mac/libv8.a.sha1") - - -def download_prebuilt(sha1_file): - run([ - "python", - tp('depot_tools/download_from_google_storage.py'), - '--platform=' + sys.platform, - '--no_auth', - '--bucket=denoland', - '--sha1_file', - sha1_file, - ], - env=google_env()) - - -def load(): - download_v8_prebuilt() - - -if __name__ == '__main__': - sys.exit(load()) diff --git a/tools/setup.py b/tools/setup.py index 31350c374e..0df13e8450 100755 --- a/tools/setup.py +++ b/tools/setup.py @@ -7,7 +7,6 @@ import os import re import sys from distutils.spawn import find_executable -import prebuilt def main(): @@ -19,7 +18,6 @@ def main(): third_party.download_gn() third_party.download_clang_format() third_party.download_clang() - prebuilt.load() third_party.maybe_download_sysroot() write_lastchange()