Skip to content

Commit

Permalink
Upgrade Flatbuffers. (#1127)
Browse files Browse the repository at this point in the history
Use msg_generated.rs as mod instead of crate.
  • Loading branch information
ry authored Oct 31, 2018
1 parent 2422e52 commit 7c82667
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ main_extern = [
"$rust_build:tokio_threadpool",
"$rust_build:url",
"//build_extra/flatbuffers/rust:flatbuffers",
":msg_rs",
]

ts_sources = [
Expand Down Expand Up @@ -126,6 +125,7 @@ rust_executable("deno") {
extern = main_extern
deps = [
":libdeno",
":msg_rs",
":snapshot",
]
}
Expand Down
13 changes: 1 addition & 12 deletions build_extra/flatbuffers/rust/rust_flatbuffer.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import("//build_extra/rust/rust.gni")
import("//build_extra/flatbuffers/flatbuffer.gni")

template("rust_flatbuffer") {
action_name = "${target_name}_gen"
source_set_name = target_name
compiled_action_foreach(action_name) {
compiled_action_foreach(target_name) {
tool = "$flatbuffers_build_location:flatc"

sources = invoker.sources
Expand All @@ -32,13 +30,4 @@ template("rust_flatbuffer") {
deps += invoker.deps
}
}

rust_crate(source_set_name) {
sources = get_target_outputs(":$action_name")
source_root = sources[0]
deps = [
":$action_name",
]
extern = [ "//build_extra/flatbuffers/rust:flatbuffers" ]
}
}
10 changes: 10 additions & 0 deletions build_extra/rust/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
# This file just executes its arguments, except that also adds OUT_DIR to the
# environ. This is for compatibility with cargo.
import subprocess
import sys
import os

os.environ["OUT_DIR"] = os.path.abspath(".")
assert os.path.isdir(os.environ["OUT_DIR"])
sys.exit(subprocess.call(sys.argv[1:], env=os.environ))
2 changes: 1 addition & 1 deletion build_extra/rust/rust.gni
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ template("rust_crate") {
}

action(action_name) {
script = "//third_party/v8/tools/run.py"
script = "//build_extra/rust/run.py"
sources = [
source_root,
]
Expand Down
2 changes: 1 addition & 1 deletion gclient_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'cpplint'
}, {
'url':
'https://github.com/google/flatbuffers.git@d840856093fa7b935b0d6378c436bd633d006c8c',
'https://github.com/google/flatbuffers.git@160e8f2fdc9d5989e652709fae3fac0bd9aaed14',
'name':
'flatbuffers'
}]
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ extern crate getopts;
extern crate hyper;
extern crate hyper_rustls;
extern crate libc;
extern crate msg_rs as msg;
extern crate rand;
extern crate remove_dir_all;
extern crate ring;
Expand All @@ -31,6 +30,7 @@ mod fs;
mod http_util;
mod isolate;
mod libdeno;
mod msg;
pub mod ops;
mod permissions;
mod resources;
Expand Down
4 changes: 4 additions & 0 deletions src/msg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![allow(unused_imports)]
#![allow(dead_code)]
use flatbuffers;
include!(concat!(env!("OUT_DIR"), "/gen/msg_generated.rs"));
2 changes: 1 addition & 1 deletion third_party
Submodule third_party updated 112 files

0 comments on commit 7c82667

Please sign in to comment.