1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 04:48:52 -05:00

Remove prebuilt v8 support

This commit is contained in:
Bert Belder 2018-12-13 21:56:53 +01:00 committed by Ryan Dahl
parent 0481d6c2c0
commit b40326875c
11 changed files with 3 additions and 135 deletions

11
Docs.md
View file

@ -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

View file

@ -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.")
}
}
}
v8_executable("snapshot_creator") {

View file

@ -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, "*")

2
prebuilt/.gitignore vendored
View file

@ -1,2 +0,0 @@
*.a
*.lib

View file

@ -1 +0,0 @@
3728bfff7eb91e4e2c96999d974573e4d697e663

View file

@ -1 +0,0 @@
597ca3bbcdc6edbaf23905988f9ca9911bb23250

View file

@ -1 +0,0 @@
052b261b8f8a7fc3f1babeb510d5bd73af0bcece

View file

@ -1 +0,0 @@
e080ce76661b4d90f6e7879e58273d64344a9680

View file

@ -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))

View file

@ -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())

View file

@ -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()