@@ -5,7 +5,7 @@ VERSION --use-cache-command 0.6
5
5
# - DevkitPro + its wii-dev package
6
6
# - Grrlib
7
7
build-env :
8
- FROM --platform=linux/amd64 ghcr.io/rust-lang/rust:nightly-slim
8
+ FROM ghcr.io/rust-lang/rust:nightly-slim
9
9
WORKDIR /
10
10
COPY ./docker/builder/install-devkitpro-pacman.sh /install-devkitpro-pacman.sh
11
11
RUN chmod +x ./install-devkitpro-pacman.sh
@@ -45,17 +45,21 @@ build-env:
45
45
rustup component add rust-src --toolchain nightly
46
46
SAVE IMAGE --cache-from = ghcr.io/qqwy/wii-rust-build-env:latest wii-rust-build-env:latest
47
47
48
+ build-env-all-platforms :
49
+ BUILD --platform = linux/arm64 --platform = linux/amd64 +build
50
+
48
51
# Build the main game Wii ROM
49
52
build :
50
53
# FROM +build-env
51
- FROM --platform=linux/amd64 ghcr.io/qqwy/wii-rust-build-env
54
+ FROM ghcr.io/qqwy/wii-rust-build-env
52
55
COPY ./app/ /app/
53
56
WORKDIR /app/
54
57
RUN --mount = type= cache,target= /usr/local/cargo/registry/index \
55
58
--mount = type= cache,target= /usr/local/cargo/registry/cache \
56
59
--mount = type= cache,target= /usr/local/cargo/git/db \
57
60
cargo +nightly build -Z build-std= core,alloc --target powerpc-unknown-eabi.json
58
61
SAVE ARTIFACT /build/target/powerpc-unknown-eabi/debug/rust-wii.elf AS LOCAL ./bin/boot.elf
62
+ SAVE ARTIFACT ./Cargo.lock AS LOCAL ./app/Cargo.lock
59
63
60
64
# Build a Wii ROM that runs the on-target-device integration test suite.
61
65
build-integration-test :
@@ -72,16 +76,18 @@ build-integration-test:
72
76
# Run unit tests of the `app/lib` subcrate using the normal Rust test flow.
73
77
unit-test :
74
78
FROM --platform=linux/amd64 ghcr.io/rust-lang/rust:nightly-slim
75
- RUN --mount = type= cache,target= /usr/local/cargo/registry/index \
76
- --mount = type= cache,target= /usr/local/cargo/registry/cache \
77
- --mount = type= cache,target= /usr/local/cargo/git/db \
78
- rustup +nightly component add rust-src
79
+ RUN apt update && apt install -y git
80
+ # RUN --mount=type=cache,target=/usr/local/cargo/registry/index \
81
+ # --mount=type=cache,target=/usr/local/cargo/registry/cache \
82
+ # --mount=type=cache,target=/usr/local/cargo/git/db \
83
+ RUN rustup +nightly component add rust-src
79
84
COPY ./app/lib/ /app/lib/
80
85
WORKDIR /app/lib/
81
- RUN --mount = type= cache,target= /usr/local/cargo/registry/index \
82
- --mount = type= cache,target= /usr/local/cargo/registry/cache \
83
- --mount = type= cache,target= /usr/local/cargo/git/db \
84
- cargo +nightly test --color = always
86
+ # RUN --mount=type=cache,target=/usr/local/cargo/registry/index \
87
+ # --mount=type=cache,target=/usr/local/cargo/registry/cache \
88
+ # --mount=type=cache,target=/usr/local/cargo/git/db \
89
+ RUN cargo +nightly test --color = always
90
+ SAVE ARTIFACT ./Cargo.lock AS LOCAL ./app/lib/Cargo.lock
85
91
86
92
# BASE IMAGE CONTAINING DOLPHIN
87
93
# -----------------------------
@@ -126,8 +132,8 @@ integration-test-runner:
126
132
127
133
# Copy ROM into image:
128
134
RUN mkdir /build
129
- COPY +build-integration-test/rust-wii.elf /build/boot.elf
130
- # COPY ./bin/boot-test.elf /build/boot.elf
135
+ # COPY +build-integration-test/rust-wii.elf /build/boot.elf
136
+ COPY ./bin/boot-test.elf /build/boot.elf
131
137
132
138
# Run rest of the commands as unprivileged user:
133
139
RUN adduser --disabled-password --gecos '' user
@@ -174,3 +180,12 @@ test:
174
180
BUILD +unit-test # Unit test suite
175
181
BUILD +integration-test
176
182
# TODO Clippy?
183
+
184
+
185
+ watch :
186
+ LOCALLY
187
+ RUN fswatch --one-per-batch --recursive ./app/src ./app/data ./app/Cargo.toml ./app/build.rs ./app/wrapper.h ./app/powerpc-unknown-eabi.json | \
188
+ while read dir action file; do \
189
+ echo -e "\e [1;34m The file '$file' appeared in directory '$dir' via '$action', rebuilding and retesting... \e [0m" ; \
190
+ FORCE_COLOR= 1 earthly --use-inline-cache +build ; \
191
+ done
0 commit comments