GNOME Builder fails to build gnome-calendar for aarch64: libatk-1.0.so "missing and no known rule to make it"
Trying to build the latest gnome-calendar (master, 36278b1b) for aarch64 using GNOME Builder, to get a aarch64 flatpak (that can then be installed on a Librem 5).
In GNOME Builder I select "Aarch64 Emulation" in the Devices drop-down list and then click on the build button. It seems to download and build all dependencies as well as gnome-calendar itself, but in the end there is an error like this:
ninja: error: '/usr/lib/x86_64-linux-gnu/libatk-1.0.so', needed by 'src/gnome-calendar', missing and no known rule to make it
Here is the output from a second attempt, it says everything is in cache and then fails in the same way again:
flatpak-builder --arch=aarch64 --ccache --force-clean --state-dir /home/elias/.cache/gnome-builder/flatpak-builder --download-only --disable-updates --stop-at=gnome-calendar /home/elias/.cache/gnome-builder/projects/gnome-calendar/flatpak/staging/aarch64-master /home/elias/Projects/gnome-calendar/build-aux/flatpak/org.gnome.Calendar.json
Emptying app dir '/home/elias/.cache/gnome-builder/projects/gnome-calendar/flatpak/staging/aarch64-master'
Downloading sources
Stopping at module gnome-calendar
flatpak-builder --arch=aarch64 --ccache --force-clean --disable-updates --disable-download --state-dir /home/elias/.cache/gnome-builder/flatpak-builder --stop-at=gnome-calendar /home/elias/.cache/gnome-builder/projects/gnome-calendar/flatpak/staging/aarch64-master /home/elias/Projects/gnome-calendar/build-aux/flatpak/org.gnome.Calendar.json
Starting build of org.gnome.Calendar.Devel
Cache hit for gnome-online-accounts, skipping build
Cache hit for geocode-glib, skipping build
Cache hit for libgweather, skipping build
Cache hit for libical, skipping build
Cache hit for intltool, skipping build
Cache hit for evolution-data-server, skipping build
Cache hit for libdazzle, skipping build
Cache hit for libhandy, skipping build
Stopping at module gnome-calendar
Everything cached, checking out from cache
Pruning cache
flatpak build --share=network --nofilesystem=host --filesystem=/home/elias/.cache/gnome-builder --filesystem=/home/elias/Projects/gnome-calendar --filesystem=/home/elias/Projects/gnome-calendar/_build --env=NOCONFIGURE=1 /home/elias/.cache/gnome-builder/projects/gnome-calendar/flatpak/staging/aarch64-master ninja
ninja: error: '/usr/lib/x86_64-linux-gnu/libatk-1.0.so', needed by 'src/gnome-calendar', missing and no known rule to make it
I have tried this on two different computers, one running PureOS byzantium and the other running Ubuntu 20.04, I get the same problem on both of them. GNOME Builder version 3.38.2. Also tried with the latest GNOME Builder (40) but got the same problem anyway.
Building an aarch64 flatpak using GNOME Builder in this way works fine for me for some other GNOME apps, for example it works for GNOME Maps, but for GNOME Calendar I get this problem.
Any ideas on what is going wrong and how to get around it, or how to troubleshoot, would be most welcome.
It seems strange to me that the error message, about '/usr/lib/x86_64-linux-gnu/libatk-1.0.so', is about some x86_64 library when the build is supposed to be for aarch64. Why would it want to use something under /usr/lib/x86_64-linux-gnu/ during a aarch64 build?