Skip to content

Commit 8722778

Browse files
authored
fix(release): build docker images with cargo instead cross (foundry-rs#11659)
fix(release): build docker x86_64 using host cross
1 parent 4ffa330 commit 8722778

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
- uses: Swatinem/rust-cache@v2
3030
with:
3131
cache-on-failure: true
32-
- name: Install cross
33-
id: cross_main
32+
- name: Install gcc aarch64
33+
id: aarch_64_setup
3434
run: |
35-
cargo install cross --git https://github.com/cross-rs/cross --rev baf457e
35+
sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu
3636
# Login against a Docker registry except on PR
3737
# https://github.com/docker/login-action
3838
- name: Login into registry ${{ env.REGISTRY }}

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ build-%:
4646

4747
.PHONY: docker-build-push
4848
docker-build-push: docker-build-prepare ## Build and push a cross-arch Docker image tagged with DOCKER_IMAGE_NAME.
49-
FEATURES="jemalloc aws-kms gcp-kms cli asm-keccak js-tracer" $(MAKE) build-x86_64-unknown-linux-gnu
49+
# Build x86_64-unknown-linux-gnu.
50+
cargo build --target x86_64-unknown-linux-gnu --features "jemalloc aws-kms gcp-kms cli asm-keccak js-tracer" --profile "$(PROFILE)"
5051
mkdir -p $(BIN_DIR)/amd64
5152
for bin in anvil cast chisel forge; do \
5253
cp $(CARGO_TARGET_DIR)/x86_64-unknown-linux-gnu/$(PROFILE)/$$bin $(BIN_DIR)/amd64/; \
5354
done
5455

55-
FEATURES="aws-kms gcp-kms cli asm-keccak js-tracer" $(MAKE) build-aarch64-unknown-linux-gnu
56+
# Build aarch64-unknown-linux-gnu.
57+
rustup target add aarch64-unknown-linux-gnu
58+
RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" cargo build --target aarch64-unknown-linux-gnu --features "aws-kms gcp-kms cli asm-keccak js-tracer" --profile "$(PROFILE)"
5659
mkdir -p $(BIN_DIR)/arm64
5760
for bin in anvil cast chisel forge; do \
5861
cp $(CARGO_TARGET_DIR)/aarch64-unknown-linux-gnu/$(PROFILE)/$$bin $(BIN_DIR)/arm64/; \
@@ -61,7 +64,7 @@ docker-build-push: docker-build-prepare ## Build and push a cross-arch Docker im
6164
docker buildx build --file ./Dockerfile.cross . \
6265
--platform linux/amd64,linux/arm64 \
6366
$(foreach tag,$(shell echo $(DOCKER_IMAGE_NAME) | tr ',' ' '),--tag $(tag)) \
64-
--provenance=false \
67+
--provenance=true \
6568
--push
6669

6770
.PHONY: docker-build-prepare

0 commit comments

Comments
 (0)