Skip to content

Commit

Permalink
feat: bump pinned rust version to 1.65 (#504)
Browse files Browse the repository at this point in the history
* feat: bump pinned rust version to 1.65

 lockfile update is from binary dist PR #483

* ci: install newer protoc

* fix: special module name warning

* fix: clippy

* feat: install newer protoc in dockerfile as well
  • Loading branch information
oddgrd authored Dec 2, 2022
1 parent 887dce4 commit ca97f03
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 19 deletions.
17 changes: 13 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ orbs:
executors:
docker-rust:
docker:
- image: cimg/rust:1.64.0
- image: cimg/rust:1.65.0
image-ubuntu:
machine:
image: ubuntu-2204:2022.04.1
Expand Down Expand Up @@ -99,6 +99,15 @@ commands:
command: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
sudo apt update && sudo apt install -y libssl1.1
install-protoc:
steps:
- run:
name: Install protoc
command: |
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip &&\
sudo unzip -o protoc-21.9-linux-x86_64.zip -d /usr bin/protoc &&\
sudo unzip -o protoc-21.9-linux-x86_64.zip -d /usr/ 'include/*' &&\
rm -f protoc-21.9-linux-x86_64.zip
make-artifact:
parameters:
target:
Expand Down Expand Up @@ -129,7 +138,7 @@ jobs:
steps:
- checkout
- restore-cargo-cache
- run: sudo apt install -y protobuf-compiler
- install-protoc
- run: cargo fmt --all --check
- run: cargo install cargo-sort
- run: cargo sort --check --workspace
Expand All @@ -144,7 +153,7 @@ jobs:
steps:
- checkout
- restore-cargo-cache
- run: sudo apt install -y protobuf-compiler
- install-protoc
- run: |
cargo clippy --tests \
--all-targets \
Expand All @@ -163,7 +172,7 @@ jobs:
steps:
- checkout
- restore-cargo-cache
- run: sudo apt install -y protobuf-compiler
- install-protoc
- apply-patches
- run: cargo fmt --all --check --manifest-path << parameters.path >>/Cargo.toml
- run: cargo install cargo-sort
Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

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

11 changes: 8 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#syntax=docker/dockerfile-upstream:1.4.0-rc1
FROM rust:1.64.0-buster as shuttle-build
FROM rust:1.65.0-buster as shuttle-build
RUN apt-get update &&\
apt-get install -y curl protobuf-compiler
apt-get install -y curl
# download protoc binary and unzip it in usr/bin
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip &&\
unzip -o protoc-21.9-linux-x86_64.zip -d /usr bin/protoc &&\
unzip -o protoc-21.9-linux-x86_64.zip -d /usr/ 'include/*' &&\
rm -f protoc-21.9-linux-x86_64.zip
RUN cargo install cargo-chef
WORKDIR /build

Expand All @@ -21,7 +26,7 @@ COPY --from=cache /build .
ARG folder
RUN cargo build --bin shuttle-${folder}

FROM rust:1.64.0-buster as shuttle-common
FROM rust:1.65.0-buster as shuttle-common
RUN apt-get update &&\
apt-get install -y curl
RUN rustup component add rust-src
Expand Down
4 changes: 2 additions & 2 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mod main;
mod shuttle_main;

use proc_macro::TokenStream;
use proc_macro_error::proc_macro_error;

#[proc_macro_error]
#[proc_macro_attribute]
pub fn main(attr: TokenStream, item: TokenStream) -> TokenStream {
main::r#impl(attr, item)
shuttle_main::r#impl(attr, item)
}
File renamed without changes.
2 changes: 1 addition & 1 deletion deployer/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn make_router(
})
.on_response(
|response: &Response<BoxBody>, latency: Duration, span: &Span| {
span.record("http.status_code", &response.status().as_u16());
span.record("http.status_code", response.status().as_u16());
debug!(
latency = format_args!("{} ns", latency.as_nanos()),
"finished processing request"
Expand Down
14 changes: 7 additions & 7 deletions deployer/src/persistence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl ResourceRecorder for Persistence {

async fn insert_resource(&self, resource: &Resource) -> Result<()> {
sqlx::query("INSERT OR REPLACE INTO resources (service_id, type, data) VALUES (?, ?, ?)")
.bind(&resource.service_id)
.bind(resource.service_id)
.bind(resource.r#type)
.bind(&resource.data)
.execute(&self.pool)
Expand Down Expand Up @@ -966,19 +966,19 @@ mod tests {
)
// This running item should match
.bind(Uuid::new_v4())
.bind(&service_id)
.bind(service_id)
.bind(State::Running)
.bind(Utc::now())
.bind("10.0.0.5:12356")
// A stopped item should not match
.bind(Uuid::new_v4())
.bind(&service_id)
.bind(service_id)
.bind(State::Stopped)
.bind(Utc::now())
.bind("10.0.0.5:9876")
// Another service should not match
.bind(Uuid::new_v4())
.bind(&service_other_id)
.bind(service_other_id)
.bind(State::Running)
.bind(Utc::now())
.bind("10.0.0.5:5678")
Expand Down Expand Up @@ -1054,8 +1054,8 @@ mod tests {
sqlx::query(
"INSERT INTO deployments (id, service_id, state, last_update) VALUES (?, ?, ?, ?)",
)
.bind(&deployment_id)
.bind(&service_id)
.bind(deployment_id)
.bind(service_id)
.bind(State::Running)
.bind(Utc::now())
.execute(pool)
Expand All @@ -1072,7 +1072,7 @@ mod tests {
let service_id = Uuid::new_v4();

sqlx::query("INSERT INTO services (id, name) VALUES (?, ?)")
.bind(&service_id)
.bind(service_id)
.bind(name)
.execute(pool)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion deployer/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub async fn handle(

match reverse_proxy(remote_address.ip(), &proxy_address.to_string(), req).await {
Ok(response) => {
Span::current().record("http.status_code", &response.status().as_u16());
Span::current().record("http.status_code", response.status().as_u16());
Ok(response)
}
Err(error) => {
Expand Down
2 changes: 1 addition & 1 deletion service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ pub type ShuttleAxum = Result<sync_wrapper::SyncWrapper<axum::Router>, Error>;
#[async_trait]
impl Service for salvo::Router {
async fn bind(mut self: Box<Self>, addr: SocketAddr) -> Result<(), error::Error> {
salvo::Server::new(salvo::listener::TcpListener::bind(&addr))
salvo::Server::new(salvo::listener::TcpListener::bind(addr))
.serve(self)
.await;

Expand Down

0 comments on commit ca97f03

Please sign in to comment.