File tree Expand file tree Collapse file tree 8 files changed +39
-9
lines changed
solutions/zig/01-at4/code
starter_templates/zig/code/.codecrafters Expand file tree Collapse file tree 8 files changed +39
-9
lines changed Original file line number Diff line number Diff line change 8
8
9
9
set -e # Exit on failure
10
10
11
- exec $( dirname $0 ) /zig-out/bin/main " $@ "
11
+ exec " $( dirname " $0 " ) " /zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ debug: false
7
7
# Use this to change the Zig version used to run your code
8
8
# on Codecrafters.
9
9
#
10
- # Available versions: zig-0.14
11
- buildpack : zig-0.14
10
+ # Available versions: zig-0.15
11
+ buildpack : zig-0.15
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
21
21
#
22
22
# - Edit this to change how your program runs locally
23
23
# - Edit .codecrafters/run.sh to change how your program runs remotely
24
- exec $( dirname $0 ) /zig-out/bin/main " $@ "
24
+ exec " $( dirname " $0 " ) " /zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1.7-labs
2
+ FROM debian:bookworm
3
+
4
+ RUN apt-get update && \
5
+ apt-get install --no-install-recommends -y xz-utils=5.4.1-1 && \
6
+ apt-get clean && \
7
+ rm -rf /var/lib/apt/lists/*
8
+
9
+ # Download and install Zig
10
+ RUN curl -O https://ziglang.org/download/0.15.1/zig-x86_64-linux-0.15.1.tar.xz \
11
+ && tar -xf zig-x86_64-linux-0.15.1.tar.xz \
12
+ && mv zig-x86_64-linux-0.15.1 /usr/local/zig \
13
+ && rm zig-x86_64-linux-0.15.1.tar.xz
14
+
15
+ # Add Zig to PATH
16
+ ENV PATH="/usr/local/zig:${PATH}"
17
+
18
+ ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="build.zig,build.zig.zon"
19
+
20
+ WORKDIR /app
21
+
22
+ # .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
23
+ COPY --exclude=.git --exclude=README.md . /app
24
+
25
+ # This runs zig build
26
+ RUN .codecrafters/compile.sh
27
+
28
+ # Cache build directory
29
+ RUN mkdir -p /app-cached
30
+ RUN mv /app/.zig-cache /app-cached/.zig-cache || true
Original file line number Diff line number Diff line change 8
8
9
9
set -e # Exit on failure
10
10
11
- exec $( dirname $0 ) /zig-out/bin/main " $@ "
11
+ exec " $( dirname " $0 " ) " /zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ debug: false
7
7
# Use this to change the Zig version used to run your code
8
8
# on Codecrafters.
9
9
#
10
- # Available versions: zig-0.14
11
- buildpack : zig-0.14
10
+ # Available versions: zig-0.15
11
+ buildpack : zig-0.15
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
21
21
#
22
22
# - Edit this to change how your program runs locally
23
23
# - Edit .codecrafters/run.sh to change how your program runs remotely
24
- exec $( dirname $0 ) /zig-out/bin/main " $@ "
24
+ exec " $( dirname " $0 " ) " /zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change 8
8
9
9
set -e # Exit on failure
10
10
11
- exec $( dirname $0 ) /zig-out/bin/main " $@ "
11
+ exec " $( dirname " $0 " ) " /zig-out/bin/main " $@ "
You can’t perform that action at this time.
0 commit comments