claude/heroku-clone-mvp-plan-NREhc #1
1 changed files with 10 additions and 3 deletions
|
|
@ -8,8 +8,10 @@ ARG TARGETPLATFORM
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
# Install cross-compilation toolchains only when actually cross-compiling.
|
# Install build tools. gcc is always needed: cc-rs (used by ring/aes-gcm deps)
|
||||||
RUN apt-get update && apt-get install -y pkg-config && \
|
# calls the native compiler even on native builds, and rust:slim doesn't
|
||||||
|
# include it. Cross-compilers are added only when actually cross-compiling.
|
||||||
|
RUN apt-get update && apt-get install -y gcc pkg-config && \
|
||||||
if [ "${BUILDPLATFORM}" != "${TARGETPLATFORM}" ]; then \
|
if [ "${BUILDPLATFORM}" != "${TARGETPLATFORM}" ]; then \
|
||||||
case "${TARGETARCH}:${TARGETVARIANT}" in \
|
case "${TARGETARCH}:${TARGETVARIANT}" in \
|
||||||
"arm64:") apt-get install -y gcc-aarch64-linux-gnu ;; \
|
"arm64:") apt-get install -y gcc-aarch64-linux-gnu ;; \
|
||||||
|
|
@ -29,8 +31,13 @@ RUN case "${TARGETARCH}:${TARGETVARIANT}" in \
|
||||||
esac > /rust_target && \
|
esac > /rust_target && \
|
||||||
rustup target add "$(cat /rust_target)"
|
rustup target add "$(cat /rust_target)"
|
||||||
|
|
||||||
# Tell Cargo which cross-linker to use (ignored on native builds).
|
# Tell Cargo which linker to use for each target.
|
||||||
|
# x86_64 native: use plain gcc (cc-rs would otherwise look for
|
||||||
|
# "x86_64-linux-gnu-gcc" which is the *cross* toolchain, not installed here).
|
||||||
RUN mkdir -p /root/.cargo && printf '\
|
RUN mkdir -p /root/.cargo && printf '\
|
||||||
|
[target.x86_64-unknown-linux-gnu]\n\
|
||||||
|
linker = "gcc"\n\
|
||||||
|
\n\
|
||||||
[target.aarch64-unknown-linux-gnu]\n\
|
[target.aarch64-unknown-linux-gnu]\n\
|
||||||
linker = "aarch64-linux-gnu-gcc"\n\
|
linker = "aarch64-linux-gnu-gcc"\n\
|
||||||
\n\
|
\n\
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue