From 2c57ea6645353f9b0b81263b35c5708f6967fc56 Mon Sep 17 00:00:00 2001 From: Niklas Dusenlund Date: Thu, 22 Aug 2024 13:14:26 +0200 Subject: [PATCH] releases/build.sh: Enforce amd64, use .containerversion Currently it is not posisble to reproducibly build the firmware due to the toolchains we have, therefore we enforce amd64. We have recently added a file called .containerversion with the version of the container that the project should build with. Let's tag the built version in release/build.sh with that as well to make it easier work with. --- releases/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/releases/build.sh b/releases/build.sh index 4481937ca..713a74407 100755 --- a/releases/build.sh +++ b/releases/build.sh @@ -35,7 +35,10 @@ fi # Build the Docker image (this can take a while): -docker build --pull --force-rm --no-cache -t bitbox02-firmware . +# The firmware is only reproducible with the same host compiler. For now we force linux/amd64. +# The file .containerversion does not exist in older versions of the project. +containerversion=$(2>/dev/null cat .containerversion || echo "latest") +docker build --pull --platform linux/amd64 --force-rm --no-cache -t bitbox02-firmware:${containerversion} . # Revert the above local patch to the Dockerfile again to have a clean state. git checkout -- Dockerfile @@ -47,7 +50,7 @@ git checkout -- Dockerfile # # The safe.directory config is so that git commands work. even though the repo folder mounted in # Docker is owned by root, which can be different from the owner on the host. -docker run -it --rm --volume `pwd`:/bb02 bitbox02-firmware bash -c "git config --global --add safe.directory /bb02 && cd /bb02 && $2" +docker run -it --rm --volume `pwd`:/bb02 bitbox02-firmware:${containerversion} bash -c "git config --global --add safe.directory /bb02 && cd /bb02 && $2" echo "firmware.bin created at:" echo `pwd`/build/bin/firmware.bin