diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cb9e53c..06c2a50 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -67,8 +67,8 @@ jobs: steps: - name: Install dependencies run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget gnupg - - name: Install llvm 19 - run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 19 && rm llvm.sh + - name: Install llvm 21 + run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 21 && rm llvm.sh - uses: actions-rust-lang/setup-rust-toolchain@v1 with: components: clippy @@ -283,6 +283,7 @@ jobs: cargo generate --path . standalone-contract --name test-contract cd test-contract gmake build test check clippy + cargo clean cd .. cargo generate --path . workspace --name test-workspace cd test-workspace diff --git a/standalone-contract/scripts/reproducible_build_docker b/standalone-contract/scripts/reproducible_build_docker index dd61351..66e2899 100755 --- a/standalone-contract/scripts/reproducible_build_docker +++ b/standalone-contract/scripts/reproducible_build_docker @@ -55,9 +55,15 @@ else TASKS+=" build " fi -$DOCKER run --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS +DOCKER_IMAGE_PLATFORM=linux/amd64 +if [[ "$(grep -E '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')" == "ubuntu" ]] && [[ "$(uname -m)" == "aarch64" ]]; then + echo "Ubuntu ARM64 detected. Using docker image with linux/arm64 platform. Note: This may produce different binaries than the default linux/amd64." + DOCKER_IMAGE_PLATFORM=linux/arm64 +fi + +$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS # Reset file ownerships for all files docker might touch -$DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target' +$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target' if [[ "${UPDATE}" = "yes" ]]; then echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!" diff --git a/workspace/scripts/reproducible_build_docker b/workspace/scripts/reproducible_build_docker index dd61351..66e2899 100755 --- a/workspace/scripts/reproducible_build_docker +++ b/workspace/scripts/reproducible_build_docker @@ -55,9 +55,15 @@ else TASKS+=" build " fi -$DOCKER run --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS +DOCKER_IMAGE_PLATFORM=linux/amd64 +if [[ "$(grep -E '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')" == "ubuntu" ]] && [[ "$(uname -m)" == "aarch64" ]]; then + echo "Ubuntu ARM64 detected. Using docker image with linux/arm64 platform. Note: This may produce different binaries than the default linux/amd64." + DOCKER_IMAGE_PLATFORM=linux/arm64 +fi + +$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS # Reset file ownerships for all files docker might touch -$DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target' +$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target' if [[ "${UPDATE}" = "yes" ]]; then echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"