From 6a0c38dc9e67c51c4eb9126faa95a81fba939d53 Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Thu, 15 May 2025 15:24:37 +0800 Subject: [PATCH 1/3] Upgrade Rust and TypeScript versions to 1.86 and 1.2 respectively in configuration and documentation files across starter templates and solutions. --- compiled_starters/rust/README.md | 2 +- compiled_starters/rust/codecrafters.yml | 4 ++-- compiled_starters/typescript/README.md | 2 +- compiled_starters/typescript/codecrafters.yml | 4 ++-- dockerfiles/bun-1.2.Dockerfile | 18 ++++++++++++++++++ dockerfiles/rust-1.86.Dockerfile | 13 +++++++++++++ dockerfiles/rust-1.87.Dockerfile | 13 +++++++++++++ solutions/rust/01-dr6/code/README.md | 2 +- solutions/rust/01-dr6/code/codecrafters.yml | 4 ++-- solutions/typescript/01-dr6/code/README.md | 2 +- .../typescript/01-dr6/code/codecrafters.yml | 4 ++-- starter_templates/rust/config.yml | 2 +- starter_templates/typescript/config.yml | 2 +- 13 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 dockerfiles/bun-1.2.Dockerfile create mode 100644 dockerfiles/rust-1.86.Dockerfile create mode 100644 dockerfiles/rust-1.87.Dockerfile diff --git a/compiled_starters/rust/README.md b/compiled_starters/rust/README.md index 6793fa7..6be296f 100644 --- a/compiled_starters/rust/README.md +++ b/compiled_starters/rust/README.md @@ -29,7 +29,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `cargo (1.85)` installed locally +1. Ensure you have `cargo (1.87)` installed locally 1. Run `./your_program.sh` to run your program, 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 1085350..1fb9cb5 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.85 -language_pack: rust-1.85 +# Available versions: rust-1.87 +language_pack: rust-1.87 diff --git a/compiled_starters/typescript/README.md b/compiled_starters/typescript/README.md index ae7771d..accd1ae 100644 --- a/compiled_starters/typescript/README.md +++ b/compiled_starters/typescript/README.md @@ -29,7 +29,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `bun (1.1)` installed locally +1. Ensure you have `bun (1.2)` installed locally 1. Run `./your_program.sh` to run your program, which is implemented in `app/main.ts`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/compiled_starters/typescript/codecrafters.yml b/compiled_starters/typescript/codecrafters.yml index a263216..5baecf0 100644 --- a/compiled_starters/typescript/codecrafters.yml +++ b/compiled_starters/typescript/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the TypeScript version used to run your code # on Codecrafters. # -# Available versions: bun-1.1 -language_pack: bun-1.1 +# Available versions: bun-1.2 +language_pack: bun-1.2 diff --git a/dockerfiles/bun-1.2.Dockerfile b/dockerfiles/bun-1.2.Dockerfile new file mode 100644 index 0000000..9666e78 --- /dev/null +++ b/dockerfiles/bun-1.2.Dockerfile @@ -0,0 +1,18 @@ +# syntax=docker/dockerfile:1.7-labs +FROM oven/bun:1.2-alpine + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="package.json,bun.lockb" + +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 + +# For reproducible builds. +# This will install the exact versions of each package specified in the lockfile. +# If package.json disagrees with bun.lockb, Bun will exit with an error. The lockfile will not be updated. +RUN bun install --frozen-lockfile + +# If the node_modules directory exists, move it to /app-cached +RUN mkdir -p /app-cached +RUN if [ -d "/app/node_modules" ]; then mv /app/node_modules /app-cached; fi diff --git a/dockerfiles/rust-1.86.Dockerfile b/dockerfiles/rust-1.86.Dockerfile new file mode 100644 index 0000000..a330b5b --- /dev/null +++ b/dockerfiles/rust-1.86.Dockerfile @@ -0,0 +1,13 @@ +# syntax=docker/dockerfile:1.7-labs +FROM rust:1.86-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 diff --git a/dockerfiles/rust-1.87.Dockerfile b/dockerfiles/rust-1.87.Dockerfile new file mode 100644 index 0000000..a9d297c --- /dev/null +++ b/dockerfiles/rust-1.87.Dockerfile @@ -0,0 +1,13 @@ +# syntax=docker/dockerfile:1.7-labs +FROM rust:1.87-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 diff --git a/solutions/rust/01-dr6/code/README.md b/solutions/rust/01-dr6/code/README.md index 6793fa7..6be296f 100644 --- a/solutions/rust/01-dr6/code/README.md +++ b/solutions/rust/01-dr6/code/README.md @@ -29,7 +29,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `cargo (1.85)` installed locally +1. Ensure you have `cargo (1.87)` installed locally 1. Run `./your_program.sh` to run your program, 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-dr6/code/codecrafters.yml b/solutions/rust/01-dr6/code/codecrafters.yml index 1085350..1fb9cb5 100644 --- a/solutions/rust/01-dr6/code/codecrafters.yml +++ b/solutions/rust/01-dr6/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.85 -language_pack: rust-1.85 +# Available versions: rust-1.87 +language_pack: rust-1.87 diff --git a/solutions/typescript/01-dr6/code/README.md b/solutions/typescript/01-dr6/code/README.md index ae7771d..accd1ae 100644 --- a/solutions/typescript/01-dr6/code/README.md +++ b/solutions/typescript/01-dr6/code/README.md @@ -29,7 +29,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `bun (1.1)` installed locally +1. Ensure you have `bun (1.2)` installed locally 1. Run `./your_program.sh` to run your program, which is implemented in `app/main.ts`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/solutions/typescript/01-dr6/code/codecrafters.yml b/solutions/typescript/01-dr6/code/codecrafters.yml index a263216..5baecf0 100644 --- a/solutions/typescript/01-dr6/code/codecrafters.yml +++ b/solutions/typescript/01-dr6/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the TypeScript version used to run your code # on Codecrafters. # -# Available versions: bun-1.1 -language_pack: bun-1.1 +# Available versions: bun-1.2 +language_pack: bun-1.2 diff --git a/starter_templates/rust/config.yml b/starter_templates/rust/config.yml index d0f03e8..851e006 100644 --- a/starter_templates/rust/config.yml +++ b/starter_templates/rust/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: cargo (1.85) + required_executable: cargo (1.87) user_editable_file: src/main.rs diff --git a/starter_templates/typescript/config.yml b/starter_templates/typescript/config.yml index 9abb315..187d430 100644 --- a/starter_templates/typescript/config.yml +++ b/starter_templates/typescript/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: bun (1.1) + required_executable: bun (1.2) user_editable_file: app/main.ts From 91f81e6aabcc97e771b06431a9a6b8e88232e730 Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Thu, 15 May 2025 15:33:35 +0800 Subject: [PATCH 2/3] Update Rust version to 1.86 in documentation and configuration files across starter templates and solutions, and remove obsolete Dockerfile for Rust 1.87. --- compiled_starters/rust/README.md | 2 +- dockerfiles/rust-1.87.Dockerfile | 13 ------------- solutions/rust/01-dr6/code/README.md | 2 +- starter_templates/rust/config.yml | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 dockerfiles/rust-1.87.Dockerfile diff --git a/compiled_starters/rust/README.md b/compiled_starters/rust/README.md index 6be296f..97be3f8 100644 --- a/compiled_starters/rust/README.md +++ b/compiled_starters/rust/README.md @@ -29,7 +29,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `cargo (1.87)` installed locally +1. Ensure you have `cargo (1.86)` installed locally 1. Run `./your_program.sh` to run your program, 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/dockerfiles/rust-1.87.Dockerfile b/dockerfiles/rust-1.87.Dockerfile deleted file mode 100644 index a9d297c..0000000 --- a/dockerfiles/rust-1.87.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -# syntax=docker/dockerfile:1.7-labs -FROM rust:1.87-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 diff --git a/solutions/rust/01-dr6/code/README.md b/solutions/rust/01-dr6/code/README.md index 6be296f..97be3f8 100644 --- a/solutions/rust/01-dr6/code/README.md +++ b/solutions/rust/01-dr6/code/README.md @@ -29,7 +29,7 @@ Time to move on to the next stage! Note: This section is for stages 2 and beyond. -1. Ensure you have `cargo (1.87)` installed locally +1. Ensure you have `cargo (1.86)` installed locally 1. Run `./your_program.sh` to run your program, 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/starter_templates/rust/config.yml b/starter_templates/rust/config.yml index 851e006..db0c8a3 100644 --- a/starter_templates/rust/config.yml +++ b/starter_templates/rust/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: cargo (1.87) + required_executable: cargo (1.86) user_editable_file: src/main.rs From 233e4caef5d0d104048c17478a7027113feebfab Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Thu, 15 May 2025 15:35:03 +0800 Subject: [PATCH 3/3] Update Rust version to 1.86 in codecrafters.yml files for starter templates and solutions. --- compiled_starters/rust/codecrafters.yml | 4 ++-- solutions/rust/01-dr6/code/codecrafters.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiled_starters/rust/codecrafters.yml b/compiled_starters/rust/codecrafters.yml index 1fb9cb5..91fd79f 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.87 -language_pack: rust-1.87 +# Available versions: rust-1.86 +language_pack: rust-1.86 diff --git a/solutions/rust/01-dr6/code/codecrafters.yml b/solutions/rust/01-dr6/code/codecrafters.yml index 1fb9cb5..91fd79f 100644 --- a/solutions/rust/01-dr6/code/codecrafters.yml +++ b/solutions/rust/01-dr6/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.87 -language_pack: rust-1.87 +# Available versions: rust-1.86 +language_pack: rust-1.86