From 6830370c3e4f7d9f09c08fe76f8902193e027c1d Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sun, 1 Jul 2018 20:47:28 +0900 Subject: reorg: Move GN files to root (#309) refs: #285 --- .gclient | 38 +++++++++ .gitignore | 14 ++-- .gn | 44 +++++++++++ .travis.yml | 3 +- BUILD.gn | 185 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 7 +- build | 1 + build_overrides | 1 + buildtools | 1 + deno.gni | 189 +++++++++++++++++++++++++++++++++++++++++++++ src/.gclient | 38 --------- src/.gn | 44 ----------- src/BUILD.gn | 185 -------------------------------------------- src/build | 1 - src/build_overrides | 1 - src/buildtools | 1 - src/deno.gni | 189 --------------------------------------------- src/testing | 1 - src/third_party/googletest | 1 - src/third_party/jinja2 | 1 - src/third_party/llvm-build | 1 - src/third_party/markupsafe | 1 - src/tools/clang | 1 - testing | 1 + third_party/googletest | 1 + third_party/jinja2 | 1 + third_party/llvm-build | 1 + third_party/markupsafe | 1 + tools/clang | 1 + tools/format.sh | 3 - 30 files changed, 475 insertions(+), 482 deletions(-) create mode 100644 .gclient create mode 100644 .gn create mode 100644 BUILD.gn create mode 120000 build create mode 120000 build_overrides create mode 120000 buildtools create mode 100644 deno.gni delete mode 100644 src/.gclient delete mode 100644 src/.gn delete mode 100644 src/BUILD.gn delete mode 120000 src/build delete mode 120000 src/build_overrides delete mode 120000 src/buildtools delete mode 100644 src/deno.gni delete mode 120000 src/testing delete mode 120000 src/third_party/googletest delete mode 120000 src/third_party/jinja2 delete mode 120000 src/third_party/llvm-build delete mode 120000 src/third_party/markupsafe delete mode 120000 src/tools/clang create mode 120000 testing create mode 120000 third_party/googletest create mode 120000 third_party/jinja2 create mode 120000 third_party/llvm-build create mode 120000 third_party/markupsafe create mode 120000 tools/clang diff --git a/.gclient b/.gclient new file mode 100644 index 000000000..ec0dd52e5 --- /dev/null +++ b/.gclient @@ -0,0 +1,38 @@ +solutions = [{ + 'url': 'https://chromium.googlesource.com/v8/v8.git@6.8-lkgr', + 'name': 'v8', + 'deps_file': 'DEPS', + 'custom_deps': { + 'v8/third_party/catapult': None, + 'v8/third_party/colorama/src': None, + 'v8/testing/gmock': None, + 'v8/tools/swarming_client': None, + 'v8/third_party/instrumented_libraries': None, + 'v8/third_party/android_tools': None, + 'v8/test/wasm-js': None, + 'v8/test/benchmarks/data': None, + 'v8/test/mozilla/data': None, + 'v8/third_party/icu': None, + 'v8/test/test262/data': None, + 'v8/test/test262/harness': None, + 'v8/tools/luci-go': None + } +}, { + 'url': 'https://github.com/ry/protobuf_chromium.git', + 'name': 'third_party/protobuf', +}, { + 'url': + 'https://chromium.googlesource.com/chromium/src/tools/protoc_wrapper@9af82fef8cb9ca3ccc13e2ed958f58f2c21f449b', + 'name': + 'tools/protoc_wrapper' +}, { + 'url': + 'https://chromium.googlesource.com/chromium/src/third_party/zlib@39b4a6260702da4c089eca57136abf40a39667e9', + 'name': + 'third_party/zlib' +}, { + 'url': + 'https://github.com/rust-lang/libc.git@8a85d662b90c14d458bc4ae9521a05564e20d7ae', + 'name': + 'third_party/rust_crates/libc' +}] diff --git a/.gitignore b/.gitignore index 3d688b872..3e495ea25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -/src/out/ +/out/ node_modules -/src/v8/ -/src/tools/protoc_wrapper/ -/src/third_party/protobuf/ -/src/third_party/zlib/ -/src/third_party/rust_crates/libc/ -/src/.gclient_entries +/v8/ +/tools/protoc_wrapper/ +/third_party/protobuf/ +/third_party/zlib/ +/third_party/rust_crates/libc/ +/.gclient_entries diff --git a/.gn b/.gn new file mode 100644 index 000000000..1fd465e5c --- /dev/null +++ b/.gn @@ -0,0 +1,44 @@ +# This file is used by the GN meta build system to find the root of the source +# tree and to set startup options. For documentation on the values set in this +# file, run "gn help dotfile" at the command line. + +# The location of the build configuration file. +buildconfig = "//build/config/BUILDCONFIG.gn" + +# These are the targets to check headers for by default. The files in targets +# matching these patterns (see "gn help label_pattern" for format) will have +# their includes checked for proper dependencies when you run either +# "gn check" or "gn gen --check". +check_targets = [] + +default_args = { + # Various global chrome args that are unrelated to deno. + proprietary_codecs = false + safe_browsing_mode = 0 + toolkit_views = false + use_aura = false + use_dbus = false + use_gio = false + use_glib = false + use_ozone = false + use_udev = false + + is_component_build = false + symbol_level = 1 + treat_warnings_as_errors = false + + # https://cs.chromium.org/chromium/src/docs/ccache_mac.md + clang_use_chrome_plugins = false + + v8_deprecation_warnings = false + v8_embedder_string = "-deno" + v8_enable_gdbjit = false + v8_enable_i18n_support = false + v8_experimental_extra_library_files = [] + v8_extra_library_files = [] + v8_imminent_deprecation_warnings = false + v8_monolithic = true + v8_untrusted_code_mitigations = false + v8_use_external_startup_data = false + v8_use_snapshot = true +} diff --git a/.travis.yml b/.travis.yml index 662ed7a14..c73da8c94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,6 @@ before_install: | fi install: - export PATH=$PATH:$DEPOT_TOOLS_PATH - - cd src # Sync dependencies. # TODO(ry) These sync steps are very terrible and only here temporarily. # A single deno_deps git submodule should be created which contains V8, @@ -29,7 +28,7 @@ install: - curl -sSf https://sh.rustup.rs | sh -s -- -y - export PATH=$HOME/.cargo/bin:$PATH - rustc --version - - (cd js; yarn) + - (cd src/js; yarn) - gclient sync -j2 --no-history # ccache needs the custom LLVM to be in PATH and other variables. - export PATH=`pwd`/third_party/llvm-build/Release+Asserts/bin:$PATH diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 000000000..fcc10b98d --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,185 @@ +import("//third_party/protobuf/proto_library.gni") +import("//v8/gni/v8.gni") +import("//v8/snapshot_toolchain.gni") +import("deno.gni") + +config("deno_config") { + include_dirs = [ "v8" ] # This allows us to v8/src/base/ libraries. + configs = [ "v8:external_config" ] +} + +rust_executable("deno") { + source_root = "src/main.rs" + rust_deps = [ ":libc" ] + deps = [ + ":libdeno", + ] +} + +rust_library("libc") { + source_root = "third_party/rust_crates/libc/src/lib.rs" + cfg = [ + "feature=\"default\"", + "feature=\"use_std\"", + ] +} + +executable("mock_main") { + sources = [ + "src/mock_main.cc", + ] + deps = [ + ":libdeno", + ":msg_proto", + "//third_party/protobuf:protoc_lib", + ] + configs += [ ":deno_config" ] +} + +executable("mock_runtime_test") { + testonly = true + sources = [ + "src/file_util_test.cc", + "src/from_snapshot.cc", + "src/mock_runtime_test.cc", + ] + deps = [ + ":create_snapshot_mock_runtime", + ":deno_nosnapshot", + "//testing/gtest:gtest", + ] + defines = [ "DENO_MOCK_RUNTIME" ] + configs += [ ":deno_config" ] +} + +static_library("libdeno") { + complete_static_lib = true + sources = [ + "src/from_snapshot.cc", + ] + deps = [ + ":create_snapshot_deno", + ":deno_nosnapshot", + ] + configs += [ ":deno_config" ] +} + +v8_source_set("deno_nosnapshot") { + sources = [ + "src/deno.cc", + "src/deno_internal.h", + "src/file_util.cc", + "src/file_util.h", + "src/include/deno.h", + ] + deps = [ + "v8:v8_monolith", + ] + configs = [ ":deno_config" ] +} + +executable("snapshot_creator") { + sources = [ + "src/snapshot_creator.cc", + ] + deps = [ + ":deno_nosnapshot", + ] + configs += [ ":deno_config" ] +} + +proto_library("msg_proto") { + sources = [ + "src/msg.proto", + ] + generate_python = false +} + +run_node("bundle") { + out_dir = "$target_gen_dir/bundle/" + sources = [ + "src/js/main.ts", + "src/js/msg.pb.d.ts", + "src/js/msg.pb.js", + "src/js/package.json", # The `browserslist` field controls Babel behavior. + ] + outputs = [ + out_dir + "main.js", + ] + deps = [ + ":protobufjs", + ":run_tsc", + ] + args = [ + "./node_modules/parcel-bundler/bin/cli.js", + "build", + "--no-minify", + "--out-dir", + rebase_path(out_dir, root_build_dir), + rebase_path("src/js/main.ts", root_build_dir), + ] +} + +# Due to bugs in Parcel we must run TSC independently in order to catch errors. +# https://github.com/parcel-bundler/parcel/issues/954 +run_node("run_tsc") { + main = "src/js/main.ts" + tsconfig = "src/js/tsconfig.json" + out_dir = "$target_gen_dir/tsc_dist/" + sources = [ + "src/js/msg.pb.d.ts", + "src/js/msg.pb.js", + main, + tsconfig, + ] + outputs = [ + out_dir + "/main.js", + ] + deps = [ + ":protobufjs", + ] + args = [ + "./node_modules/typescript/bin/tsc", + "--project", + rebase_path(tsconfig, root_build_dir), + "--outDir", + rebase_path(out_dir, root_build_dir), + ] +} + +# Generates protobufjs code. +# TODO(ry) Ideally protobufjs output files should be written into +# target_gen_dir, but its difficult to get this working in a way that the +# bundler can resolve their location. (The bundler does not support NODE_PATH?) +# Therefore this hack: write the generated msg.pb.js and msg.pb.d.ts outputs +# into the js/ folder, and we check them into the repo. Hopefully this hack can +# be removed at some point. If msg.proto is changed, commit changes to the +# generated JS files. The stamp file is just to make gn work. +action("protobufjs") { + script = "src/js/pbjs_hack.py" + sources = [ + "src/msg.proto", + ] + outputs = [ + "$target_gen_dir/pbjs_hack.stamp", + ] + args = [ + rebase_path(sources[0], root_build_dir), + rebase_path(outputs[0], root_build_dir), + ] +} + +# Generates $target_gen_dir/snapshot_deno.cc +create_snapshot("deno") { + js = "$target_gen_dir/bundle/main.js" + deps = [ + ":bundle", + ] +} + +# Generates $target_gen_dir/snapshot_mock_runtime.cc +create_snapshot("mock_runtime") { + testonly = true + js = "src/js/mock_runtime.js" + deps = [] +} diff --git a/README.md b/README.md index 6dc1889b3..25b001cee 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,7 @@ You need [yarn](https://yarnpkg.com/lang/en/docs/install/) installed. You need [rust](https://www.rust-lang.org/en-US/install.html) installed. -Go to `src/` folder: -``` bash -cd src/ -``` +You need [ccache](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache) installed. Fetch packages and v8: ``` bash @@ -83,7 +80,7 @@ gclient sync --no-history Install the javascript deps. - (cd js; yarn install) + (cd src/js; yarn install) gn gen out/Debug --args='cc_wrapper="ccache" is_debug=true ' diff --git a/build b/build new file mode 120000 index 000000000..3a238b508 --- /dev/null +++ b/build @@ -0,0 +1 @@ +v8/build \ No newline at end of file diff --git a/build_overrides b/build_overrides new file mode 120000 index 000000000..f1aca1a07 --- /dev/null +++ b/build_overrides @@ -0,0 +1 @@ +v8/build_overrides \ No newline at end of file diff --git a/buildtools b/buildtools new file mode 120000 index 000000000..c5b1c451c --- /dev/null +++ b/buildtools @@ -0,0 +1 @@ +v8/buildtools \ No newline at end of file diff --git a/deno.gni b/deno.gni new file mode 100644 index 000000000..367a7f450 --- /dev/null +++ b/deno.gni @@ -0,0 +1,189 @@ +template("run_node") { + action(target_name) { + forward_variables_from(invoker, "*") + script = "src/js/run_node.py" + } +} + +# Template to generate different V8 snapshots based on different runtime flags. +# Can be invoked with run_mksnapshot(). The target will resolve to +# run_mksnapshot_. If is "default", no file suffixes will be used. +# Otherwise files are suffixed, e.g. embedded_.cc and +# snapshot_blob_.bin. +# +# The template exposes the variables: +# args: additional flags for mksnapshots +# embedded_suffix: a camel case suffix for method names in the embedded +# snapshot. +template("create_snapshot") { + name = target_name + suffix = "_$name" + action("create_snapshot_" + name) { + forward_variables_from(invoker, + [ + "testonly", + "deps", + ]) + visibility = [ ":*" ] # Only targets in this file can depend on this. + deps += [ ":snapshot_creator" ] + script = "v8/tools/run.py" + data = [] + exe = rebase_path(get_label_info(":snapshot_creator", "root_out_dir") + + "/snapshot_creator") + snapshot_out_cc = "$target_gen_dir/snapshot${suffix}.cc" + sources = [ + invoker.js, + ] + outputs = [ + snapshot_out_cc, + ] + args = [ + exe, + rebase_path(invoker.js, root_build_dir), + rebase_path(snapshot_out_cc, root_build_dir), + ] + + # To debug snapshotting problems: + # args += ["--trace-serializer"] + data = [ + invoker.js, + ] + } +} + +template("rust_crate") { + action(target_name) { + forward_variables_from(invoker, + [ + "cfg", + "crate_type", + "source_root", + "deps", + "rust_deps", + ]) + sources = [ + source_root, + ] + outputs = [] + depfile = "$target_gen_dir/$target_name.d" + script = "v8/tools/run.py" + + args = [ + "rustc", + rebase_path(source_root, root_build_dir), + "--crate-name=$target_name", + "--crate-type=$crate_type", + "--emit=dep-info=" + rebase_path(depfile, root_build_dir), + ] + + # We only use staticlib for the special "empty" lib. + if (crate_type == "staticlib") { + staticlib = "$target_out_dir/$target_name.a" + outputs += [ staticlib ] + args += [ "--emit=link=" + rebase_path(staticlib, root_build_dir) ] + } + + if (crate_type == "rlib" || crate_type == "bin") { + obj = "$target_out_dir/$target_name.o" + outputs += [ obj ] + args += [ "--emit=obj=" + rebase_path(obj, root_build_dir) ] + } + + if (crate_type == "rlib") { + rlib = "$target_out_dir/$target_name.rlib" + outputs += [ rlib ] + args += [ "--emit=link=" + rebase_path(rlib, root_build_dir) ] + } + + if (is_debug) { + args += [ "-g" ] + } + + if (is_official_build) { + args += [ "-O" ] + } + + if (defined(cfg)) { + foreach(c, cfg) { + args += [ + "--cfg", + c, + ] + } + } + + if (!defined(deps)) { + deps = [] + } + + if (defined(rust_deps)) { + deps += rust_deps + foreach(dep_label, rust_deps) { + dep_name = get_label_info(dep_label, "name") + dep_dir = get_label_info(dep_label, "target_out_dir") + dep_rlib = "$dep_dir/$dep_name.rlib" + args += [ + "--extern", + "$dep_name=" + rebase_path(dep_rlib, root_build_dir), + ] + } + } + } +} + +template("rust_library") { + rust_crate(target_name) { + crate_type = "rlib" + forward_variables_from(invoker, "*") + } +} + +template("rust_executable") { + bin_target = target_name + "_bin" + rust_crate(bin_target) { + crate_type = "bin" + forward_variables_from(invoker, "*") + } + + # By compiling an empty file as crate-type=staticlib we get all the code + # for the rust stdlib, which are not included in the object file outputs + # of other libs. + stdlib_target = target_name + "_stdlib" + rust_crate(stdlib_target) { + crate_type = "staticlib" + source_root = "src/empty.rs" + } + + executable(target_name) { + forward_variables_from(invoker, "*") + + if (!defined(deps)) { + deps = [] + } + + deps += [ + ":" + bin_target, + ":" + stdlib_target, + ] + + libs = get_target_outputs(":" + bin_target) + + get_target_outputs(":" + stdlib_target) + + if (defined(rust_deps)) { + deps += rust_deps + foreach(dep_label, rust_deps) { + dep_name = get_label_info(dep_label, "name") + dep_dir = get_label_info(dep_label, "target_out_dir") + dep_obj = "$dep_dir/$dep_name.o" + libs += [ dep_obj ] + } + } + + if (current_os == "mac") { + libs += [ "resolv" ] + } + if (current_os == "win") { + libs += [ "userenv.lib" ] + } + } +} diff --git a/src/.gclient b/src/.gclient deleted file mode 100644 index ec0dd52e5..000000000 --- a/src/.gclient +++ /dev/null @@ -1,38 +0,0 @@ -solutions = [{ - 'url': 'https://chromium.googlesource.com/v8/v8.git@6.8-lkgr', - 'name': 'v8', - 'deps_file': 'DEPS', - 'custom_deps': { - 'v8/third_party/catapult': None, - 'v8/third_party/colorama/src': None, - 'v8/testing/gmock': None, - 'v8/tools/swarming_client': None, - 'v8/third_party/instrumented_libraries': None, - 'v8/third_party/android_tools': None, - 'v8/test/wasm-js': None, - 'v8/test/benchmarks/data': None, - 'v8/test/mozilla/data': None, - 'v8/third_party/icu': None, - 'v8/test/test262/data': None, - 'v8/test/test262/harness': None, - 'v8/tools/luci-go': None - } -}, { - 'url': 'https://github.com/ry/protobuf_chromium.git', - 'name': 'third_party/protobuf', -}, { - 'url': - 'https://chromium.googlesource.com/chromium/src/tools/protoc_wrapper@9af82fef8cb9ca3ccc13e2ed958f58f2c21f449b', - 'name': - 'tools/protoc_wrapper' -}, { - 'url': - 'https://chromium.googlesource.com/chromium/src/third_party/zlib@39b4a6260702da4c089eca57136abf40a39667e9', - 'name': - 'third_party/zlib' -}, { - 'url': - 'https://github.com/rust-lang/libc.git@8a85d662b90c14d458bc4ae9521a05564e20d7ae', - 'name': - 'third_party/rust_crates/libc' -}] diff --git a/src/.gn b/src/.gn deleted file mode 100644 index 1fd465e5c..000000000 --- a/src/.gn +++ /dev/null @@ -1,44 +0,0 @@ -# This file is used by the GN meta build system to find the root of the source -# tree and to set startup options. For documentation on the values set in this -# file, run "gn help dotfile" at the command line. - -# The location of the build configuration file. -buildconfig = "//build/config/BUILDCONFIG.gn" - -# These are the targets to check headers for by default. The files in targets -# matching these patterns (see "gn help label_pattern" for format) will have -# their includes checked for proper dependencies when you run either -# "gn check" or "gn gen --check". -check_targets = [] - -default_args = { - # Various global chrome args that are unrelated to deno. - proprietary_codecs = false - safe_browsing_mode = 0 - toolkit_views = false - use_aura = false - use_dbus = false - use_gio = false - use_glib = false - use_ozone = false - use_udev = false - - is_component_build = false - symbol_level = 1 - treat_warnings_as_errors = false - - # https://cs.chromium.org/chromium/src/docs/ccache_mac.md - clang_use_chrome_plugins = false - - v8_deprecation_warnings = false - v8_embedder_string = "-deno" - v8_enable_gdbjit = false - v8_enable_i18n_support = false - v8_experimental_extra_library_files = [] - v8_extra_library_files = [] - v8_imminent_deprecation_warnings = false - v8_monolithic = true - v8_untrusted_code_mitigations = false - v8_use_external_startup_data = false - v8_use_snapshot = true -} diff --git a/src/BUILD.gn b/src/BUILD.gn deleted file mode 100644 index 09ce945bb..000000000 --- a/src/BUILD.gn +++ /dev/null @@ -1,185 +0,0 @@ -import("//third_party/protobuf/proto_library.gni") -import("//v8/gni/v8.gni") -import("//v8/snapshot_toolchain.gni") -import("deno.gni") - -config("deno_config") { - include_dirs = [ "v8" ] # This allows us to v8/src/base/ libraries. - configs = [ "v8:external_config" ] -} - -rust_executable("deno") { - source_root = "main.rs" - rust_deps = [ ":libc" ] - deps = [ - ":libdeno", - ] -} - -rust_library("libc") { - source_root = "third_party/rust_crates/libc/src/lib.rs" - cfg = [ - "feature=\"default\"", - "feature=\"use_std\"", - ] -} - -executable("mock_main") { - sources = [ - "mock_main.cc", - ] - deps = [ - ":libdeno", - ":msg_proto", - "//third_party/protobuf:protoc_lib", - ] - configs += [ ":deno_config" ] -} - -executable("mock_runtime_test") { - testonly = true - sources = [ - "file_util_test.cc", - "from_snapshot.cc", - "mock_runtime_test.cc", - ] - deps = [ - ":create_snapshot_mock_runtime", - ":deno_nosnapshot", - "//testing/gtest:gtest", - ] - defines = [ "DENO_MOCK_RUNTIME" ] - configs += [ ":deno_config" ] -} - -static_library("libdeno") { - complete_static_lib = true - sources = [ - "from_snapshot.cc", - ] - deps = [ - ":create_snapshot_deno", - ":deno_nosnapshot", - ] - configs += [ ":deno_config" ] -} - -v8_source_set("deno_nosnapshot") { - sources = [ - "deno.cc", - "deno_internal.h", - "file_util.cc", - "file_util.h", - "include/deno.h", - ] - deps = [ - "v8:v8_monolith", - ] - configs = [ ":deno_config" ] -} - -executable("snapshot_creator") { - sources = [ - "snapshot_creator.cc", - ] - deps = [ - ":deno_nosnapshot", - ] - configs += [ ":deno_config" ] -} - -proto_library("msg_proto") { - sources = [ - "msg.proto", - ] - generate_python = false -} - -run_node("bundle") { - out_dir = "$target_gen_dir/bundle/" - sources = [ - "js/main.ts", - "js/msg.pb.d.ts", - "js/msg.pb.js", - "js/package.json", # The `browserslist` field controls Babel behavior. - ] - outputs = [ - out_dir + "main.js", - ] - deps = [ - ":protobufjs", - ":run_tsc", - ] - args = [ - "./node_modules/parcel-bundler/bin/cli.js", - "build", - "--no-minify", - "--out-dir", - rebase_path(out_dir, root_build_dir), - rebase_path("js/main.ts", root_build_dir), - ] -} - -# Due to bugs in Parcel we must run TSC independently in order to catch errors. -# https://github.com/parcel-bundler/parcel/issues/954 -run_node("run_tsc") { - main = "js/main.ts" - tsconfig = "js/tsconfig.json" - out_dir = "$target_gen_dir/tsc_dist/" - sources = [ - "js/msg.pb.d.ts", - "js/msg.pb.js", - main, - tsconfig, - ] - outputs = [ - out_dir + "/main.js", - ] - deps = [ - ":protobufjs", - ] - args = [ - "./node_modules/typescript/bin/tsc", - "--project", - rebase_path(tsconfig, root_build_dir), - "--outDir", - rebase_path(out_dir, root_build_dir), - ] -} - -# Generates protobufjs code. -# TODO(ry) Ideally protobufjs output files should be written into -# target_gen_dir, but its difficult to get this working in a way that the -# bundler can resolve their location. (The bundler does not support NODE_PATH?) -# Therefore this hack: write the generated msg.pb.js and msg.pb.d.ts outputs -# into the js/ folder, and we check them into the repo. Hopefully this hack can -# be removed at some point. If msg.proto is changed, commit changes to the -# generated JS files. The stamp file is just to make gn work. -action("protobufjs") { - script = "js/pbjs_hack.py" - sources = [ - "msg.proto", - ] - outputs = [ - "$target_gen_dir/pbjs_hack.stamp", - ] - args = [ - rebase_path(sources[0], root_build_dir), - rebase_path(outputs[0], root_build_dir), - ] -} - -# Generates $target_gen_dir/snapshot_deno.cc -create_snapshot("deno") { - js = "$target_gen_dir/bundle/main.js" - deps = [ - ":bundle", - ] -} - -# Generates $target_gen_dir/snapshot_mock_runtime.cc -create_snapshot("mock_runtime") { - testonly = true - js = "js/mock_runtime.js" - deps = [] -} diff --git a/src/build b/src/build deleted file mode 120000 index 3a238b508..000000000 --- a/src/build +++ /dev/null @@ -1 +0,0 @@ -v8/build \ No newline at end of file diff --git a/src/build_overrides b/src/build_overrides deleted file mode 120000 index 06eeb9d4c..000000000 --- a/src/build_overrides +++ /dev/null @@ -1 +0,0 @@ -v8/build_overrides/ \ No newline at end of file diff --git a/src/buildtools b/src/buildtools deleted file mode 120000 index c5b1c451c..000000000 --- a/src/buildtools +++ /dev/null @@ -1 +0,0 @@ -v8/buildtools \ No newline at end of file diff --git a/src/deno.gni b/src/deno.gni deleted file mode 100644 index 66deaa96c..000000000 --- a/src/deno.gni +++ /dev/null @@ -1,189 +0,0 @@ -template("run_node") { - action(target_name) { - forward_variables_from(invoker, "*") - script = "js/run_node.py" - } -} - -# Template to generate different V8 snapshots based on different runtime flags. -# Can be invoked with run_mksnapshot(). The target will resolve to -# run_mksnapshot_. If is "default", no file suffixes will be used. -# Otherwise files are suffixed, e.g. embedded_.cc and -# snapshot_blob_.bin. -# -# The template exposes the variables: -# args: additional flags for mksnapshots -# embedded_suffix: a camel case suffix for method names in the embedded -# snapshot. -template("create_snapshot") { - name = target_name - suffix = "_$name" - action("create_snapshot_" + name) { - forward_variables_from(invoker, - [ - "testonly", - "deps", - ]) - visibility = [ ":*" ] # Only targets in this file can depend on this. - deps += [ ":snapshot_creator" ] - script = "v8/tools/run.py" - data = [] - exe = rebase_path(get_label_info(":snapshot_creator", "root_out_dir") + - "/snapshot_creator") - snapshot_out_cc = "$target_gen_dir/snapshot${suffix}.cc" - sources = [ - invoker.js, - ] - outputs = [ - snapshot_out_cc, - ] - args = [ - exe, - rebase_path(invoker.js, root_build_dir), - rebase_path(snapshot_out_cc, root_build_dir), - ] - - # To debug snapshotting problems: - # args += ["--trace-serializer"] - data = [ - invoker.js, - ] - } -} - -template("rust_crate") { - action(target_name) { - forward_variables_from(invoker, - [ - "cfg", - "crate_type", - "source_root", - "deps", - "rust_deps", - ]) - sources = [ - source_root, - ] - outputs = [] - depfile = "$target_gen_dir/$target_name.d" - script = "v8/tools/run.py" - - args = [ - "rustc", - rebase_path(source_root, root_build_dir), - "--crate-name=$target_name", - "--crate-type=$crate_type", - "--emit=dep-info=" + rebase_path(depfile, root_build_dir), - ] - - # We only use staticlib for the special "empty" lib. - if (crate_type == "staticlib") { - staticlib = "$target_out_dir/$target_name.a" - outputs += [ staticlib ] - args += [ "--emit=link=" + rebase_path(staticlib, root_build_dir) ] - } - - if (crate_type == "rlib" || crate_type == "bin") { - obj = "$target_out_dir/$target_name.o" - outputs += [ obj ] - args += [ "--emit=obj=" + rebase_path(obj, root_build_dir) ] - } - - if (crate_type == "rlib") { - rlib = "$target_out_dir/$target_name.rlib" - outputs += [ rlib ] - args += [ "--emit=link=" + rebase_path(rlib, root_build_dir) ] - } - - if (is_debug) { - args += [ "-g" ] - } - - if (is_official_build) { - args += [ "-O" ] - } - - if (defined(cfg)) { - foreach(c, cfg) { - args += [ - "--cfg", - c, - ] - } - } - - if (!defined(deps)) { - deps = [] - } - - if (defined(rust_deps)) { - deps += rust_deps - foreach(dep_label, rust_deps) { - dep_name = get_label_info(dep_label, "name") - dep_dir = get_label_info(dep_label, "target_out_dir") - dep_rlib = "$dep_dir/$dep_name.rlib" - args += [ - "--extern", - "$dep_name=" + rebase_path(dep_rlib, root_build_dir), - ] - } - } - } -} - -template("rust_library") { - rust_crate(target_name) { - crate_type = "rlib" - forward_variables_from(invoker, "*") - } -} - -template("rust_executable") { - bin_target = target_name + "_bin" - rust_crate(bin_target) { - crate_type = "bin" - forward_variables_from(invoker, "*") - } - - # By compiling an empty file as crate-type=staticlib we get all the code - # for the rust stdlib, which are not included in the object file outputs - # of other libs. - stdlib_target = target_name + "_stdlib" - rust_crate(stdlib_target) { - crate_type = "staticlib" - source_root = "empty.rs" - } - - executable(target_name) { - forward_variables_from(invoker, "*") - - if (!defined(deps)) { - deps = [] - } - - deps += [ - ":" + bin_target, - ":" + stdlib_target, - ] - - libs = get_target_outputs(":" + bin_target) + - get_target_outputs(":" + stdlib_target) - - if (defined(rust_deps)) { - deps += rust_deps - foreach(dep_label, rust_deps) { - dep_name = get_label_info(dep_label, "name") - dep_dir = get_label_info(dep_label, "target_out_dir") - dep_obj = "$dep_dir/$dep_name.o" - libs += [ dep_obj ] - } - } - - if (current_os == "mac") { - libs += [ "resolv" ] - } - if (current_os == "win") { - libs += [ "userenv.lib" ] - } - } -} diff --git a/src/testing b/src/testing deleted file mode 120000 index ed34f4824..000000000 --- a/src/testing +++ /dev/null @@ -1 +0,0 @@ -v8/testing \ No newline at end of file diff --git a/src/third_party/googletest b/src/third_party/googletest deleted file mode 120000 index 21e82410c..000000000 --- a/src/third_party/googletest +++ /dev/null @@ -1 +0,0 @@ -../v8/third_party/googletest/ \ No newline at end of file diff --git a/src/third_party/jinja2 b/src/third_party/jinja2 deleted file mode 120000 index 36528ba75..000000000 --- a/src/third_party/jinja2 +++ /dev/null @@ -1 +0,0 @@ -../v8/third_party/jinja2/ \ No newline at end of file diff --git a/src/third_party/llvm-build b/src/third_party/llvm-build deleted file mode 120000 index 7aebd3382..000000000 --- a/src/third_party/llvm-build +++ /dev/null @@ -1 +0,0 @@ -../v8/third_party/llvm-build/ \ No newline at end of file diff --git a/src/third_party/markupsafe b/src/third_party/markupsafe deleted file mode 120000 index b0960604b..000000000 --- a/src/third_party/markupsafe +++ /dev/null @@ -1 +0,0 @@ -../v8/third_party/markupsafe/ \ No newline at end of file diff --git a/src/tools/clang b/src/tools/clang deleted file mode 120000 index 7f66b6537..000000000 --- a/src/tools/clang +++ /dev/null @@ -1 +0,0 @@ -../v8/tools/clang \ No newline at end of file diff --git a/testing b/testing new file mode 120000 index 000000000..ed34f4824 --- /dev/null +++ b/testing @@ -0,0 +1 @@ +v8/testing \ No newline at end of file diff --git a/third_party/googletest b/third_party/googletest new file mode 120000 index 000000000..80cee42e3 --- /dev/null +++ b/third_party/googletest @@ -0,0 +1 @@ +../v8/third_party/googletest \ No newline at end of file diff --git a/third_party/jinja2 b/third_party/jinja2 new file mode 120000 index 000000000..268588bb9 --- /dev/null +++ b/third_party/jinja2 @@ -0,0 +1 @@ +../v8/third_party/jinja2 \ No newline at end of file diff --git a/third_party/llvm-build b/third_party/llvm-build new file mode 120000 index 000000000..d023bbec2 --- /dev/null +++ b/third_party/llvm-build @@ -0,0 +1 @@ +../v8/third_party/llvm-build \ No newline at end of file diff --git a/third_party/markupsafe b/third_party/markupsafe new file mode 120000 index 000000000..8e9e53c9e --- /dev/null +++ b/third_party/markupsafe @@ -0,0 +1 @@ +../v8/third_party/markupsafe \ No newline at end of file diff --git a/tools/clang b/tools/clang new file mode 120000 index 000000000..7f66b6537 --- /dev/null +++ b/tools/clang @@ -0,0 +1 @@ +../v8/tools/clang \ No newline at end of file diff --git a/tools/format.sh b/tools/format.sh index 0a5967c52..40531748e 100755 --- a/tools/format.sh +++ b/tools/format.sh @@ -3,12 +3,9 @@ set -e cd `dirname "$0"`/.. clang-format -i -style Google src/*.cc src/*.h src/include/*.h -# TODO(ry) Remove pushd/popd once .gn is moved to root. -pushd src/ gn format BUILD.gn gn format deno.gni gn format .gn -popd yapf -i src/js/*.py prettier --write \ -- cgit v1.2.3