Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ jobs:
target: x86_64-apple-darwin
variant: release

- os: ubuntu-16.04
- os: ubuntu-18.04
target: x86_64-unknown-linux-gnu
variant: debug

- os: ubuntu-16.04
- os: ubuntu-18.04
target: x86_64-unknown-linux-gnu
variant: release

- os: windows-2019
target: x86_64-pc-windows-msvc
variant: release # Note: we do not support windows debug builds.

- os: ubuntu-16.04
- os: ubuntu-18.04
target: aarch64-unknown-linux-gnu
variant: debug

- os: ubuntu-16.04
- os: ubuntu-18.04
target: aarch64-unknown-linux-gnu
variant: release

Expand All @@ -70,7 +70,7 @@ jobs:
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.45.2
rust-version: 1.46.0

- name: Install rust tools
run: rustup component add clippy rustfmt
Expand Down Expand Up @@ -98,14 +98,6 @@ jobs:
echo "::set-env name=CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER::/usr/bin/aarch64-linux-gnu-gcc-5"
echo "::set-env name=QEMU_LD_PREFIX::/usr/aarch64-linux-gnu"

- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/target/cargo. This allows us to cache only the files
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "::set-env name=CARGO_HOME::$(pwd)/target/cargo"

- name: Cache
uses: actions/cache@v2
with:
Expand All @@ -116,13 +108,15 @@ jobs:
# come from the registry. By additionally saving the sccache cache
# directory it's still possible to build v8 fast.
path: |-
target/cargo
target/sccache
target/*/.*
target/*/build
target/*/deps
key: ${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ matrix.config.target }}-${{ matrix.config.variant }}-
key:
${{ matrix.config.target }}-${{ matrix.config.variant }}-${{
hashFiles('./Cargo.lock', './v8/include/v8-version.h') }}
restore-keys:
${{ matrix.config.target }}-${{ matrix.config.variant }}-

- name: Install and start sccache
shell: pwsh
Expand All @@ -149,11 +143,13 @@ jobs:
echo "::add-path::$(pwd)/$basename"

- name: Test
run: cargo test -vv --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
run:
cargo test -vv --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
--target ${{ matrix.config.target }}

- name: Clippy
run: cargo clippy --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
run:
cargo clippy --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
--target ${{ matrix.config.target }} -- -D clippy::all

- name: Rustfmt
Expand All @@ -166,7 +162,9 @@ jobs:

- name: Binary publish
uses: softprops/action-gh-release@v1
if: github.repository == 'denoland/rusty_v8' && startsWith(github.ref, 'refs/tags/')
if: >-
github.repository == 'denoland/rusty_v8' &&
startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
17 changes: 7 additions & 10 deletions BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import("//v8/gni/v8.gni")

v8_static_library("rusty_v8") {
static_library("rusty_v8") {
complete_static_lib = true
sources = [ "src/binding.cc" ]
deps = [
":v8",
"//build/config:shared_library_deps",
]
configs = [ ":rusty_v8_config" ]
}

v8_source_set("v8") {
deps = [
"//v8:v8",
"//v8:v8_libbase",
"//v8:v8_libplatform",
"//v8:v8_libsampler",
]
configs = [ ":rusty_v8_config" ]
configs -= [
"//build/config/compiler:default_init_stack_vars",
"//build/config/compiler:thin_archive",
]
configs += [ ":rusty_v8_config" ]
}

config("rusty_v8_config") {
Expand Down
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ exclude = [

[dependencies]
lazy_static = "1.4.0"
libc = "0.2.74"
libc = "0.2.76"
bitflags = "1.2.1"

[build-dependencies]
cargo_gn = "0.0.15"
which = "4.0.2"

[dev-dependencies]
trybuild = "1.0.31"
trybuild = "1.0.33"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rusty V8 Binding

V8 Version: 8.6.334
V8 Version: 8.7.25

[![ci](https://github.com/denoland/rusty_v8/workflows/ci/badge.svg?branch=master)](https://github.com/denoland/rusty_v8/actions)
[![crates](https://img.shields.io/crates/v/rusty_v8.svg)](https://crates.io/crates/rusty_v8)
Expand Down
2 changes: 1 addition & 1 deletion build
Submodule build updated 115 files
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fn download_ninja_gn_binaries() {
.parent()
.unwrap();
let bin_dir = target_dir
.join("ninja_gn_binaries-20200806")
.join("ninja_gn_binaries-20200827")
.join(platform());
let gn = bin_dir.join("gn");
let ninja = bin_dir.join("ninja");
Expand Down
2 changes: 1 addition & 1 deletion buildtools
Submodule buildtools updated 1 files
+1 −1 DEPS
13 changes: 6 additions & 7 deletions src/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ bool v8__Module__IsSourceTextModule(const v8::Module& self) {
return ptr_to_local(&self)->IsSourceTextModule();
}

bool v8__Module__IsSyntheticModule(const v8::Module&self) {
bool v8__Module__IsSyntheticModule(const v8::Module& self) {
return ptr_to_local(&self)->IsSyntheticModule();
}

Expand All @@ -1753,16 +1753,15 @@ const v8::Module* v8__Module__CreateSyntheticModule(
export_names.push_back(ptr_to_local(export_names_raw[i]));
}
return local_to_ptr(v8::Module::CreateSyntheticModule(
isolate, ptr_to_local(module_name), export_names,
evaluation_steps));
isolate, ptr_to_local(module_name), export_names, evaluation_steps));
}

MaybeBool v8__Module__SetSyntheticModuleExport(const v8::Module& self,
v8::Isolate* isolate,
const v8::String* export_name,
const v8::Value* export_value) {
return maybe_to_maybe_bool(ptr_to_local(&self)->SetSyntheticModuleExport(
isolate, ptr_to_local(export_name), ptr_to_local(export_value)));
isolate, ptr_to_local(export_name), ptr_to_local(export_value)));
}

using HeapSnapshotCallback = bool (*)(void*, const char*, size_t);
Expand Down Expand Up @@ -1837,9 +1836,9 @@ void v8__HeapStatistics__CONSTRUCT(uninit_t<v8::HeapStatistics>* buf) {

// The const_cast doesn't violate const correctness, the methods
// are simple getters that don't mutate the object or global state.
#define V(name) \
size_t v8__HeapStatistics__##name(const v8::HeapStatistics* s) { \
return const_cast<v8::HeapStatistics*>(s)->name(); \
#define V(name) \
size_t v8__HeapStatistics__##name(const v8::HeapStatistics* s) { \
return const_cast<v8::HeapStatistics*>(s)->name(); \
}

V(total_heap_size)
Expand Down
5 changes: 1 addition & 4 deletions src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1420,10 +1420,7 @@ pub(crate) mod data {

impl ScopeTypeSpecificData {
pub fn is_none(&self) -> bool {
match self {
Self::None => true,
_ => false,
}
matches!(self, Self::None)
}

/// Replaces a `ScopeTypeSpecificData::None` value with the value returned
Expand Down
10 changes: 5 additions & 5 deletions tests/compile_fail/handle_scope_escape_to_nowhere.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0277]: the trait bound `rusty_v8::isolate::OwnedIsolate: rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
error[E0277]: the trait bound `rusty_v8::OwnedIsolate: rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
--> $DIR/handle_scope_escape_to_nowhere.rs:6:50
|
6 | let mut _scope = v8::EscapableHandleScope::new(&mut isolate);
| ^^^^^^^^^^^^ the trait `rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `rusty_v8::isolate::OwnedIsolate`
| ^^^^^^^^^^^^ the trait `rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `rusty_v8::OwnedIsolate`
|
= note: required by `rusty_v8::scope::EscapableHandleScope::<'s, 'e>::new`
= note: required by `rusty_v8::EscapableHandleScope::<'s, 'e>::new`

error[E0277]: the trait bound `rusty_v8::isolate::OwnedIsolate: rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
error[E0277]: the trait bound `rusty_v8::OwnedIsolate: rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
--> $DIR/handle_scope_escape_to_nowhere.rs:6:20
|
6 | let mut _scope = v8::EscapableHandleScope::new(&mut isolate);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `rusty_v8::isolate::OwnedIsolate`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `rusty_v8::OwnedIsolate`
2 changes: 1 addition & 1 deletion tests/compile_fail/handle_scope_lifetime_1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ error[E0499]: cannot borrow `scope1` as mutable more than once at a time
8 | let _local = v8::Integer::new(&mut scope1, 123);
| ^^^^^^^^^^^ second mutable borrow occurs here
9 | }
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `rusty_v8::scope::EscapableHandleScope`
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `rusty_v8::EscapableHandleScope`
2 changes: 1 addition & 1 deletion tests/compile_fail/handle_scope_lifetime_3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ error[E0499]: cannot borrow `scope1` as mutable more than once at a time
10 | v8::Integer::new(&mut scope1, 123)
| ^^^^^^^^^^^ second mutable borrow occurs here
11 | };
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `rusty_v8::scope::EscapableHandleScope`
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `rusty_v8::EscapableHandleScope`
6 changes: 3 additions & 3 deletions tests/compile_fail/object_without_context_scope.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/object_without_context_scope.rs:7:33
|
7 | let _object = v8::Object::new(&mut scope);
| ^^^^^^^^^^ expected struct `rusty_v8::data::Context`, found `()`
| ^^^^^^^^^^ expected struct `rusty_v8::Context`, found `()`
|
= note: expected mutable reference `&mut rusty_v8::scope::HandleScope<'_>`
found mutable reference `&mut rusty_v8::scope::HandleScope<'_, ()>`
= note: expected mutable reference `&mut rusty_v8::HandleScope<'_>`
found mutable reference `&mut rusty_v8::HandleScope<'_, ()>`
Loading