Skip to content

Commit efcf189

Browse files
Manciukicroypat
authored andcommitted
chore(devctr): install cross-compilation toolchain
Add the installation of the toolchain of the other architecture so that builds can be checked for every architecture from a development environment, without going to CI or spinning up and instance. Signed-off-by: Riccardo Mancini <[email protected]>
1 parent dc05d3a commit efcf189

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tools/devctr/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ RUN cd /usr/local/bin \
196196
&& chmod +x codecov \
197197
&& cd -
198198

199+
# Add cross-compile toolchain for devtool checkbuild command
200+
RUN case "${ARCH}" in \
201+
"aarch64") \
202+
apt install -y gcc-x86-64-linux-gnu libc6-dev-amd64-cross linux-libc-dev-amd64-cross && \
203+
rustup target add x86_64-unknown-linux-gnu \
204+
;; \
205+
"x86_64") \
206+
apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross linux-libc-dev-arm64-cross && \
207+
rustup target add aarch64-unknown-linux-gnu \
208+
;; \
209+
*) \
210+
echo "Unsupported arch ${ARCH}" && \
211+
exit 1 \
212+
;; \
213+
esac
214+
199215
ADD tools/devctr/ctr_gitconfig /root/.gitconfig
200216

201217
ENTRYPOINT ["/usr/bin/tini", "--"]

0 commit comments

Comments
 (0)