diff --git a/.circleci/config.yml b/.circleci/config.yml index 2aef0a5b0..c18c26dfe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ workflows: name: Run cargo tests (<< matrix.rust_channel >> rust on << matrix.platform >>) matrix: parameters: - platform: [amd_centos, arm_ubuntu, amd_macos, arm_macos, amd_windows] + platform: [amd_centos, arm_ubuntu, amd_linux, amd_macos, arm_macos, amd_windows] rust_channel: [stable] command: [test] @@ -63,7 +63,7 @@ workflows: name: Run cargo tests (<< matrix.rust_channel >> rust on << matrix.platform >>) matrix: parameters: - platform: [amd_centos, arm_ubuntu, amd_macos, arm_macos, amd_windows] + platform: [amd_centos, arm_ubuntu, amd_linux, amd_macos, arm_macos, amd_windows] rust_channel: [stable] command: [test] <<: *any_release @@ -215,7 +215,12 @@ executors: resource_class: xlarge environment: XTASK_TARGET: "x86_64-unknown-linux-gnu" - + amd_linux: &amd_linux_build_executor + docker: + - image: cimg/base:stable + resource_class: xlarge + environment: + XTASK_TARGET: "x86_64-unknown-linux-gnu" arm_ubuntu: &arm_ubuntu_executor machine: image: ubuntu-2004:2022.04.1 diff --git a/federation-2/Cargo.lock b/federation-2/Cargo.lock index 805ce0563..910e96dd7 100644 --- a/federation-2/Cargo.lock +++ b/federation-2/Cargo.lock @@ -233,18 +233,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -640,18 +628,18 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.151.0" +version = "0.140.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1657ea36f527a5fa3b3d9c1ad9b9f0c9c0b263f966079f5aa0c7c09ff6f4e2e" +checksum = "35b28b284ce4982c1c6644a97014731b8717466bb9fdb9afd2579816ba6dc0bd" dependencies = [ "deno_core", ] [[package]] name = "deno_core" -version = "0.280.0" +version = "0.265.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d26f2d3e243bbbdd0851ab542b20ec48ac1fcf6c64ab06e81133da3113ebdd" +checksum = "f40a3dc5c31b35feedda9304ceff8b541dd5c8d7deeb69eb6036f8fa65bfdf08" dependencies = [ "anyhow", "bincode", @@ -664,6 +652,7 @@ dependencies = [ "deno_unsync", "futures", "libc", + "log", "memoffset 0.9.1", "parking_lot", "pin-project", @@ -686,9 +675,9 @@ checksum = "a13951ea98c0a4c372f162d669193b4c9d991512de9f2381dd161027f34b26b1" [[package]] name = "deno_crypto" -version = "0.165.0" +version = "0.154.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f399d4bd84b014f5dcf9f0ceda39d7fc5624c732fb2c71f93dea4af2b5daa706" +checksum = "f9f0b60f6e47d8f8ad4692cd885319b4ca9e7b65f16842fb4707e6d12402976f" dependencies = [ "aes", "aes-gcm", @@ -722,9 +711,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.156.0" +version = "0.141.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8237b272db1a6cb941b8a5a63ba63539004a8263e8b0230a11136d76eea273f9" +checksum = "86efc44027a9d370fa677988cb463fb8c9a48c5d8b53e91431a69a44540a6c11" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -746,9 +735,9 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.151.0" +version = "0.140.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6babc9a52e441a08f9c4f03309fe80f1f7294a4c227bbddf064b3e1c62abbf0" +checksum = "bcc47924d8d43ecdeffbe0ca6bf81d878bb93364bd2dd5af7f340e84985e2db5" dependencies = [ "deno_core", "serde", @@ -757,9 +746,9 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.182.0" +version = "0.171.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ce3a0a97a69379188214d92e03c22437f96f068d37686d1cd1eff34e4517a8" +checksum = "c423dd2b6958fd02109a111fdced224aba4c21af38623e447369826d014b918b" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -776,9 +765,9 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.151.0" +version = "0.140.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffa30c6acba42d8a4d952514bbb7b5d247b9c900fa1fd82ce9084c32f640827" +checksum = "b1d6afb4540dd850c3cdea725f8d3abda40ded606f61e467b9560e07449fb7b5" dependencies = [ "deno_core", ] @@ -954,12 +943,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" version = "0.3.29" @@ -1098,15 +1081,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "gzip-header" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2" -dependencies = [ - "crc32fast", -] - [[package]] name = "half" version = "1.8.2" @@ -1800,12 +1774,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.8.5" @@ -1978,12 +1946,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc_version" version = "0.2.3" @@ -2123,10 +2085,12 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.189.0" +version = "0.174.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893c995255d6fbf55c33166b651fd037c4e3cc7864bf82213ea18d0ec94ed165" +checksum = "1f15fc8c65ebdf37ec94b72dacad9622ad8e04a7cf7504060a709eb21ed02b88" dependencies = [ + "bytes", + "derive_more", "num-bigint", "serde", "smallvec", @@ -2260,16 +2224,14 @@ dependencies = [ [[package]] name = "sourcemap" -version = "8.0.1" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" +checksum = "e7768edd06c02535e0d50653968f46e1e0d3aa54742190d35dd9466f59de9c71" dependencies = [ "base64-simd 0.7.0", - "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash", "rustc_version 0.2.3", "serde", "serde_json", @@ -2415,12 +2377,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "textwrap" version = "0.11.0" @@ -2814,15 +2770,12 @@ dependencies = [ [[package]] name = "v8" -version = "0.91.1" +version = "0.83.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69026e2e8af55a4d2f20c0c17f690e8b31472bf76ab75b1205d3a0fab60c8f84" +checksum = "9f6c8a960dd2eb74b22eda64f7e9f3d1688f82b80202828dc0425ebdeda826ef" dependencies = [ "bitflags 2.4.1", "fslock", - "gzip-header", - "home", - "miniz_oxide", "once_cell", "which 5.0.0", ] @@ -3186,15 +3139,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - [[package]] name = "x25519-dalek" version = "2.0.1" diff --git a/federation-2/harmonizer/Cargo.toml b/federation-2/harmonizer/Cargo.toml index a567ddb4a..e6e2898cb 100644 --- a/federation-2/harmonizer/Cargo.toml +++ b/federation-2/harmonizer/Cargo.toml @@ -22,7 +22,7 @@ include = [ apollo-federation-types = { version = "0.11.0", path = "../../apollo-federation-types", default-features = false, features = [ "build", ] } -deno_core = "0.280.0" +deno_core = "0.265.0" serde = { version = "1", features = ["derive"] } serde_json = "1" @@ -30,7 +30,7 @@ serde_json = "1" insta = "1.34.0" [build-dependencies] -deno_core = "0.280.0" +deno_core = "0.265.0" semver = "1" serde_json = "1" toml_edit = "0.19" diff --git a/federation-2/harmonizer/build.rs b/federation-2/harmonizer/build.rs index 20f3e1630..fff9d172e 100644 --- a/federation-2/harmonizer/build.rs +++ b/federation-2/harmonizer/build.rs @@ -209,13 +209,19 @@ fn create_snapshot(out_dir: &Path) -> Result<(), Box> { // functions for interacting with it. let runtime_str = read_to_string("bundled/runtime.js").unwrap(); runtime - .execute_script("", runtime_str) + .execute_script( + "", + deno_core::FastString::from(runtime_str.to_string()), + ) .expect("unable to initialize router bridge runtime environment"); // Load the composition library. let bridge_str = read_to_string("bundled/composition_bridge.js").unwrap(); runtime - .execute_script("composition_bridge.js", bridge_str) + .execute_script( + "composition_bridge.js", + deno_core::FastString::from(bridge_str.to_string()), + ) .expect("unable to evaluate bridge module"); // Create our base query snapshot which will be included in diff --git a/federation-2/harmonizer/src/lib.rs b/federation-2/harmonizer/src/lib.rs index 28e0048e7..d2517cbc3 100644 --- a/federation-2/harmonizer/src/lib.rs +++ b/federation-2/harmonizer/src/lib.rs @@ -71,24 +71,30 @@ pub fn harmonize_limit( // store the subgraph definition JSON in the `serviceList` variable runtime - .execute_script("", service_list_javascript) + .execute_script( + "", + deno_core::FastString::from(service_list_javascript.to_string()), + ) .expect("unable to evaluate service list in JavaScript runtime"); // store the nodes_limit variable in the nodesLimit variable runtime .execute_script( "", - format!( + deno_core::FastString::from(format!( "nodesLimit = {}", nodes_limit .map(|n| n.to_string()) .unwrap_or("null".to_string()) - ), + )), ) .expect("unable to evaluate nodes limit in JavaScript runtime"); // run the unmodified do_compose.js file, which expects `serviceList` to be set - match runtime.execute_script("do_compose", include_str!("../bundled/do_compose.js")) { + match runtime.execute_script( + "do_compose", + deno_core::FastString::from_static(include_str!("../bundled/do_compose.js")), + ) { Ok(execute_result) => { let scope = &mut runtime.handle_scope(); let local = deno_core::v8::Local::new(scope, execute_result); diff --git a/federation-2/router-bridge/Cargo.toml b/federation-2/router-bridge/Cargo.toml index d738f6620..26ba764a4 100644 --- a/federation-2/router-bridge/Cargo.toml +++ b/federation-2/router-bridge/Cargo.toml @@ -23,12 +23,12 @@ include = [ [dependencies] anyhow = "1.0.79" async-channel = "1.9.0" -deno_console = "0.151.0" -deno_core = "0.280.0" -deno_crypto = "0.165.0" -deno_url = "0.151.0" -deno_web = "0.182.0" -deno_webidl = "0.151.0" +deno_console = "0.140.0" +deno_core = "0.265.0" +deno_crypto = "0.154.0" +deno_url = "0.140.0" +deno_web = "0.171.0" +deno_webidl = "0.140.0" rand = "0.8.5" serde = { version = "1.0.195", features = ["derive"] } serde_json = { version = "1.0.111", features = ["preserve_order"] } @@ -46,12 +46,12 @@ tracing-test = "0.2.1" criterion = { version = "0.4", features = ["async_tokio", "async_futures"] } [build-dependencies] -deno_console = "0.151.0" -deno_core = "0.280.0" -deno_crypto = "0.165.0" -deno_url = "0.151.0" -deno_web = "0.182.0" -deno_webidl = "0.151.0" +deno_console = "0.140.0" +deno_core = "0.265.0" +deno_crypto = "0.154.0" +deno_url = "0.140.0" +deno_web = "0.171.0" +deno_webidl = "0.140.0" which = "4.4.2" [features] diff --git a/federation-2/router-bridge/build.rs b/federation-2/router-bridge/build.rs index 438fa5fc7..ddc27c0ac 100644 --- a/federation-2/router-bridge/build.rs +++ b/federation-2/router-bridge/build.rs @@ -96,13 +96,13 @@ fn create_snapshot(out_dir: &Path) { // functions for interacting with it. let runtime_str = read_to_string("bundled/runtime.js").unwrap(); runtime - .execute_script("", runtime_str) + .execute_script("", deno_core::FastString::from(runtime_str)) .expect("unable to initialize router bridge runtime environment"); // Load the composition library. let bridge_str = read_to_string("bundled/bridge.js").unwrap(); runtime - .execute_script("bridge.js", bridge_str) + .execute_script("bridge.js", deno_core::FastString::from(bridge_str)) .expect("unable to evaluate bridge module"); // Create our base query snapshot which will be included in diff --git a/federation-2/router-bridge/src/js.rs b/federation-2/router-bridge/src/js.rs index cf48ac86d..e6420a22c 100644 --- a/federation-2/router-bridge/src/js.rs +++ b/federation-2/router-bridge/src/js.rs @@ -51,11 +51,14 @@ impl Js { for parameter in self.parameters.iter() { runtime - .execute_script(parameter.0, parameter.1.clone()) + .execute_script( + parameter.0, + deno_core::FastString::from(parameter.1.clone()), + ) .expect("unable to evaluate service list in JavaScript runtime"); } - match runtime.execute_script(name, source) { + match runtime.execute_script(name, deno_core::FastString::from(source.to_string())) { Ok(execute_result) => { let scope = &mut runtime.handle_scope(); let local = deno_core::v8::Local::new(scope, execute_result); diff --git a/federation-2/router-bridge/src/worker.rs b/federation-2/router-bridge/src/worker.rs index c06f96f30..cc37fed6c 100644 --- a/federation-2/router-bridge/src/worker.rs +++ b/federation-2/router-bridge/src/worker.rs @@ -1,6 +1,6 @@ use crate::error::Error; use async_channel::{bounded, Receiver, Sender}; -use deno_core::{op2, Extension, OpState}; +use deno_core::{op2, Extension, Op, OpState}; use serde::de::DeserializeOwned; use serde::Deserialize; use serde::Serialize; @@ -67,13 +67,13 @@ impl JsWorker { let my_ext = Extension { name: concat!(env!("CARGO_PKG_NAME"), "_worker"), ops: Cow::Owned(vec![ - send(), - receive(), - log_trace(), - log_debug(), - log_info(), - log_warn(), - log_error(), + send::DECL, + receive::DECL, + log_trace::DECL, + log_debug::DECL, + log_info::DECL, + log_warn::DECL, + log_error::DECL, ]), op_state_fn: Some(Box::new(move |state| { state.put(response_sender.clone()); @@ -92,7 +92,7 @@ impl JsWorker { let future = async move { js_runtime - .execute_script("worker.js", worker_source_code) + .execute_script("worker.js", deno_core::FastString::from(worker_source_code.to_string())) .unwrap(); js_runtime.run_event_loop(Default::default()).await };