News for hackers. Stuff that matters.
Re:Show HN: Cross-Platform GitHub Action by Arnavion on Monday January 16, 2023 @07:15PM (#34407419)
You can build other-arch images with regular `build`. You'll of course need QEMU hooked up through binfmt to be able to execute `RUN` steps while building the image, but you can do that yourself without involving `buildx`.
Re:Show HN: Cross-Platform GitHub Action by dbingham on Tuesday January 17, 2023 @08:43AM (#34412241)
Neat! I need to read up on QEMU. I haven't looked into cross arch images in a while.
Re:Show HN: Cross-Platform GitHub Action by Arnavion on Tuesday January 17, 2023 @02:44PM (#34417660)
For systemd distros, you might already have systemd-binfmt.service in the systemd package, which when started will automatically register all architectures specified in config files under /usr/lib/binfmt.d with the kernel. Then your qemu package will probably contain one config file in that directory for every arch. So if you enable and start the systemd-binfmt service, you'll automatically have a bajillion architectures registered with the kernel to run under qemu and you don't have to do anything else.

Or you can register manually by writing to /proc/sys/fs/binfmt_misc/register . Note that you'll want to register the statically linked version of qemu (qemu-user-static or whatever your distro calls it), and that you'll want to use at least the O and F flags so that the binary works inside containers automatically insead of needing to be mounted from the host.

Re:Show HN: Cross-Platform GitHub Action by mananaysiempre on Thursday January 19, 2023 @02:29PM (#34444494)
> For systemd distros, you might already have systemd-binfmt.service in the systemd package, which when started will automatically register all architectures specified in config files under /usr/lib/binfmt.d with the kernel. Then your qemu package will probably contain one config file in that directory for every arch. So if you enable and start the systemd-binfmt service, you'll automatically have a bajillion architectures registered with the kernel to run under qemu and you don't have to do anything else.

Note that this can screw up other kinds of builds, as the autoconf check for cross-compilation relies on a cross-compiled executable being unrunnable. (Seen with a wine binfmt handler and a MinGW cross compiler.)