File tree 14 files changed +48
-18
lines changed
solutions/zig/01-dr6/code
14 files changed +48
-18
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 zig-out/bin/main " $@ "
11
+ exec $( dirname $0 ) / zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Time to move on to the next stage!
29
29
30
30
Note: This section is for stages 2 and beyond.
31
31
32
- 1 . Ensure you have ` zig (0.13+ ) ` installed locally
32
+ 1 . Ensure you have ` zig (0.14 ) ` installed locally
33
33
1 . Run ` ./your_program.sh ` to run your program, which is implemented in
34
34
` src/main.zig ` .
35
35
1 . Commit your changes and run ` git push origin master ` to submit your solution
Original file line number Diff line number Diff line change 1
1
.{
2
- .name = "codecrafters-sqlite" ,
2
+ .name = .codecrafters_sqlite ,
3
+ .fingerprint = 0x558026c9dcdd8a05 ,
3
4
4
5
// This is a [Semantic Version](https://semver.org/).
5
6
// In a future version of Zig it will be used for package deduplication.
8
9
// This field is optional.
9
10
// This is currently advisory only; Zig does not yet do anything
10
11
// with this value.
11
- // .minimum_zig_version = "0.11 .0",
12
+ .minimum_zig_version = "0.14 .0" ,
12
13
13
14
// This field is optional.
14
15
// Each dependency must either provide a `url` and `hash`, or a `path`.
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.13
11
- language_pack : zig-0.13
10
+ # Available versions: zig-0.14
11
+ language_pack : zig-0.14
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 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 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
Original file line number Diff line number Diff line change 8
8
9
9
set -e # Exit on failure
10
10
11
- exec zig-out/bin/main " $@ "
11
+ exec $( dirname $0 ) / zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Time to move on to the next stage!
29
29
30
30
Note: This section is for stages 2 and beyond.
31
31
32
- 1 . Ensure you have ` zig (0.13+ ) ` installed locally
32
+ 1 . Ensure you have ` zig (0.14 ) ` installed locally
33
33
1 . Run ` ./your_program.sh ` to run your program, which is implemented in
34
34
` src/main.zig ` .
35
35
1 . Commit your changes and run ` git push origin master ` to submit your solution
Original file line number Diff line number Diff line change 1
1
.{
2
- .name = "codecrafters-sqlite" ,
2
+ .name = .codecrafters_sqlite ,
3
+ .fingerprint = 0x558026c9dcdd8a05 ,
3
4
4
5
// This is a [Semantic Version](https://semver.org/).
5
6
// In a future version of Zig it will be used for package deduplication.
8
9
// This field is optional.
9
10
// This is currently advisory only; Zig does not yet do anything
10
11
// with this value.
11
- // .minimum_zig_version = "0.11 .0",
12
+ .minimum_zig_version = "0.14 .0" ,
12
13
13
14
// This field is optional.
14
15
// Each dependency must either provide a `url` and `hash`, or a `path`.
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.13
11
- language_pack : zig-0.13
10
+ # Available versions: zig-0.14
11
+ language_pack : zig-0.14
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 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 zig-out/bin/main " $@ "
11
+ exec $( dirname $0 ) / zig-out/bin/main " $@ "
Original file line number Diff line number Diff line change 1
1
.{
2
- .name = "codecrafters-sqlite" ,
2
+ .name = .codecrafters_sqlite ,
3
+ .fingerprint = 0x558026c9dcdd8a05 ,
3
4
4
5
// This is a [Semantic Version](https://semver.org/).
5
6
// In a future version of Zig it will be used for package deduplication.
8
9
// This field is optional.
9
10
// This is currently advisory only; Zig does not yet do anything
10
11
// with this value.
11
- // .minimum_zig_version = "0.11 .0",
12
+ .minimum_zig_version = "0.14 .0" ,
12
13
13
14
// This field is optional.
14
15
// Each dependency must either provide a `url` and `hash`, or a `path`.
Original file line number Diff line number Diff line change 1
1
attributes :
2
- required_executable : zig (0.13+ )
2
+ required_executable : zig (0.14 )
3
3
user_editable_file : src/main.zig
You can’t perform that action at this time.
0 commit comments