From eb9d9bed0f5d5f06bc0948110ce8ab89c8c4539d Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 8 Mar 2024 10:59:45 +0100 Subject: [PATCH] Generalize target-stompling-avoidance originally only for docker --- Makefile | 14 +++++++------- docker/Makefile | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e5ec60a..fa13560 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ pull-protocols: static: static-x86_64 static-%: - cross build --target $*-unknown-linux-musl --features vendored-openssl,jemalloc + CARGO_TARGET_DIR=target/target.$* cross build --target $*-unknown-linux-musl --features vendored-openssl,jemalloc ########################################################################### @@ -54,18 +54,18 @@ static-%: x86_64-binary: x86_64-binary-release x86_64-binary-release: - cross build --target x86_64-unknown-linux-musl --release --all-targets --features vendored-openssl,jemalloc + CARGO_TARGET_DIR=target/target.x86_64 cross build --target x86_64-unknown-linux-musl --release --all-targets --features vendored-openssl,jemalloc x86_64-binary-debug: - cross build --target x86_64-unknown-linux-musl --all-targets --features vendored-openssl + CARGO_TARGET_DIR=target/target.x86_64 cross build --target x86_64-unknown-linux-musl --all-targets --features vendored-openssl armv7-binary: armv7-binary-release armv7-binary-release: - cross build --target=armv7-unknown-linux-musleabihf --release --all-targets --features vendored-openssl + CARGO_TARGET_DIR=target/target.armv7 cross build --target=armv7-unknown-linux-musleabihf --release --all-targets --features vendored-openssl armv7-binary-debug: - cross build --target=armv7-unknown-linux-musleabihf --all-targets --features vendored-openssl + CARGO_TARGET_DIR=target/target.armv7 cross build --target=armv7-unknown-linux-musleabihf --all-targets --features vendored-openssl # As of 2023-05-12 (and probably earlier!) this is no longer required with current Rust nightlies # # Hack to workaround https://github.com/rust-embedded/cross/issues/598 @@ -74,7 +74,7 @@ armv7-binary-debug: aarch64-binary: aarch64-binary-release aarch64-binary-release: - cross build --target=aarch64-unknown-linux-musl --release --all-targets --features vendored-openssl,jemalloc + CARGO_TARGET_DIR=target/target.aarch64 cross build --target=aarch64-unknown-linux-musl --release --all-targets --features vendored-openssl,jemalloc aarch64-binary-debug: - cross build --target=aarch64-unknown-linux-musl --all-targets --features vendored-openssl + CARGO_TARGET_DIR=target/target.aarch64 cross build --target=aarch64-unknown-linux-musl --all-targets --features vendored-openssl diff --git a/docker/Makefile b/docker/Makefile index 4bd0668..7607a13 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -10,7 +10,6 @@ all: clean: rm -f syndicate-server.* - rm -rf $(patsubst %,target.%,$(ARCHITECTURES)) -podman images -q $(U)/$(I) | sort -u | xargs podman rmi -f image: $(SERVERS) @@ -34,5 +33,5 @@ push-only: podman manifest push $(U)/$(I):latest syndicate-server.%: - make -C .. CARGO_TARGET_DIR=docker/target.$* $$(./alpine-architecture $*)-binary-release - cp -a target.$*/$$(./alpine-architecture $*)-unknown-linux-musl*/release/syndicate-server $@ + make -C .. $$(./alpine-architecture $*)-binary-release + cp -a ../target/target.$$(./alpine-architecture $*)/$$(./alpine-architecture $*)-unknown-linux-musl*/release/syndicate-server $@