Skip to content

Commit

Permalink
feat(cubesql): Upgrade rust to nightly-2024-07-15
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Jul 17, 2024
1 parent fb1439e commit 76a69fe
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -335,7 +335,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust-cubesql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt, clippy
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-13
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down
20 changes: 10 additions & 10 deletions packages/cubejs-backend-native/Cargo.lock

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

1 change: 1 addition & 0 deletions packages/cubejs-backend-native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ features = ["napi-1", "napi-4", "napi-6", "futures"]

[features]
default = ["neon-entrypoint"]
neon-debug = []
neon-entrypoint = []
python = ["pyo3", "pyo3-asyncio"]
4 changes: 2 additions & 2 deletions packages/cubejs-backend-native/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-12-13"
components = ["rustfmt", "rustc-dev", "clippy"]
channel = "nightly-2024-07-15"
components = ["rustfmt", "clippy"]
profile = "minimal"
4 changes: 2 additions & 2 deletions packages/cubejs-backend-native/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ impl NodeConfig {
self.config.configure().await;

injector
.register_typed::<dyn TransportService, _, _, _>(async move |_| transport)
.register_typed::<dyn TransportService, _, _, _>(|_| async move { transport })
.await;

injector
.register_typed::<dyn SqlAuthService, _, _, _>(async move |_| auth)
.register_typed::<dyn SqlAuthService, _, _, _>(|_| async move { auth })
.await;

self.config.cube_services().await
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-backend-native/src/cross/py_in_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Finalize for JsPyFunctionWrapper {}
pub type BoxedJsPyFunctionWrapper = JsBox<RefCell<JsPyFunctionWrapper>>;

pub fn cl_repr_py_function_wrapper(mut cx: FunctionContext) -> JsResult<JsPromise> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("cl_repr_py_function_wrapper {}", _fun_name);

let (deferred, promise) = cx.promise();
Expand Down
10 changes: 5 additions & 5 deletions packages/cubejs-backend-native/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use cubesql::CubeError;
use neon::prelude::*;
use tokio::sync::{oneshot, Semaphore};

#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
use log::trace;

use neon::types::JsDate;
Expand Down Expand Up @@ -241,7 +241,7 @@ impl ValueObject for JsValueObject<'_> {
}

fn js_stream_push_chunk(mut cx: FunctionContext) -> JsResult<JsUndefined> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("JsWriteStream.push_chunk");

let this = cx
Expand All @@ -267,7 +267,7 @@ fn js_stream_push_chunk(mut cx: FunctionContext) -> JsResult<JsUndefined> {
}

fn js_stream_start(mut cx: FunctionContext) -> JsResult<JsUndefined> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("JsWriteStream.start");

let this = cx
Expand All @@ -279,7 +279,7 @@ fn js_stream_start(mut cx: FunctionContext) -> JsResult<JsUndefined> {
}

fn js_stream_end(mut cx: FunctionContext) -> JsResult<JsUndefined> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("JsWriteStream.end");

let this = cx
Expand All @@ -293,7 +293,7 @@ fn js_stream_end(mut cx: FunctionContext) -> JsResult<JsUndefined> {
}

fn js_stream_reject(mut cx: FunctionContext) -> JsResult<JsUndefined> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("JsWriteStream.reject");

let this = cx
Expand Down
4 changes: 2 additions & 2 deletions packages/cubejs-backend-native/src/template/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl JinjaEngine {
}

fn render_template(mut cx: FunctionContext) -> JsResult<JsPromise> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("JinjaEngine.render_template");

let this = cx
Expand Down Expand Up @@ -138,7 +138,7 @@ impl JinjaEngine {
}

fn load_template(mut cx: FunctionContext) -> JsResult<JsUndefined> {
#[cfg(build = "debug")]
#[cfg(feature = "neon-debug")]
trace!("JinjaEngine.load_template");

let this = cx
Expand Down
6 changes: 0 additions & 6 deletions packages/cubejs-backend-native/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use cubesql::{
transport::{CubeStreamReceiver, LoadRequestMeta, MetaContext, TransportService},
CubeError,
};
use serde_derive::Deserialize;
use serde_derive::Serialize;
use std::sync::Arc;
use uuid::Uuid;
Expand Down Expand Up @@ -106,11 +105,6 @@ struct MetaRequest {
only_compiler_id: bool,
}

#[derive(Debug, Serialize, Deserialize)]
struct SqlResponseSerialized {
sql: (String, Vec<String>),
}

#[async_trait]
impl TransportService for NodeBridgeTransport {
async fn meta(&self, ctx: AuthContextRef) -> Result<Arc<MetaContext>, CubeError> {
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/config/injection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Injector {
T: DIService + 'static,
{
self.register_typed::<T, T, F, FF>(factory).await;
self.register_typed::<I, T, _, _>(async move |i: Arc<Injector>| {
self.register_typed::<I, T, _, _>(|i: Arc<Injector>| async move {
i.get_service_typed::<T>().await
})
.await;
Expand Down
14 changes: 7 additions & 7 deletions rust/cubesql/cubesql/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,17 @@ impl Config {
pub async fn configure_injector(&self) {
let config_obj_to_register = self.config_obj.clone();
self.injector
.register_typed::<dyn ConfigObj, _, _, _>(async move |_| config_obj_to_register)
.register_typed::<dyn ConfigObj, _, _, _>(|_| async move { config_obj_to_register })
.await;

self.injector
.register_typed::<dyn TransportService, _, _, _>(async move |_| {
.register_typed::<dyn TransportService, _, _, _>(|_| async move {
Arc::new(HttpTransport::new())
})
.await;

self.injector
.register_typed::<dyn CompilerCache, _, _, _>(async move |i| {
.register_typed::<dyn CompilerCache, _, _, _>(|i| async move {
let config = i.get_service_typed::<dyn ConfigObj>().await;
Arc::new(CompilerCacheImpl::new(
config.clone(),
Expand All @@ -306,7 +306,7 @@ impl Config {
.await;

self.injector
.register_typed::<ServerManager, _, _, _>(async move |i| {
.register_typed::<ServerManager, _, _, _>(|i| async move {
let config = i.get_service_typed::<dyn ConfigObj>().await;
Arc::new(ServerManager::new(
i.get_service_typed().await,
Expand All @@ -319,20 +319,20 @@ impl Config {
.await;

self.injector
.register_typed::<SessionManager, _, _, _>(async move |i| {
.register_typed::<SessionManager, _, _, _>(|i| async move {
Arc::new(SessionManager::new(i.get_service_typed().await))
})
.await;

self.injector
.register_typed::<dyn SqlAuthService, _, _, _>(async move |_| {
.register_typed::<dyn SqlAuthService, _, _, _>(|_| async move {
Arc::new(SqlAuthDefaultImpl)
})
.await;

if self.config_obj.postgres_bind_address().is_some() {
self.injector
.register_typed::<PostgresServer, _, _, _>(async move |i| {
.register_typed::<PostgresServer, _, _, _>(|i| async move {
let config = i.get_service_typed::<dyn ConfigObj>().await;
PostgresServer::new(
config.postgres_bind_address().as_ref().unwrap().to_string(),
Expand Down
4 changes: 2 additions & 2 deletions rust/cubesql/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-12-13"
components = ["rustfmt", "rustc-dev", "clippy"]
channel = "nightly-2024-07-15"
components = ["rustfmt", "clippy"]
profile = "minimal"

0 comments on commit 76a69fe

Please sign in to comment.