Skip to content

Commit

Permalink
fix(interop-tests): don't hardcode x86_64 for native
Browse files Browse the repository at this point in the history
Remove hard-coded `x86_64` for the native interop tests. The tests couldn't run on arm64 architecture.

Pull-Request: libp2p#4862.
  • Loading branch information
diegomrsantos authored Nov 16, 2023
1 parent 41da782 commit caf9da4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions interop-tests/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# syntax=docker/dockerfile:1.5-labs
FROM rust:1.73.0 as chef
RUN wget -q -O- https://github.com/LukeMathWalker/cargo-chef/releases/download/v0.1.62/cargo-chef-x86_64-unknown-linux-gnu.tar.gz | tar -zx -C /usr/local/bin
FROM lukemathwalker/cargo-chef:0.1.62-rust-1.73.0 as chef
WORKDIR /app

FROM chef AS planner
Expand All @@ -10,12 +9,13 @@ RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN RUSTFLAGS='-C target-feature=+crt-static' cargo chef cook --release --package interop-tests --target x86_64-unknown-linux-gnu --bin native_ping --recipe-path recipe.json
RUN RUSTFLAGS='-C target-feature=+crt-static' cargo chef cook --release --package interop-tests --target $(rustc -vV | grep host | awk '{print $2}') --bin native_ping --recipe-path recipe.json
# Build application
COPY . .
RUN RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --package interop-tests --target x86_64-unknown-linux-gnu --bin native_ping
RUN RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --package interop-tests --target $(rustc -vV | grep host | awk '{print $2}') --bin native_ping
RUN cp /app/target/$(rustc -vV | grep host | awk '{print $2}')/release/native_ping /usr/local/bin/testplan

FROM scratch
COPY --from=builder /app/target/x86_64-unknown-linux-gnu/release/native_ping /usr/local/bin/testplan
COPY --from=builder /usr/local/bin/testplan /usr/local/bin/testplan
ENV RUST_BACKTRACE=1
ENTRYPOINT ["testplan"]

0 comments on commit caf9da4

Please sign in to comment.