-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build for arm64
on amd64
#615
Build for arm64
on amd64
#615
Conversation
6854f65
to
4f44d39
Compare
bfd92b2
to
fc5bc9d
Compare
fc5bc9d
to
44c15fd
Compare
@achow101 Would you have a moment to review this PR please? |
I've started doing arm64 builds on a raspi 4 that I have. Is this still relevant? |
I believe so. But I can see there are some conflicts now. |
# Conflicts: # contrib/build.Dockerfile # contrib/build_bin.sh
44c15fd
to
d93c8f7
Compare
@@ -12,7 +14,7 @@ pip install poetry | |||
gui_support="${1:---with-gui}"; | |||
|
|||
# Setup poetry and install the dependencies | |||
if [[ $gui_support == "--with-gui" ]]; then | |||
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -40,7 +42,7 @@ OS=`uname | tr '[:upper:]' '[:lower:]'` | |||
if [[ $OS == "darwin" ]]; then | |||
OS="mac" | |||
fi | |||
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved up in this file.
@@ -26,7 +28,7 @@ TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00" | |||
export PYTHONHASHSEED=42 | |||
poetry run pyinstaller hwi.spec | |||
|
|||
if [[ $gui_support == "--with-gui" ]]; then | |||
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not run for arm64
.
@achow101 It seems I succeeded in building an arm64 build using the instructions above - i.e. docker buildx build --no-cache --platform linux/arm64 -t hwi-builder -f contrib/build.Dockerfile .
# Note the use of "--without-gui".
docker run --platform linux/arm64 -it --rm --name hwi-builder -v $PWD:/opt/hwi --workdir /opt/hwi hwi-builder /bin/bash -c "contrib/build_bin.sh --without-gui && contrib/build_dist.sh --without-gui" WDYT? |
Can you update docs/development/release-process.rst with the instructions? |
@@ -17,11 +17,15 @@ Create the docker images:: | |||
|
|||
docker build --no-cache -t hwi-builder -f contrib/build.Dockerfile . | |||
docker build --no-cache -t hwi-wine-builder -f contrib/build-wine.Dockerfile . | |||
docker buildx build --no-cache --platform linux/arm64 -t hwi-builder-arm64 -f contrib/build.Dockerfile . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like one can simplify it nowadays to:
docker buildx build --no-cache --platform linux/arm64 -t hwi-builder-arm64 -f contrib/build.Dockerfile . | |
docker build --no-cache --platform linux/arm64 -t hwi-builder-arm64 -f contrib/build.Dockerfile . |
based on https://docs.docker.com/build/guide/multi-platform/. It should be available from API 1.38 (the latest is 1.43):
Updated. I added what I find to be safest but I can only test on Ubuntu 23.04. Maybe your system differs. So it would be great if you could try the instructions and pick what works for you. |
ACK 3d3c02d |
Related to #345
Related to WalletWasabi/WalletWasabi#4051 (comment)
Discussion: Some discussion here: kiminuo#1
This PR just shows how to do a deterministic build for
arm64
architecture. The hope is HWI's support forarm64
will improve a bit.Setup
To set up your environment, install:
sudo apt install qemu-user-static
Build for arm64
Use docker buildx to replicate deterministic build instructions for the arm64 build:
i.e. the change is:
Resources
Limitations
No GUI support
So far I had no luck with building
hwi-qt
because I get the following errorduring execution of
poetry install -E qt
That's why I use
build_bin.sh --without-gui
(see #655)