Skip to content

Commit

Permalink
gitignore vim .swp files
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 27, 2018
1 parent 60a3b98 commit 65cce40
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# build
*.swp
/out/
/target/
*.pyc
Expand Down
3 changes: 1 addition & 2 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ default_args = {
# for now. See http:https://clang.llvm.org/docs/ControlFlowIntegrity.html
is_cfi = false

is_component_build = false
symbol_level = 1
treat_warnings_as_errors = true
rust_treat_warnings_as_errors = true
Expand All @@ -44,7 +43,7 @@ default_args = {
v8_experimental_extra_library_files = []
v8_extra_library_files = []
v8_imminent_deprecation_warnings = false
v8_monolithic = true
v8_monolithic = false
v8_untrusted_code_mitigations = false
v8_use_external_startup_data = false
v8_use_snapshot = true
Expand Down
44 changes: 35 additions & 9 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,23 @@ v8_executable("test_cc") {
configs = [ ":deno_config" ]
}

v8_static_library("v8") {
public_deps = [
"third_party/v8:v8",
"third_party/v8:v8_libbase",
"third_party/v8:v8_libplatform",
"third_party/v8:v8_libsampler",
"//build/win:default_exe_manifest",
]
configs = [ ":deno_config" ]
}

# Only functionality needed for libdeno_test and snapshot_creator
# In particular no flatbuffers, no assets, no rust, no msg handlers.
# Because snapshots are slow, it's important that snapshot_creator's
# dependencies are minimal.
static_library("libdeno") {
v8_static_library("libdeno") {
configs = [ ":deno_config" ]
sources = [
"libdeno/api.cc",
"libdeno/binding.cc",
Expand All @@ -231,30 +243,44 @@ static_library("libdeno") {
"libdeno/file_util.h",
"libdeno/internal.h",
]
public_deps = [
"third_party/v8:v8_monolith",
]
configs += [ ":deno_config" ]
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) {
libs = [ "//prebuilt/win/v8.lib" ]
} else {
assert(false, "We don't have prebuilt binaries for this platform yet.")
}
}
}

static_library("deno_deps") {
v8_static_library("deno_deps") {
complete_static_lib = true
public_deps = [
":libdeno",
":msg_rs",
":snapshot",
]
configs += [ ":deno_config" ]
configs = [ ":deno_config" ]
}

executable("snapshot_creator") {
v8_executable("snapshot_creator") {
sources = [
"libdeno/snapshot_creator.cc",
]
deps = [
":libdeno",
]
configs += [ ":deno_config" ]
configs = [ ":deno_config" ]
}

# Generates the core TypeScript type library for deno that will be
Expand Down
11 changes: 11 additions & 0 deletions Docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@ 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
Expand Down
5 changes: 5 additions & 0 deletions build_extra/deno.gni
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# 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, "*")
Expand Down
2 changes: 2 additions & 0 deletions tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import sys
from distutils.spawn import find_executable
import prebuilt


def main():
Expand All @@ -18,6 +19,7 @@ def main():
third_party.download_gn()
third_party.download_clang_format()
third_party.download_clang()
prebuilt.load()
third_party.maybe_download_sysroot()

write_lastchange()
Expand Down

0 comments on commit 65cce40

Please sign in to comment.