Basically I am moving the compilation of the tool-chains out of the Dockerfile, as I believe this to be the only reasonable way to achieve multi-arch docker containers.
There is a lot to comprehend, so here are some notes as to why:
u-root and linux are OK to build the "normal way", however with edk2 and coreboot I get errors when trying to compile to tool-chains - I suspect the problem to be native emulation not supporting all of the instructions required
building x86 on x86 machine and arm64 on arm64 works fine, but building arm64 on x86 machine is broken
this means that I cannot build edk2 or coreboot multi-arch container on single x86 machine as I can u-root or linux
I looked into cross-compilation - aka cross-compile the cross-compilation tool-chains ... well that did not go well
one way would be to build each arch-container separately (x86 part on x86 machine and arm64 part on arm64 machine), publish them separately and then publish hand-crafted manifest connecting them together ... (see The hard way with docker manifest in Multi-arch build and images, the simple way
but we can avoid all of that with simply compiling the tool-chains separately on their respective machines and then just copy files into single multi-arch container (which can be done without any problems with simple native emulation)
so this is one step towards that
one advantage is that this way we can cache the compiled tool-chains for coreboot and speed up the build by one order of magnitude (normally they take around 1 hour to compile)
UPDATE:
unfortunately pre-compiling edk2BaseTools is not that simple, there are 2 big problems:
the oldest edk2 that we have is udk2017 which is using Ubuntu Bionic (18.04) which is simply too old to run GitHub action inside it due to obsolete NodeJS (see GLIBC_2.28 not found)
GitHub is not going to fix this, nor they are likely to remove the idiotic design-flaw of having actions being written in JavaScript
so I will make it such that the edk2BaseTools gets compile on the first use by the user, and since it does not take long, it should be fine I guess
At the moment this is not used yet, but will be.
Basically I am moving the compilation of the tool-chains out of the Dockerfile, as I believe this to be the only reasonable way to achieve multi-arch docker containers.
There is a lot to comprehend, so here are some notes as to why:
u-root
andlinux
are OK to build the "normal way", however withedk2
andcoreboot
I get errors when trying to compile to tool-chains - I suspect the problem to be native emulation not supporting all of the instructions requiredx86
onx86
machine andarm64
onarm64
works fine, but buildingarm64
onx86
machine is brokenedk2
orcoreboot
multi-arch container on singlex86
machine as I canu-root
orlinux
x86
part onx86
machine andarm64
part onarm64
machine), publish them separately and then publish hand-crafted manifest connecting them together ... (seeThe hard way with docker manifest
in Multi-arch build and images, the simple waycoreboot
and speed up the build by one order of magnitude (normally they take around 1 hour to compile)UPDATE:
edk2
BaseTools
is not that simple, there are 2 big problems:edk2
that we have isudk2017
which is usingUbuntu Bionic
(18.04
) which is simply too old to run GitHub action inside it due to obsoleteNodeJS
(see GLIBC_2.28 not found)edk2
BaseTools
gets compile on the first use by the user, and since it does not take long, it should be fine I guess