From 0b42bb54ff0c68f96344c48f2c49c564cde96788 Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Tue, 11 Mar 2025 21:14:22 +0800 Subject: [PATCH] feat(gleam): upgrade Gleam to version 1.9.1 Update Gleam starter files to use Gleam 1.9.1, including: - Updating codecrafters.yml to use gleam-1.9 - Modifying README to specify gleam (1.9.1) - Adding Dockerfile for Gleam 1.9 - Updating starter template configuration --- compiled_starters/gleam/README.md | 2 +- compiled_starters/gleam/codecrafters.yml | 4 ++-- dockerfiles/gleam-1.9.Dockerfile | 17 +++++++++++++++++ solutions/gleam/01-vi6/code/README.md | 2 +- solutions/gleam/01-vi6/code/codecrafters.yml | 4 ++-- starter_templates/gleam/config.yml | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 dockerfiles/gleam-1.9.Dockerfile diff --git a/compiled_starters/gleam/README.md b/compiled_starters/gleam/README.md index 6db1fb4..c0973d6 100644 --- a/compiled_starters/gleam/README.md +++ b/compiled_starters/gleam/README.md @@ -27,7 +27,7 @@ That's all! Note: This section is for stages 2 and beyond. -1. Ensure you have `gleam (1.0+)` installed locally +1. Ensure you have `gleam (1.9.1)` installed locally 1. Run `./your_program.sh` to run your Kafka broker, which is implemented in `src/main.gleam`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/compiled_starters/gleam/codecrafters.yml b/compiled_starters/gleam/codecrafters.yml index 6589fc2..54d51c3 100644 --- a/compiled_starters/gleam/codecrafters.yml +++ b/compiled_starters/gleam/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Gleam version used to run your code # on Codecrafters. # -# Available versions: gleam-1.4 -language_pack: gleam-1.4 +# Available versions: gleam-1.9 +language_pack: gleam-1.9 diff --git a/dockerfiles/gleam-1.9.Dockerfile b/dockerfiles/gleam-1.9.Dockerfile new file mode 100644 index 0000000..0a1dbac --- /dev/null +++ b/dockerfiles/gleam-1.9.Dockerfile @@ -0,0 +1,17 @@ +# syntax=docker/dockerfile:1.7-labs +FROM ghcr.io/gleam-lang/gleam:v1.9.1-erlang-alpine + +# Rebuild if gleam.toml or manifest.toml change +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="gleam.toml,manifest.toml" + +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 + +# Force deps to be downloaded +RUN gleam build + +# Cache build directory +RUN mkdir -p /app-cached +RUN mv build /app-cached/build diff --git a/solutions/gleam/01-vi6/code/README.md b/solutions/gleam/01-vi6/code/README.md index 6db1fb4..c0973d6 100644 --- a/solutions/gleam/01-vi6/code/README.md +++ b/solutions/gleam/01-vi6/code/README.md @@ -27,7 +27,7 @@ That's all! Note: This section is for stages 2 and beyond. -1. Ensure you have `gleam (1.0+)` installed locally +1. Ensure you have `gleam (1.9.1)` installed locally 1. Run `./your_program.sh` to run your Kafka broker, which is implemented in `src/main.gleam`. 1. Commit your changes and run `git push origin master` to submit your solution diff --git a/solutions/gleam/01-vi6/code/codecrafters.yml b/solutions/gleam/01-vi6/code/codecrafters.yml index 6589fc2..54d51c3 100644 --- a/solutions/gleam/01-vi6/code/codecrafters.yml +++ b/solutions/gleam/01-vi6/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Gleam version used to run your code # on Codecrafters. # -# Available versions: gleam-1.4 -language_pack: gleam-1.4 +# Available versions: gleam-1.9 +language_pack: gleam-1.9 diff --git a/starter_templates/gleam/config.yml b/starter_templates/gleam/config.yml index 329d8d6..d08e9ee 100644 --- a/starter_templates/gleam/config.yml +++ b/starter_templates/gleam/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: gleam (1.0+) + required_executable: gleam (1.9.1) user_editable_file: src/main.gleam