Skip to content
Snippets Groups Projects
Commit 6597cdae authored by Cédric Moreau's avatar Cédric Moreau
Browse files

buildplatform

parent 506f77d6
No related branches found
No related tags found
No related merge requests found
Pipeline #33355 failed
...@@ -7,8 +7,7 @@ FROM debian:bullseye-slim as target ...@@ -7,8 +7,7 @@ FROM debian:bullseye-slim as target
# When building for a foreign arch, use cross-compilation # When building for a foreign arch, use cross-compilation
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ # https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
FROM --platform=$BUILDPLATFORM rust:1-bullseye as build FROM rust:1-bullseye as build
ARG BUILDPLATFORM
ARG TARGETPLATFORM ARG TARGETPLATFORM
# We need the target arch triplet in both Debian and rust flavor # We need the target arch triplet in both Debian and rust flavor
...@@ -33,15 +32,15 @@ RUN if [ "$debug" = 0 ]; then \ ...@@ -33,15 +32,15 @@ RUN if [ "$debug" = 0 ]; then \
echo "TARGET_FOLDER=debug" >>/root/dynenv; \ echo "TARGET_FOLDER=debug" >>/root/dynenv; \
fi fi
# Configure cross-build environment if need be ## Configure cross-build environment if need be
RUN set -x && \ #RUN set -x && \
if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ # if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \
. /root/dynenv && \ # . /root/dynenv && \
apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \ # apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \
rustup target add "$RUST_ARCH_TRIPLET" && \ # rustup target add "$RUST_ARCH_TRIPLET" && \
: https://github.com/rust-lang/cargo/issues/4133 && \ # : https://github.com/rust-lang/cargo/issues/4133 && \
echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \ # echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \
fi # fi
# Build # Build
RUN set -x && \ RUN set -x && \
...@@ -49,20 +48,20 @@ RUN set -x && \ ...@@ -49,20 +48,20 @@ RUN set -x && \
. /root/dynenv && \ . /root/dynenv && \
cargo xtask release-runtime 600 cargo xtask release-runtime 600
# Run tests if requested, expted when cross-building ## Run tests if requested, expted when cross-building
ARG cucumber=0 #ARG cucumber=0
RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \ #RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \
cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \ # cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \
cargo cucumber -i account_creation* && \ # cargo cucumber -i account_creation* && \
cargo cucumber -i certification* && \ # cargo cucumber -i certification* && \
cargo cucumber -i identity_creation* && \ # cargo cucumber -i identity_creation* && \
cargo cucumber -i monetary_mass* && \ # cargo cucumber -i monetary_mass* && \
cargo cucumber -i oneshot_account* && \ # cargo cucumber -i oneshot_account* && \
cargo cucumber -i transfer_all* && \ # cargo cucumber -i transfer_all* && \
cd target/debug/deps/ && \ # cd target/debug/deps/ && \
rm cucumber_tests-*.d && \ # rm cucumber_tests-*.d && \
mv cucumber_tests* ../../../build/duniter-cucumber; \ # mv cucumber_tests* ../../../build/duniter-cucumber; \
fi # fi
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Final Stage # Final Stage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment