From e273e5df93dde15a5ed563d3427edd7012b8ef4c Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Fri, 1 Nov 2024 20:21:25 +0800 Subject: [PATCH] Upgrade rust to 1.82 --- compiled_starters/rust/README.md | 2 +- compiled_starters/rust/codecrafters.yml | 4 ++-- dockerfiles/rust-1.82.Dockerfile | 13 +++++++++++++ solutions/rust/01-jm1/code/README.md | 2 +- solutions/rust/01-jm1/code/codecrafters.yml | 4 ++-- starter_templates/rust/config.yml | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 dockerfiles/rust-1.82.Dockerfile diff --git a/compiled_starters/rust/README.md b/compiled_starters/rust/README.md index f617d8e5..b1857224 100644 --- a/compiled_starters/rust/README.md +++ b/compiled_starters/rust/README.md @@ -26,7 +26,7 @@ That's all! Note: This section is for stages 2 and beyond. -1. Ensure you have `cargo (1.54)` installed locally +1. Ensure you have `cargo (1.82)` installed locally 1. Run `./your_program.sh` to run your Redis server, which is implemented in `src/main.rs`. This command compiles your Rust project, so it might be slow the first time you run it. Subsequent runs will be fast. diff --git a/compiled_starters/rust/codecrafters.yml b/compiled_starters/rust/codecrafters.yml index 92afff5d..fe3fb234 100644 --- a/compiled_starters/rust/codecrafters.yml +++ b/compiled_starters/rust/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Rust version used to run your code # on Codecrafters. # -# Available versions: rust-1.77 -language_pack: rust-1.77 +# Available versions: rust-1.82 +language_pack: rust-1.82 diff --git a/dockerfiles/rust-1.82.Dockerfile b/dockerfiles/rust-1.82.Dockerfile new file mode 100644 index 00000000..8a87643c --- /dev/null +++ b/dockerfiles/rust-1.82.Dockerfile @@ -0,0 +1,13 @@ +# syntax=docker/dockerfile:1.7-labs +FROM rust:1.82-bookworm + +# Rebuild the container if these files change +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock" + +WORKDIR /app + +# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses +COPY --exclude=.git --exclude=README.md . /app + +# This runs cargo build +RUN .codecrafters/compile.sh \ No newline at end of file diff --git a/solutions/rust/01-jm1/code/README.md b/solutions/rust/01-jm1/code/README.md index f617d8e5..b1857224 100644 --- a/solutions/rust/01-jm1/code/README.md +++ b/solutions/rust/01-jm1/code/README.md @@ -26,7 +26,7 @@ That's all! Note: This section is for stages 2 and beyond. -1. Ensure you have `cargo (1.54)` installed locally +1. Ensure you have `cargo (1.82)` installed locally 1. Run `./your_program.sh` to run your Redis server, which is implemented in `src/main.rs`. This command compiles your Rust project, so it might be slow the first time you run it. Subsequent runs will be fast. diff --git a/solutions/rust/01-jm1/code/codecrafters.yml b/solutions/rust/01-jm1/code/codecrafters.yml index 92afff5d..fe3fb234 100644 --- a/solutions/rust/01-jm1/code/codecrafters.yml +++ b/solutions/rust/01-jm1/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Rust version used to run your code # on Codecrafters. # -# Available versions: rust-1.77 -language_pack: rust-1.77 +# Available versions: rust-1.82 +language_pack: rust-1.82 diff --git a/starter_templates/rust/config.yml b/starter_templates/rust/config.yml index 182ea7a6..39ee560f 100644 --- a/starter_templates/rust/config.yml +++ b/starter_templates/rust/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: cargo (1.54) + required_executable: cargo (1.82) user_editable_file: src/main.rs