From 4a6a20247ca08f3eb7b71c4f19d6406d58228d16 Mon Sep 17 00:00:00 2001 From: philipperolet Date: Fri, 1 Sep 2023 09:11:57 +0200 Subject: [PATCH] Fix core compilation bug when using stable rust version in cloud build --- .github/workflows/build-and-test-core.yml | 2 +- core/Cargo.lock | 94 ++++++++++++++++++----- core/Cargo.toml | 2 +- core/src/deno/script.rs | 3 +- 4 files changed, 76 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-and-test-core.yml b/.github/workflows/build-and-test-core.yml index 0e7819902dfc2..7b809fa55ebaa 100644 --- a/.github/workflows/build-and-test-core.yml +++ b/.github/workflows/build-and-test-core.yml @@ -14,7 +14,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.71.1 + toolchain: stable - name: checkout uses: actions/checkout@v3 diff --git a/core/Cargo.lock b/core/Cargo.lock index 43fc678098d43..c1f9121dfc472 100644 --- a/core/Cargo.lock +++ b/core/Cargo.lock @@ -761,11 +761,34 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "deno-proc-macro-rules" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c65c2ffdafc1564565200967edc4851c7b55422d3913466688907efd05ea26f" +dependencies = [ + "deno-proc-macro-rules-macros", + "proc-macro2", + "syn 2.0.18", +] + +[[package]] +name = "deno-proc-macro-rules-macros" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3047b312b7451e3190865713a4dd6e1f821aed614ada219766ebc3024a690435" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "deno_core" -version = "0.181.0" +version = "0.197.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d512a601e07e65440e481523326439425cc1c614b7c346abe2ffa2575a3468" +checksum = "efdf066ffb540f889e481c4f1cdbb7bc202a7af937e7c435234586395e533976" dependencies = [ "anyhow", "bytes", @@ -782,16 +805,18 @@ dependencies = [ "serde_v8", "smallvec", "sourcemap", + "tokio", "url", "v8", ] [[package]] name = "deno_ops" -version = "0.59.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8724e792ab5e493902fb31d1ae8b5e93a1b471d52da5d3bfa18f51a1cbe9809a" +checksum = "ba2d2ca95637f48ba885bfa78cf3b962aa6752e4bb0bacda438e024a4b6b3b69" dependencies = [ + "deno-proc-macro-rules", "lazy-regex", "once_cell", "pmutil", @@ -799,7 +824,12 @@ dependencies = [ "proc-macro2", "quote", "regex", + "strum", + "strum_macros", "syn 1.0.109", + "syn 2.0.18", + "thiserror", + "v8", ] [[package]] @@ -2086,13 +2116,13 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "pmutil" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" +checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -2182,9 +2212,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -2239,9 +2269,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2703,9 +2733,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.92.0" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d2fb8b104d897bb6f58e65f6512b7d7c95b70b589649bc9e19333defbb1a4e" +checksum = "7a1a26c89d56d8607d220c639e971e3e3901138fcc5dd0f619cee0868e1cc89e" dependencies = [ "bytes", "derive_more", @@ -2853,6 +2883,28 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.18", +] + [[package]] name = "subtle" version = "2.5.0" @@ -2941,22 +2993,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -3455,13 +3507,13 @@ dependencies = [ [[package]] name = "v8" -version = "0.68.0" +version = "0.74.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81c69410b7435f1b74e82e243ba906d71e8b9bb350828291418b9311dbd77222" +checksum = "2eedac634b8dd39b889c5b62349cbc55913780226239166435c5cf66771792ea" dependencies = [ "bitflags", "fslock", - "lazy_static", + "once_cell", "which", ] diff --git a/core/Cargo.toml b/core/Cargo.toml index 4ecfd60e61644..daf5a5b8b2fa5 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -54,4 +54,4 @@ qdrant-client = "1.4" tower-http = {version = "0.4", features = ["full"]} tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -deno_core = "0.181" +deno_core = "0.197" diff --git a/core/src/deno/script.rs b/core/src/deno/script.rs index 33e5864e9aec5..34db2f26099c4 100644 --- a/core/src/deno/script.rs +++ b/core/src/deno/script.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use deno_core::{op, Extension, JsRuntime, OpState, ZeroCopyBuf}; +use deno_core::{op, Extension, JsRuntime, OpState}; use serde::de::DeserializeOwned; use serde::Serialize; use std::borrow::Cow; @@ -155,7 +155,6 @@ impl deno_core::Resource for ResultResource { fn op_return( state: &mut OpState, args: serde_json::Value, - _buf: Option, ) -> Result { let entry = ResultResource { json_value: args }; let resource_table = &mut state.resource_table;