Skip to content

Commit 4adbf25

Browse files
committed
ci: fix
1 parent 1d0cc5f commit 4adbf25

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ jobs:
6767
steps:
6868
- name: Install dependencies
6969
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget gnupg
70-
- name: Install llvm 19
71-
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 19 && rm llvm.sh
70+
- name: Install llvm 21
71+
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 21 && rm llvm.sh
7272
- uses: actions-rust-lang/setup-rust-toolchain@v1
7373
with:
7474
components: clippy
@@ -283,6 +283,7 @@ jobs:
283283
cargo generate --path . standalone-contract --name test-contract
284284
cd test-contract
285285
gmake build test check clippy
286+
cargo clean
286287
cd ..
287288
cargo generate --path . workspace --name test-workspace
288289
cd test-workspace

standalone-contract/scripts/reproducible_build_docker

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ else
5555
TASKS+=" build "
5656
fi
5757

58-
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
58+
DOCKER_IMAGE_PLATFORM=linux/amd64
59+
if [[ "$(grep -E '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')" == "ubuntu" ]] && [[ "$(uname -m)" == "aarch64" ]]; then
60+
echo "Ubuntu ARM64 detected. Using docker image with linux/arm64 platform. Note: This may produce different binaries than the default linux/amd64."
61+
DOCKER_IMAGE_PLATFORM=linux/arm64
62+
fi
63+
64+
$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
5965
# Reset file ownerships for all files docker might touch
60-
$DOCKER run --platform=linux/amd64 --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'
66+
$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'
6167

6268
if [[ "${UPDATE}" = "yes" ]]; then
6369
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"

workspace/scripts/reproducible_build_docker

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ else
5555
TASKS+=" build "
5656
fi
5757

58-
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
58+
DOCKER_IMAGE_PLATFORM=linux/amd64
59+
if [[ "$(grep -E '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')" == "ubuntu" ]] && [[ "$(uname -m)" == "aarch64" ]]; then
60+
echo "Ubuntu ARM64 detected. Using docker image with linux/arm64 platform. Note: This may produce different binaries than the default linux/amd64."
61+
DOCKER_IMAGE_PLATFORM=linux/arm64
62+
fi
63+
64+
$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
5965
# Reset file ownerships for all files docker might touch
60-
$DOCKER run --platform=linux/amd64 --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'
66+
$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'
6167

6268
if [[ "${UPDATE}" = "yes" ]]; then
6369
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"

0 commit comments

Comments
 (0)