Cross compile for arm64 on amd64

We currently have a Snapcraft file for amd64 and it builds and works normally. To extend the support for RasberryPi, we have to build for arm64 but since our CI does not have any machines running ARM processors, we need to cross-compile arm64 on amd64. We have updated the architecture section of the snapcraft.yaml file, but it seems the changes are ignored. For example when it is downloading the deb packages it still downloads the one for amd64 and I don’t think so it changes anything for the compilers. Could you please sure with us how this could be done and whether it is feasible or not?

NOTE: I am using LXD backend and building on core18.

Snapcraft does not cross-compile automatically, you need to invoke the appropriate tools (usually using advanced grammar) to get the results you want. I believe @ogra has some working examples to get you started.