Skip to content

Commit 5ac5b24

Browse files
committedMar 19, 2025·
chore: Update Zig starter templates and solutions to use codecrafters_redis package name and upgrade required Zig version to 0.14
1 parent 3a55a81 commit 5ac5b24

File tree

9 files changed

+43
-13
lines changed

9 files changed

+43
-13
lines changed
 

‎compiled_starters/zig/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ That's all!
2626

2727
Note: This section is for stages 2 and beyond.
2828

29-
1. Ensure you have `zig (0.13+)` installed locally
29+
1. Ensure you have `zig (0.14)` installed locally
3030
1. Run `./your_program.sh` to run your Redis server, which is implemented in
3131
`src/main.zig`.
3232
1. Commit your changes and run `git push origin master` to submit your solution

‎compiled_starters/zig/build.zig.zon

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "codecrafters-redis",
2+
.name = .codecrafters_redis,
3+
.fingerprint = 0xf806bb97907ce4a5,
34

45
// This is a [Semantic Version](https://semver.org/).
56
// In a future version of Zig it will be used for package deduplication.
@@ -8,7 +9,7 @@
89
// This field is optional.
910
// This is currently advisory only; Zig does not yet do anything
1011
// with this value.
11-
//.minimum_zig_version = "0.11.0",
12+
.minimum_zig_version = "0.14.0",
1213

1314
// This field is optional.
1415
// Each dependency must either provide a `url` and `hash`, or a `path`.

‎compiled_starters/zig/codecrafters.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Zig version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: zig-0.13
11-
language_pack: zig-0.13
10+
# Available versions: zig-0.14
11+
language_pack: zig-0.14

‎dockerfiles/zig-0.14.Dockerfile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM alpine:3.20
3+
4+
RUN apk add --no-cache 'xz>=5.6' 'curl>=8.9'
5+
6+
# Download and install Zig
7+
RUN curl -O https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz \
8+
&& tar -xf zig-linux-x86_64-0.14.0.tar.xz \
9+
&& mv zig-linux-x86_64-0.14.0 /usr/local/zig \
10+
&& rm zig-linux-x86_64-0.14.0.tar.xz
11+
12+
# Add Zig to PATH
13+
ENV PATH="/usr/local/zig:${PATH}"
14+
15+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="build.zig,build.zig.zon"
16+
17+
WORKDIR /app
18+
19+
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
20+
COPY --exclude=.git --exclude=README.md . /app
21+
22+
# This runs zig build
23+
RUN .codecrafters/compile.sh
24+
25+
# Cache build directory
26+
RUN mkdir -p /app-cached
27+
RUN mv /app/.zig-cache /app-cached/.zig-cache || true

‎solutions/zig/01-jm1/code/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ That's all!
2626

2727
Note: This section is for stages 2 and beyond.
2828

29-
1. Ensure you have `zig (0.13+)` installed locally
29+
1. Ensure you have `zig (0.14)` installed locally
3030
1. Run `./your_program.sh` to run your Redis server, which is implemented in
3131
`src/main.zig`.
3232
1. Commit your changes and run `git push origin master` to submit your solution

‎solutions/zig/01-jm1/code/build.zig.zon

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "codecrafters-redis",
2+
.name = .codecrafters_redis,
3+
.fingerprint = 0xf806bb97907ce4a5,
34

45
// This is a [Semantic Version](https://semver.org/).
56
// In a future version of Zig it will be used for package deduplication.
@@ -8,7 +9,7 @@
89
// This field is optional.
910
// This is currently advisory only; Zig does not yet do anything
1011
// with this value.
11-
//.minimum_zig_version = "0.11.0",
12+
.minimum_zig_version = "0.14.0",
1213

1314
// This field is optional.
1415
// Each dependency must either provide a `url` and `hash`, or a `path`.

‎solutions/zig/01-jm1/code/codecrafters.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Zig version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: zig-0.13
11-
language_pack: zig-0.13
10+
# Available versions: zig-0.14
11+
language_pack: zig-0.14

‎starter_templates/zig/code/build.zig.zon

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "codecrafters-redis",
2+
.name = .codecrafters_redis,
3+
.fingerprint = 0xf806bb97907ce4a5,
34

45
// This is a [Semantic Version](https://semver.org/).
56
// In a future version of Zig it will be used for package deduplication.
@@ -8,7 +9,7 @@
89
// This field is optional.
910
// This is currently advisory only; Zig does not yet do anything
1011
// with this value.
11-
//.minimum_zig_version = "0.11.0",
12+
.minimum_zig_version = "0.14.0",
1213

1314
// This field is optional.
1415
// Each dependency must either provide a `url` and `hash`, or a `path`.

‎starter_templates/zig/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
attributes:
2-
required_executable: zig (0.13+)
2+
required_executable: zig (0.14)
33
user_editable_file: src/main.zig

0 commit comments

Comments
 (0)
Please sign in to comment.