1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00

Remove deno_ns

This commit is contained in:
Ryan Dahl 2018-10-23 19:16:27 -04:00
parent d2df67e822
commit 3438dbe350
3 changed files with 4 additions and 97 deletions

View file

@ -12,7 +12,6 @@ group("default") {
testonly = true testonly = true
deps = [ deps = [
":deno", ":deno",
":deno_ns",
":hyper_hello", ":hyper_hello",
":test_cc", ":test_cc",
":test_rs", ":test_rs",
@ -128,18 +127,6 @@ rust_executable("deno") {
] ]
} }
# This target is for fast incremental development.
# When modifying the javascript runtime, this target will not go through the
# extra process of building a snapshot and instead load the bundle from disk.
# ns = no snapshot
rust_executable("deno_ns") {
source_root = "src/main.rs"
extern = main_extern
deps = [
":libdeno_nosnapshot",
]
}
rust_executable("hyper_hello") { rust_executable("hyper_hello") {
source_root = "tools/hyper_hello.rs" source_root = "tools/hyper_hello.rs"
extern = [ extern = [
@ -228,15 +215,16 @@ v8_source_set("deno_base_test") {
"libdeno/file_util_test.cc", "libdeno/file_util_test.cc",
"libdeno/from_snapshot.cc", "libdeno/from_snapshot.cc",
"libdeno/libdeno_test.cc", "libdeno/libdeno_test.cc",
] "libdeno/test.cc",
inputs = [
"$target_gen_dir/snapshot_libdeno_test.bin",
] ]
deps = [ deps = [
":create_snapshot_libdeno_test", ":create_snapshot_libdeno_test",
":deno_base", ":deno_base",
"//testing/gtest:gtest", "//testing/gtest:gtest",
] ]
data = [
"$target_gen_dir/snapshot_libdeno_test.bin",
]
defines = [ "LIBDENO_TEST" ] defines = [ "LIBDENO_TEST" ]
configs = [ ":deno_config" ] configs = [ ":deno_config" ]
} }
@ -335,25 +323,6 @@ action("bundle_hash_h") {
} }
} }
source_set("libdeno_nosnapshot") {
bundle_outputs = get_target_outputs(":bundle")
bundle_location = rebase_path(bundle_outputs[0], root_build_dir)
bundle_map_location = rebase_path(bundle_outputs[1], root_build_dir)
inputs = bundle_outputs
sources = [
"libdeno/from_filesystem.cc",
]
deps = [
":bundle",
":deno_bindings",
]
configs += [ ":deno_config" ]
defines = [
"BUNDLE_LOCATION=\"$bundle_location\"",
"BUNDLE_MAP_LOCATION=\"$bundle_map_location\"",
]
}
ts_flatbuffer("msg_ts") { ts_flatbuffer("msg_ts") {
sources = [ sources = [
"src/msg.fbs", "src/msg.fbs",

View file

@ -1,59 +0,0 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
// This file is used to load the bundle at start for deno_ns.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include "third_party/v8/include/v8.h"
#include "third_party/v8/src/base/logging.h"
#include "deno.h"
#include "file_util.h"
#include "internal.h"
namespace deno {
Deno* NewFromFileSystem(deno_recv_cb cb) {
std::string exe_path;
CHECK(deno::ExePath(&exe_path));
std::string exe_dir = deno::Dirname(exe_path); // Always ends with a slash.
std::string js_source_path = exe_dir + BUNDLE_LOCATION;
std::string js_source;
CHECK(deno::ReadFileToString(js_source_path.c_str(), &js_source));
std::string js_source_map_path = exe_dir + BUNDLE_MAP_LOCATION;
std::string js_source_map;
CHECK(deno::ReadFileToString(js_source_map_path.c_str(), &js_source_map));
Deno* d = new Deno;
d->currentArgs = nullptr;
d->cb = cb;
d->user_data = nullptr;
v8::Isolate::CreateParams params;
params.array_buffer_allocator =
v8::ArrayBuffer::Allocator::NewDefaultAllocator();
v8::Isolate* isolate = v8::Isolate::New(params);
AddIsolate(d, isolate);
v8::Locker locker(isolate);
v8::Isolate::Scope isolate_scope(isolate);
{
v8::HandleScope handle_scope(isolate);
auto context = v8::Context::New(isolate);
// For source maps to work, the bundle location that is passed to
// InitializeContext must be a relative path.
InitializeContext(isolate, context, BUNDLE_LOCATION, js_source,
&js_source_map);
d->context.Reset(d->isolate, context);
}
return d;
}
} // namespace deno
extern "C" {
Deno* deno_new(deno_recv_cb cb) { return deno::NewFromFileSystem(cb); }
}

View file

@ -42,8 +42,6 @@ def main(argv):
deno_exe = os.path.join(build_dir, "deno" + executable_suffix) deno_exe = os.path.join(build_dir, "deno" + executable_suffix)
check_exists(deno_exe) check_exists(deno_exe)
deno_ns_exe = os.path.join(build_dir, "deno_ns" + executable_suffix)
check_exists(deno_ns_exe)
# Internal tools testing # Internal tools testing
setup_test() setup_test()
@ -61,7 +59,6 @@ def main(argv):
unit_tests(deno_exe) unit_tests(deno_exe)
check_output_test(deno_exe) check_output_test(deno_exe)
check_output_test(deno_ns_exe)
rmtree(deno_dir) rmtree(deno_dir)