From f87293cc38842e6a44b47de905b883c6ebdfaac2 Mon Sep 17 00:00:00 2001 From: Tarik Eshaq Date: Thu, 8 Feb 2024 14:04:11 -0500 Subject: [PATCH 1/2] Upgrades rustc in CI and Docker to 1.75 --- .circleci/config.yml | 8 ++++---- Dockerfile | 2 +- syncserver/src/server/test.rs | 2 +- syncstorage-spanner/src/models.rs | 5 +---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fc3ca8f2bc..92ae4e0dff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -161,7 +161,7 @@ commands: jobs: checks: docker: - - image: cimg/rust:1.72.0 + - image: cimg/rust:1.75.0 auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -178,7 +178,7 @@ jobs: build-and-test: docker: - - image: cimg/rust:1.72.0 + - image: cimg/rust:1.75.0 auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -214,7 +214,7 @@ jobs: #- save-sccache-cache build-mysql-image: docker: - - image: cimg/rust:1.60.0 + - image: cimg/rust:1.75.0 auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -245,7 +245,7 @@ jobs: build-spanner-image: docker: - - image: cimg/rust:1.60.0 + - image: cimg/rust:1.75.0 auth: username: $DOCKER_USER password: $DOCKER_PASS diff --git a/Dockerfile b/Dockerfile index c66201d926..8f71ce7f34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml -FROM docker.io/lukemathwalker/cargo-chef:0.1.62-rust-1.72-bullseye as chef +FROM docker.io/lukemathwalker/cargo-chef:0.1.62-rust-1.75-bullseye as chef WORKDIR /app FROM chef AS planner diff --git a/syncserver/src/server/test.rs b/syncserver/src/server/test.rs index ec09879196..d9dfa05443 100644 --- a/syncserver/src/server/test.rs +++ b/syncserver/src/server/test.rs @@ -145,7 +145,7 @@ fn create_request( "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0", )); if let Some(body) = payload { - req = req.set_json(&body); + req = req.set_json(body); }; if let Some(h) = headers { for (k, v) in h { diff --git a/syncstorage-spanner/src/models.rs b/syncstorage-spanner/src/models.rs index 872b2f5e34..6a0a19dac4 100644 --- a/syncstorage-spanner/src/models.rs +++ b/syncstorage-spanner/src/models.rs @@ -1842,10 +1842,7 @@ impl SpannerDb { sqlparam_types.insert("payload".to_owned(), payload.spanner_type()); sqlparams.insert("payload".to_string(), payload.into_spanner_value()); let now_millis = timestamp.as_i64(); - let ttl = bso.ttl.map_or(i64::from(DEFAULT_BSO_TTL), |ttl| { - ttl.try_into() - .expect("Could not get ttl in put_bso_async_test") - }) * 1000; + let ttl = bso.ttl.map_or(i64::from(DEFAULT_BSO_TTL), |ttl| ttl.into()) * 1000; let expirystring = to_rfc3339(now_millis + ttl)?; debug!( "!!!!! [test] INSERT expirystring:{:?}, timestamp:{:?}, ttl:{:?}", From 59af44cdb272bb22351ec7b78654f8eb6586f354 Mon Sep 17 00:00:00 2001 From: Tarik Eshaq Date: Thu, 8 Feb 2024 15:29:32 -0500 Subject: [PATCH 2/2] Adds --locked to cargo install in CI --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92ae4e0dff..1a67d4e18c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ commands: name: Setup Rust checks command: | rustup component add rustfmt - cargo install cargo-audit + cargo install --locked cargo-audit rustup component add clippy setup-python: steps: @@ -140,7 +140,7 @@ commands: - run: name: Install sccache command: | - cargo install sccache + cargo install --locked sccache # This configures Rust to use sccache. echo 'export "RUSTC_WRAPPER"="sccache"' >> $BASH_ENV # This is the maximum space sccache cache will use on disk.