Skip to content

Commit

Permalink
fix: include target config for cargo's faulty linker
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Jul 1, 2024
1 parent e2dafb7 commit faa16bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is needed to enable cross-platform docker builds, as cargo doesn't use the correct linker sometimes:
# https://github.com/rust-lang/cargo/issues/4133
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
5 changes: 0 additions & 5 deletions docker/fuel-core-nats.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ FROM --platform=$BUILDPLATFORM rust:1.75.0 AS chef
ARG TARGETPLATFORM
RUN cargo install cargo-chef && rustup target add wasm32-unknown-unknown

# Add the target platform dynamically
RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then rustup target add aarch64-unknown-linux-gnu; fi

WORKDIR /build/

COPY --from=xx / /
Expand All @@ -23,13 +20,11 @@ RUN apt-get update && \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


FROM chef as planner
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
COPY . .
RUN cargo chef prepare --recipe-path recipe.json


FROM chef as builder
ARG DEBUG_SYMBOLS=false
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
Expand Down

0 comments on commit faa16bc

Please sign in to comment.