From 6b60037a6afb850e853aa9d1c8e7645abee4ff02 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Tue, 18 Jan 2022 15:30:41 +0100 Subject: [PATCH] chore(deno_webgpu): bump deno crates (#2405) * chore(deno_webgpu): bump deno_core to 0.114.0 https://github.com/denoland/deno/commit/ca75752e5a9499a0a997809f02b18c2ba1ecd58d dates back to Aug 30 2021, so is nearly 5 months old. There are no breaking changes updating `deno_core` to `0.114.0` (released 6 days ago) Also by using the crate directly from cargo we avoid cloning https://github.com/denoland/deno and https://github.com/denoland/deno_third_party which can be quite large so crate DL/install is much faster * bump cts_runner's deno crates * minor cts_runner fixes --- cts_runner/Cargo.toml | 14 +++++++------- cts_runner/src/main.rs | 19 +++++++++++++++---- deno_webgpu/Cargo.toml | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/cts_runner/Cargo.toml b/cts_runner/Cargo.toml index ee6c0c5390..2f40cef6ff 100644 --- a/cts_runner/Cargo.toml +++ b/cts_runner/Cargo.toml @@ -11,12 +11,12 @@ publish = false resolver = "2" [dependencies] -deno_console = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } -deno_core = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } -deno_timers = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } -deno_url = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } -deno_web = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } -deno_webidl = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } +deno_console = "0.32.0" +deno_core = "0.114.0" +deno_timers = "0.30.0" +deno_url = "0.32.0" +deno_web = "0.63.0" +deno_webidl = "0.32.0" deno_webgpu = { path = "../deno_webgpu" } -tokio = { version = "1.10.0", features = ["full"] } +tokio = { version = "1.15.0", features = ["full"] } termcolor = "1.1.2" diff --git a/cts_runner/src/main.rs b/cts_runner/src/main.rs index b75adaad6d..303cf09476 100644 --- a/cts_runner/src/main.rs +++ b/cts_runner/src/main.rs @@ -4,7 +4,7 @@ use std::{ rc::Rc, }; -use deno_core::error::anyhow; +use deno_core::anyhow::anyhow; use deno_core::error::AnyError; use deno_core::located_script_name; use deno_core::resolve_url_or_path; @@ -41,7 +41,7 @@ async fn run() -> Result<(), AnyError> { deno_console::init(), deno_url::init(), deno_web::init(BlobStore::default(), None), - deno_timers::init::(), + deno_timers::init::(), deno_webgpu::init(true), extension(), ], @@ -56,9 +56,9 @@ async fn run() -> Result<(), AnyError> { isolate .op_state() .borrow_mut() - .put(deno_timers::NoTimersPermission); + .put(Permissions{}); - let mod_id = isolate.load_module(&specifier, None).await?; + let mod_id = isolate.load_main_module(&specifier, None).await?; let mod_rx = isolate.mod_evaluate(mod_id); let rx = tokio::spawn(async move { @@ -149,3 +149,14 @@ fn red_bold>(s: S) -> impl fmt::Display { style_spec.set_fg(Some(Red)).set_bold(true); style(s, style_spec) } + +// NOP permissions +struct Permissions; + +impl deno_timers::TimersPermission for Permissions { + fn allow_hrtime(&mut self) -> bool { + false + } + + fn check_unstable(&self, _state: &deno_core::OpState, _api_name: &'static str) {} +} diff --git a/deno_webgpu/Cargo.toml b/deno_webgpu/Cargo.toml index c0e9aa3177..d982a00d63 100644 --- a/deno_webgpu/Cargo.toml +++ b/deno_webgpu/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/gfx-rs/wgpu" description = "WebGPU implementation for Deno" [dependencies] -deno_core = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" } +deno_core = "0.114.0" serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.10", features = ["full"] } wgpu-core = { path = "../wgpu-core", features = ["trace", "replay", "serde"] }