diff --git a/.github/workflows/cloud.yml b/.github/workflows/cloud.yml index c31898aef591c..f89759d78a85a 100644 --- a/.github/workflows/cloud.yml +++ b/.github/workflows/cloud.yml @@ -71,7 +71,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/drivers-tests.yml b/.github/workflows/drivers-tests.yml index 6cacade498ac7..1a329a94a949b 100644 --- a/.github/workflows/drivers-tests.yml +++ b/.github/workflows/drivers-tests.yml @@ -104,7 +104,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index adab7c68d235c..a7fd8342b7324 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -55,7 +55,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 7c401c171d2d7..6dc6cdd39a5c8 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -32,7 +32,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3c3d0e70a329f..30e3fed04a7bb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -95,7 +95,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -185,7 +185,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -260,7 +260,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8a1a89da73a23..bfe45fa6b168e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -72,7 +72,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -152,7 +152,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -215,7 +215,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -337,7 +337,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -414,7 +414,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -641,7 +641,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 74741e466a7e9..c0308adfe31b9 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -32,7 +32,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt, clippy @@ -138,7 +138,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -244,7 +244,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt @@ -327,7 +327,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-07-15 + toolchain: 1.84.1 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/packages/cubejs-backend-native/.cargo/config.toml b/packages/cubejs-backend-native/.cargo/config.toml index 82c8ed99a3d7b..7000a9c841fc1 100644 --- a/packages/cubejs-backend-native/.cargo/config.toml +++ b/packages/cubejs-backend-native/.cargo/config.toml @@ -1,7 +1 @@ # Please keep in sync this file with rust/cubesql! - -[target."x86_64-unknown-linux-gnu"] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] - -[target."aarch64-unknown-linux-gnu"] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] diff --git a/packages/cubejs-backend-native/rust-toolchain.toml b/packages/cubejs-backend-native/rust-toolchain.toml index 13598fb83c3c0..d9f5179de3d93 100644 --- a/packages/cubejs-backend-native/rust-toolchain.toml +++ b/packages/cubejs-backend-native/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-07-15" +channel = "1.84.1" components = ["rustfmt", "clippy"] -profile = "minimal" \ No newline at end of file +profile = "minimal" diff --git a/packages/cubejs-backend-native/src/node_obj_deserializer.rs b/packages/cubejs-backend-native/src/node_obj_deserializer.rs index d9ed815682792..9f10790cfd1c4 100644 --- a/packages/cubejs-backend-native/src/node_obj_deserializer.rs +++ b/packages/cubejs-backend-native/src/node_obj_deserializer.rs @@ -41,7 +41,7 @@ impl<'a, 'b> JsValueDeserializer<'a, 'b> { } } -impl<'de, 'a, 'b> Deserializer<'de> for JsValueDeserializer<'a, 'b> { +impl<'de> Deserializer<'de> for JsValueDeserializer<'_, '_> { type Error = JsDeserializationError; fn deserialize_any(self, visitor: V) -> Result @@ -294,7 +294,7 @@ impl<'a, 'b> JsObjectDeserializer<'a, 'b> { // `MapAccess` is provided to the `Visitor` to give it the ability to iterate // through entries of the map. -impl<'de, 'a, 'b> MapAccess<'de> for JsObjectDeserializer<'a, 'b> { +impl<'de> MapAccess<'de> for JsObjectDeserializer<'_, '_> { type Error = JsDeserializationError; fn next_key_seed(&mut self, seed: K) -> Result, Self::Error> @@ -343,7 +343,7 @@ impl<'a, 'b> JsArrayDeserializer<'a, 'b> { // `SeqAccess` is provided to the `Visitor` to give it the ability to iterate // through elements of the sequence. -impl<'de, 'a, 'b> SeqAccess<'de> for JsArrayDeserializer<'a, 'b> { +impl<'de> SeqAccess<'de> for JsArrayDeserializer<'_, '_> { type Error = JsDeserializationError; fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> @@ -381,7 +381,7 @@ impl<'a, 'b> JsEnumDeserializer<'a, 'b> { // `EnumAccess` is provided to the `Visitor` to give it the ability to determine // which variant of the enum is supposed to be deserialized. -impl<'de, 'a, 'b> EnumAccess<'de> for JsEnumDeserializer<'a, 'b> { +impl<'de> EnumAccess<'de> for JsEnumDeserializer<'_, '_> { type Error = JsDeserializationError; type Variant = Self; @@ -394,7 +394,7 @@ impl<'de, 'a, 'b> EnumAccess<'de> for JsEnumDeserializer<'a, 'b> { } } -impl<'de, 'a, 'b> VariantAccess<'de> for JsEnumDeserializer<'a, 'b> { +impl<'de> VariantAccess<'de> for JsEnumDeserializer<'_, '_> { type Error = JsDeserializationError; // If the `Visitor` expected this variant to be a unit variant, the input diff --git a/packages/cubejs-backend-native/src/node_obj_serializer.rs b/packages/cubejs-backend-native/src/node_obj_serializer.rs index 5fae33cd6b2ed..ea9f370f6adfe 100644 --- a/packages/cubejs-backend-native/src/node_obj_serializer.rs +++ b/packages/cubejs-backend-native/src/node_obj_serializer.rs @@ -53,7 +53,7 @@ impl<'a, 'b, C: Context<'a>> NodeObjSerializer<'a, 'b, C> { } } -impl<'a, 'b, 'c, C: Context<'a>> ser::Serializer for &'c mut NodeObjSerializer<'a, 'b, C> { +impl<'a, 'c, C: Context<'a>> ser::Serializer for &'c mut NodeObjSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; type SerializeSeq = NodeObjSeqSerializer<'a, 'c, C>; @@ -242,7 +242,7 @@ impl<'a, 'b, 'c, C: Context<'a>> ser::Serializer for &'c mut NodeObjSerializer<' } } -impl<'a, 'b, C: Context<'a>> ser::SerializeMap for NodeObjMapSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeMap for NodeObjMapSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; @@ -284,7 +284,7 @@ impl<'a, 'b, C: Context<'a>> ser::SerializeMap for NodeObjMapSerializer<'a, 'b, } } -impl<'a, 'b, C: Context<'a>> ser::SerializeTuple for NodeObjTupleSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeTuple for NodeObjTupleSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; @@ -299,7 +299,7 @@ impl<'a, 'b, C: Context<'a>> ser::SerializeTuple for NodeObjTupleSerializer<'a, } } -impl<'a, 'b, C: Context<'a>> ser::SerializeTupleStruct for NodeObjTupleSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeTupleStruct for NodeObjTupleSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; @@ -314,7 +314,7 @@ impl<'a, 'b, C: Context<'a>> ser::SerializeTupleStruct for NodeObjTupleSerialize } } -impl<'a, 'b, C: Context<'a>> ser::SerializeTupleVariant for NodeObjTupleSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeTupleVariant for NodeObjTupleSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; @@ -329,7 +329,7 @@ impl<'a, 'b, C: Context<'a>> ser::SerializeTupleVariant for NodeObjTupleSerializ } } -impl<'a, 'b, C: Context<'a>> ser::SerializeStruct for NodeObjMapSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeStruct for NodeObjMapSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; @@ -350,7 +350,7 @@ impl<'a, 'b, C: Context<'a>> ser::SerializeStruct for NodeObjMapSerializer<'a, ' } } -impl<'a, 'b, C: Context<'a>> ser::SerializeStructVariant for NodeObjMapSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeStructVariant for NodeObjMapSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; @@ -369,7 +369,7 @@ impl<'a, 'b, C: Context<'a>> ser::SerializeStructVariant for NodeObjMapSerialize } } -impl<'a, 'b, C: Context<'a>> ser::SerializeSeq for NodeObjSeqSerializer<'a, 'b, C> { +impl<'a, C: Context<'a>> ser::SerializeSeq for NodeObjSeqSerializer<'a, '_, C> { type Ok = Handle<'a, JsValue>; type Error = NodeObjSerializerError; diff --git a/rust/cubenativeutils/Cargo.lock b/rust/cubenativeutils/Cargo.lock index 59b5872a1fd3c..a428a689435cd 100644 --- a/rust/cubenativeutils/Cargo.lock +++ b/rust/cubenativeutils/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -34,7 +34,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", "zerocopy", @@ -204,7 +204,7 @@ checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -293,7 +293,7 @@ dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", ] @@ -412,12 +412,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -545,7 +539,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -677,7 +671,6 @@ dependencies = [ name = "cubesql" version = "0.28.0" dependencies = [ - "anyhow", "arc-swap", "async-stream", "async-trait", @@ -685,12 +678,10 @@ dependencies = [ "bigdecimal", "bincode", "bitflags 1.3.2", - "byteorder", "bytes", "chrono", "chrono-tz", "comfy-table 7.1.1", - "csv", "cubeclient", "datafusion", "egg", @@ -703,7 +694,6 @@ dependencies = [ "log", "lru", "minijinja", - "mockall", "paste", "pg-srv", "postgres-types", @@ -715,10 +705,9 @@ dependencies = [ "sha1_smol", "sha2", "simple_logger", - "smallvec", "sqlparser", "tera", - "thiserror", + "thiserror 2.0.11", "tokio", "tokio-util", "tracing", @@ -817,12 +806,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "difference" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" - [[package]] name = "digest" version = "0.10.7" @@ -834,12 +817,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "downcast" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb454f0228b18c7f4c3b0ebbee346ed9c52e7443b0999cd543ff3571205701d" - [[package]] name = "egg" version = "0.9.5" @@ -858,7 +835,7 @@ dependencies = [ "smallvec", "symbol_table", "symbolic_expressions", - "thiserror", + "thiserror 1.0.61", "vectorize", ] @@ -934,7 +911,7 @@ checksum = "86b428b715fdbdd1c364b84573b5fdc0f84f8e423661b9f398735278bc7f2b6a" dependencies = [ "bitflags 1.3.2", "smallvec", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -947,15 +924,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "float-cmp" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" -dependencies = [ - "num-traits", -] - [[package]] name = "fnv" version = "1.0.7" @@ -971,21 +939,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fragile" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7464c5c4a3f014d9b2ec4073650e5c06596f385060af740fc45ad5a19f959e8" -dependencies = [ - "fragile 2.0.0", -] - -[[package]] -name = "fragile" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" - [[package]] name = "funty" version = "2.0.0" @@ -1106,7 +1059,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi", ] @@ -1385,7 +1338,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1526,7 +1479,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-targets 0.52.6", ] @@ -1593,7 +1546,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest", ] @@ -1657,33 +1610,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "mockall" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cabea45a7fc0e37093f4f30a5e2b62602253f91791c057d5f0470c63260c3d" -dependencies = [ - "cfg-if 0.1.10", - "downcast", - "fragile 1.2.2", - "lazy_static", - "mockall_derive", - "predicates", - "predicates-tree", -] - -[[package]] -name = "mockall_derive" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c461918bf7f59eefb1459252756bf2351a995d6bd510d0b2061bd86bcdabfa6" -dependencies = [ - "cfg-if 0.1.10", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "multiversion" version = "0.6.1" @@ -1730,12 +1656,6 @@ dependencies = [ "syn-mid", ] -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - [[package]] name = "num" version = "0.4.3" @@ -1874,7 +1794,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -1939,7 +1859,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.61", "ucd-trie", ] @@ -1986,7 +1906,7 @@ dependencies = [ "bytes", "chrono", "log", - "thiserror", + "thiserror 2.0.11", "tokio", ] @@ -2102,35 +2022,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "predicates" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" -dependencies = [ - "difference", - "float-cmp", - "normalize-line-endings", - "predicates-core", - "regex", -] - -[[package]] -name = "predicates-core" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" - -[[package]] -name = "predicates-tree" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" -dependencies = [ - "predicates-core", - "termtree", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -2204,7 +2095,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", ] @@ -2221,7 +2112,7 @@ dependencies = [ "rustc-hash", "rustls", "slab", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tracing", ] @@ -2390,7 +2281,7 @@ dependencies = [ "http", "reqwest", "serde", - "thiserror", + "thiserror 1.0.61", "tower-service", ] @@ -2401,7 +2292,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "getrandom", "libc", "spin", @@ -2635,7 +2526,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -2860,7 +2751,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "rustix", "windows-sys 0.52.0", @@ -2883,18 +2774,21 @@ dependencies = [ ] [[package]] -name = "termtree" -version = "0.4.1" +name = "thiserror" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl 1.0.61", +] [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.11", ] [[package]] @@ -2908,6 +2802,17 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + [[package]] name = "threadpool" version = "1.8.1" @@ -3294,7 +3199,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -3319,7 +3224,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -3567,7 +3472,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] diff --git a/rust/cubenativeutils/rust-toolchain.toml b/rust/cubenativeutils/rust-toolchain.toml index ef8073e17f1d2..8237034eda99e 100644 --- a/rust/cubenativeutils/rust-toolchain.toml +++ b/rust/cubenativeutils/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-07-15" +channel = "1.84.1" components = ["rustfmt", "rustc-dev", "clippy"] profile = "minimal" diff --git a/rust/cubenativeutils/rustfmt.toml b/rust/cubenativeutils/rustfmt.toml index d9ba5fdb90ba3..fb03d7e9d9a7a 100644 --- a/rust/cubenativeutils/rustfmt.toml +++ b/rust/cubenativeutils/rustfmt.toml @@ -1 +1,2 @@ -imports_granularity = "Crate" \ No newline at end of file +# TODO: Uncomment, when it will become stable in rustfmt - https://github.com/rust-lang/rustfmt/issues/4991 +# imports_granularity = "Crate" diff --git a/rust/cubenativeutils/src/wrappers/neon/context.rs b/rust/cubenativeutils/src/wrappers/neon/context.rs index cc5139110f393..aff6f55a693e3 100644 --- a/rust/cubenativeutils/src/wrappers/neon/context.rs +++ b/rust/cubenativeutils/src/wrappers/neon/context.rs @@ -59,7 +59,7 @@ impl<'cx, C: Context<'cx> + NoenContextLifetimeExpand<'cx> + 'cx> NeonContextGua fn new(cx: C) -> Self { Self { context: ContextWrapper::new(cx.expand_lifetime()), - lifetime: PhantomData::default(), + lifetime: PhantomData, } } @@ -111,9 +111,9 @@ impl> ContextHolder { let res = cx.with_context(f); Ok(res) } else { - Err(CubeError::internal(format!( - "Call to neon context outside of its lifetime" - ))) + Err(CubeError::internal( + "Call to neon context outside of its lifetime".to_string(), + )) } } } diff --git a/rust/cubenativeutils/src/wrappers/neon/object/base_types.rs b/rust/cubenativeutils/src/wrappers/neon/object/base_types.rs index 54d1a7de02285..2889f970875a5 100644 --- a/rust/cubenativeutils/src/wrappers/neon/object/base_types.rs +++ b/rust/cubenativeutils/src/wrappers/neon/object/base_types.rs @@ -85,7 +85,7 @@ impl, T: 'static> NeonBox { pub fn new(object: NeonTypeHandle>) -> Self { Self { object, - _marker: PhantomData::default(), + _marker: PhantomData, } } } diff --git a/rust/cubenativeutils/src/wrappers/neon/object/mod.rs b/rust/cubenativeutils/src/wrappers/neon/object/mod.rs index 54b28d10684b5..751acb6737278 100644 --- a/rust/cubenativeutils/src/wrappers/neon/object/mod.rs +++ b/rust/cubenativeutils/src/wrappers/neon/object/mod.rs @@ -29,7 +29,7 @@ impl + 'static, V: Value + 'static> NeonTypeHandle { } pub fn get_object(&self) -> Handle<'static, V> { - self.object.clone() + self.object } pub fn get_object_ref(&self) -> &Handle<'static, V> { @@ -73,7 +73,7 @@ impl, V: Value + 'static> Clone for NeonTypeHandle { fn clone(&self) -> Self { Self { context: self.context.clone(), - object: self.object.clone(), + object: self.object, } } } @@ -89,7 +89,7 @@ impl + 'static> NeonObject { } pub fn get_object(&self) -> Handle<'static, JsValue> { - self.object.clone() + self.object } pub fn get_object_ref(&self) -> &Handle<'static, JsValue> { @@ -169,7 +169,7 @@ impl> Clone for NeonObject { fn clone(&self) -> Self { Self { context: self.context.clone(), - object: self.object.clone(), + object: self.object, } } } diff --git a/rust/cubenativeutils/src/wrappers/neon/object/neon_function.rs b/rust/cubenativeutils/src/wrappers/neon/object/neon_function.rs index 192db172e1c8a..216b6852f668e 100644 --- a/rust/cubenativeutils/src/wrappers/neon/object/neon_function.rs +++ b/rust/cubenativeutils/src/wrappers/neon/object/neon_function.rs @@ -39,7 +39,7 @@ impl + 'static> NativeFunction> for NeonFu let null = cx.null(); neon_object .call(cx, null, neon_args) - .map_err(|_| CubeError::internal(format!("Failed to call function "))) + .map_err(|_| CubeError::internal("Failed to call function ".to_string())) })??; Ok(NativeObjectHandle::new(NeonObject::new( self.object.context.clone(), @@ -54,7 +54,7 @@ impl + 'static> NativeFunction> for NeonFu let res = neon_object .to_string(cx) .map_err(|_| { - CubeError::internal(format!("Can't convert function to string")) + CubeError::internal("Can't convert function to string".to_string()) })? .value(cx); Ok(res) diff --git a/rust/cubenativeutils/src/wrappers/neon/object/neon_struct.rs b/rust/cubenativeutils/src/wrappers/neon/object/neon_struct.rs index 3d41ef9dbe5ff..a5446b6fa4264 100644 --- a/rust/cubenativeutils/src/wrappers/neon/object/neon_struct.rs +++ b/rust/cubenativeutils/src/wrappers/neon/object/neon_struct.rs @@ -74,13 +74,13 @@ impl + 'static> NativeStruct> for NeonStru &self, ) -> Result>>, CubeError> { let neon_array = self.object.map_neon_object(|cx, neon_object| { - let neon_array = neon_object - .get_own_property_names(cx) - .map_err(|_| CubeError::internal(format!("Cannot get own properties not found")))?; + let neon_array = neon_object.get_own_property_names(cx).map_err(|_| { + CubeError::internal("Cannot get own properties not found".to_string()) + })?; neon_array .to_vec(cx) - .map_err(|_| CubeError::internal(format!("Failed to convert array"))) + .map_err(|_| CubeError::internal("Failed to convert array".to_string())) })??; Ok(neon_array .into_iter() @@ -102,7 +102,7 @@ impl + 'static> NativeStruct> for NeonStru .get::(cx, method) .map_err(|_| CubeError::internal(format!("Method `{}` not found", method)))?; neon_method - .call(cx, neon_object.clone(), neon_args) + .call(cx, *neon_object, neon_args) .map_err(|err| { CubeError::internal(format!( "Failed to call method `{} {} {:?}", diff --git a/rust/cubenativeutils/src/wrappers/serializer/deserializer.rs b/rust/cubenativeutils/src/wrappers/serializer/deserializer.rs index ff85659831fa6..d3e0640103c83 100644 --- a/rust/cubenativeutils/src/wrappers/serializer/deserializer.rs +++ b/rust/cubenativeutils/src/wrappers/serializer/deserializer.rs @@ -123,7 +123,7 @@ impl<'de, IT: InnerTypes> Deserializer<'de> for NativeSerdeDeserializer { V: Visitor<'de>, { if let Ok(val) = self.input.to_number() { - visitor.visit_f64(val.value().unwrap() as f64) + visitor.visit_f64(val.value().unwrap()) } else { Err(NativeObjSerializerError::Message( "JS Number expected for f64 field".to_string(), @@ -178,7 +178,7 @@ struct NativeMapDeserializer { impl NativeMapDeserializer { pub fn new(input: IT::Struct) -> Result { let prop_names = input.get_own_property_names().map_err(|_| { - NativeObjSerializerError::Message(format!("Failed to get property names")) + NativeObjSerializerError::Message("Failed to get property names".to_string()) })?; let len = prop_names.len() as u32; Ok(Self { @@ -214,23 +214,23 @@ impl<'de, IT: InnerTypes> MapAccess<'de> for NativeMapDeserializer { V: DeserializeSeed<'de>, { if self.value_idx >= self.len { - return Err(NativeObjSerializerError::Message(format!( - "Array index out of bounds" - ))); + return Err(NativeObjSerializerError::Message( + "Array index out of bounds".to_string(), + )); } let prop_name = self .prop_names .get(self.value_idx as usize) .ok_or_else(|| { - NativeObjSerializerError::Message(format!("Array index out of bounds")) + NativeObjSerializerError::Message("Array index out of bounds".to_string()) })?; let prop_string = prop_name .to_string() .and_then(|s| s.value()) - .map_err(|_| NativeObjSerializerError::Message(format!("key should be string")))?; + .map_err(|_| NativeObjSerializerError::Message("key should be string".to_string()))?; let value = self.input.get_field(&prop_string).map_err(|_| { - NativeObjSerializerError::Message(format!("Failed to get property name")) + NativeObjSerializerError::Message("Failed to get property name".to_string()) })?; self.value_idx += 1; diff --git a/rust/cubenativeutils/src/wrappers/serializer/serializer.rs b/rust/cubenativeutils/src/wrappers/serializer/serializer.rs index 5750bc656a364..6570df1e3ff5d 100644 --- a/rust/cubenativeutils/src/wrappers/serializer/serializer.rs +++ b/rust/cubenativeutils/src/wrappers/serializer/serializer.rs @@ -115,7 +115,7 @@ impl ser::Serializer for NativeSerdeSerializer { fn serialize_f64(self, v: f64) -> Result { Ok(NativeObjectHandle::new( - self.context.number(v as f64)?.into_object(), + self.context.number(v)?.into_object(), )) } diff --git a/rust/cubeorchestrator/rust-toolchain.toml b/rust/cubeorchestrator/rust-toolchain.toml index 040357e9b1d43..d9f5179de3d93 100644 --- a/rust/cubeorchestrator/rust-toolchain.toml +++ b/rust/cubeorchestrator/rust-toolchain.toml @@ -1,5 +1,4 @@ [toolchain] -#channel = "stable" -channel = "nightly-2024-07-15" +channel = "1.84.1" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubeshared/rust-toolchain.toml b/rust/cubeshared/rust-toolchain.toml index 040357e9b1d43..d9f5179de3d93 100644 --- a/rust/cubeshared/rust-toolchain.toml +++ b/rust/cubeshared/rust-toolchain.toml @@ -1,5 +1,4 @@ [toolchain] -#channel = "stable" -channel = "nightly-2024-07-15" +channel = "1.84.1" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubesql/.cargo/config.toml b/rust/cubesql/.cargo/config.toml index 8d85301d2df7e..c5a642cb11e2d 100644 --- a/rust/cubesql/.cargo/config.toml +++ b/rust/cubesql/.cargo/config.toml @@ -1,11 +1,5 @@ # Please keep in sync this file with packages/cubejs-backend-native! -[target."x86_64-unknown-linux-gnu"] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] - -[target."aarch64-unknown-linux-gnu"] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] - # If you are going to use local fork, feel free to uncomment #paths = ["../../../sqlparser-rs", "../../../arrow-datafusion/datafusion"] #paths = ["../../../arrow-datafusion/datafusion"] diff --git a/rust/cubesql/cubeclient/src/models/v1_cube_meta_type.rs b/rust/cubesql/cubeclient/src/models/v1_cube_meta_type.rs index 94cdb84e03dbb..63662f481a431 100644 --- a/rust/cubesql/cubeclient/src/models/v1_cube_meta_type.rs +++ b/rust/cubesql/cubeclient/src/models/v1_cube_meta_type.rs @@ -9,7 +9,6 @@ */ /// V1CubeMetaType : Type of cube - /// Type of cube #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum V1CubeMetaType { diff --git a/rust/cubesql/cubesql/e2e/tests/postgres.rs b/rust/cubesql/cubesql/e2e/tests/postgres.rs index 472ad783fcf43..88343606e412e 100644 --- a/rust/cubesql/cubesql/e2e/tests/postgres.rs +++ b/rust/cubesql/cubesql/e2e/tests/postgres.rs @@ -109,7 +109,7 @@ impl PostgresIntegrationTestSuite { client } - async fn print_query_result<'a>( + async fn print_query_result( &self, res: Vec, with_description: bool, diff --git a/rust/cubesql/cubesql/src/compile/engine/df/optimizers/filter_push_down.rs b/rust/cubesql/cubesql/src/compile/engine/df/optimizers/filter_push_down.rs index 6a5b6cc6064e5..4c078d69a607e 100644 --- a/rust/cubesql/cubesql/src/compile/engine/df/optimizers/filter_push_down.rs +++ b/rust/cubesql/cubesql/src/compile/engine/df/optimizers/filter_push_down.rs @@ -576,34 +576,32 @@ fn rewrite_map_for_projection( .collect() } -/// Generates a rewrite map for union inputs, taking UNION's schema and one of the input's schema. -/// These expressions can't be more complex than simple column references by definition. -/// -/// TODO: see `LogicalPlan::Union` above -/* -fn rewrite_map_for_union_input( - union_schema: &DFSchema, - input_schema: &DFSchema, -) -> HashMap> { - union_schema - .fields() - .iter() - .zip(input_schema.fields().iter()) - .flat_map(|(union_field, input_field)| { - vec![ - ( - union_field.qualified_column(), - Some(Expr::Column(input_field.unqualified_column())), - ), - ( - union_field.unqualified_column(), - Some(Expr::Column(input_field.unqualified_column())), - ), - ] - }) - .collect() -} -*/ +// /// Generates a rewrite map for union inputs, taking UNION's schema and one of the input's schema. +// /// These expressions can't be more complex than simple column references by definition. +// /// +// /// TODO: see `LogicalPlan::Union` above +// fn rewrite_map_for_union_input( +// union_schema: &DFSchema, +// input_schema: &DFSchema, +// ) -> HashMap> { +// union_schema +// .fields() +// .iter() +// .zip(input_schema.fields().iter()) +// .flat_map(|(union_field, input_field)| { +// vec![ +// ( +// union_field.qualified_column(), +// Some(Expr::Column(input_field.unqualified_column())), +// ), +// ( +// union_field.unqualified_column(), +// Some(Expr::Column(input_field.unqualified_column())), +// ), +// ] +// }) +// .collect() +// } /// Recursively concatenates several filter predicates into one binary AND expression. /// `predicates` must contain at least one expression. @@ -621,24 +619,22 @@ fn concatenate_predicates(predicates: Vec) -> Result { )) } -/// Recursively splits filter predicate from binary AND expressions into a flat vec of predicates. -/// -/// TODO: see `LogicalPlan::Filter` above -/* -fn split_predicates(predicate: &Expr) -> Vec { - match predicate { - Expr::BinaryExpr { - left, - op: Operator::And, - right, - } => split_predicates(left) - .into_iter() - .chain(split_predicates(right).into_iter()) - .collect(), - expr => vec![expr.clone()], - } -} -*/ +// /// Recursively splits filter predicate from binary AND expressions into a flat vec of predicates. +// /// +// /// TODO: see `LogicalPlan::Filter` above +// fn split_predicates(predicate: &Expr) -> Vec { +// match predicate { +// Expr::BinaryExpr { +// left, +// op: Operator::And, +// right, +// } => split_predicates(left) +// .into_iter() +// .chain(split_predicates(right).into_iter()) +// .collect(), +// expr => vec![expr.clone()], +// } +// } /// Recursively checks if the passed expr is a filter predicate that can be pushed down. /// The predicate should be pushed down the plan if it can ultimately be pushed down to CubeScan. diff --git a/rust/cubesql/cubesql/src/compile/engine/df/optimizers/utils.rs b/rust/cubesql/cubesql/src/compile/engine/df/optimizers/utils.rs index 459a7525b524d..e0240b4dd8811 100644 --- a/rust/cubesql/cubesql/src/compile/engine/df/optimizers/utils.rs +++ b/rust/cubesql/cubesql/src/compile/engine/df/optimizers/utils.rs @@ -386,7 +386,7 @@ pub fn is_const_expr(expr: &Expr) -> bool { _ => false, }, Expr::InList { expr, list, .. } => { - is_const_expr(expr) && list.iter().map(|item| is_const_expr(item)).all(|item| item) + is_const_expr(expr) && list.iter().all(|item| is_const_expr(item)) } _ => false, } diff --git a/rust/cubesql/cubesql/src/compile/engine/variable_provider.rs b/rust/cubesql/cubesql/src/compile/engine/variable_provider.rs index d3c68b9989f60..24afdb8444268 100644 --- a/rust/cubesql/cubesql/src/compile/engine/variable_provider.rs +++ b/rust/cubesql/cubesql/src/compile/engine/variable_provider.rs @@ -25,7 +25,7 @@ impl VariablesProvider { fn get_session_value(&self, identifier: Vec, var_type: VarType) -> Result { let key = if identifier.len() > 1 { - let ignore_first = identifier[0].to_ascii_lowercase() == "@@session"; + let ignore_first = identifier[0].eq_ignore_ascii_case("@@session"); if ignore_first { identifier[1..].concat() } else { @@ -48,7 +48,7 @@ impl VariablesProvider { fn get_global_value(&self, identifier: Vec) -> Result { let key = if identifier.len() > 1 { - let ignore_first = identifier[0].to_ascii_lowercase() == "@@global"; + let ignore_first = identifier[0].eq_ignore_ascii_case("@@global"); if ignore_first { identifier[1..].concat() @@ -85,7 +85,7 @@ impl VarProvider for VariablesProvider { match (&first_word_vec[0], &first_word_vec[1]) { ('@', '@') => { - if identifier.len() > 1 && identifier[0].to_ascii_lowercase() == "@@session" { + if identifier.len() > 1 && identifier[0].eq_ignore_ascii_case("@@session") { return self.get_session_value(identifier, VarType::System); } diff --git a/rust/cubesql/pg-srv/src/pg_type.rs b/rust/cubesql/pg-srv/src/pg_type.rs index d98b7cac656c1..9bf97de13d508 100644 --- a/rust/cubesql/pg-srv/src/pg_type.rs +++ b/rust/cubesql/pg-srv/src/pg_type.rs @@ -31,7 +31,7 @@ pub struct PgType<'a> { pub typreceive_oid: u32, } -impl<'a> PgType<'a> { +impl PgType<'_> { pub fn get_typinput(&self) -> String { if let Some(ty_id) = PgTypeId::from_oid(self.oid) { // TODO: It requires additional verification diff --git a/rust/cubesql/rust-toolchain.toml b/rust/cubesql/rust-toolchain.toml index 2b415db8a537f..d9f5179de3d93 100644 --- a/rust/cubesql/rust-toolchain.toml +++ b/rust/cubesql/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-07-15" +channel = "1.84.1" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubesql/rustfmt.toml b/rust/cubesql/rustfmt.toml index d9ba5fdb90ba3..be1668230292f 100644 --- a/rust/cubesql/rustfmt.toml +++ b/rust/cubesql/rustfmt.toml @@ -1 +1,2 @@ -imports_granularity = "Crate" \ No newline at end of file +# TODO: Uncomment, when it will become stable in rustfmt - https://github.com/rust-lang/rustfmt/issues/4991 +# imports_granularity = "Crate" \ No newline at end of file diff --git a/rust/cubesqlplanner/rust-toolchain.toml b/rust/cubesqlplanner/rust-toolchain.toml index ef8073e17f1d2..8237034eda99e 100644 --- a/rust/cubesqlplanner/rust-toolchain.toml +++ b/rust/cubesqlplanner/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-07-15" +channel = "1.84.1" components = ["rustfmt", "rustc-dev", "clippy"] profile = "minimal"