When upgrading our cross gcc packages, build some packages with them to
ensure they work as expected.
Put the gitlab-ci.yml in cross/ instead of cross/gcc-x86_64, because:
* it tests gcc-aarch64 too
* so it does not get removed when regenerating gcc-x86_64 with
pmbootstrap
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6776
Run native binaries for extracting / packing various archives if they
are installed in the native chroot when using the crossdirect
compilation method, instead of having them go through QEMU. The
resulting extracted/packed files should always be the same but this is
significantly faster.
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6763
The gcc-x86_64 is only built for aarch64. Set the depends line to
so:libc.musl-aarch64.so.1 as we had it before 42a50731 ("cross/gcc-*:
upgrade to 14.2.0-r6"). I had set it to so:libc.musl-x86_64.so.1 like
the other cross gccs by accident.
[ci:skip-build]: I'll verify it builds locally before merge.
[ci:skip-vercheck]: version not bumped intentionally.
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6501
Bring back manually listed soname depends that were removed in 42a50731
("cross/gcc-*: upgrade to 14.2.0-r6 "). Without these we get various
cross compiler errors (issue 3705).
How these were removed: the cross/gcc-* packages are generated from
"pmbootstrap aportgen", and the code in master currently removes those.
There was a WIP MR that adds the depends again, but it was not finished
(pmbootstrap MR 2521). This needs to be fixed in pmbootstrap and we need
a better process that ensures we can't push broken cross compilers to
master anymore if followed correctly. I'll look into all of that, but
first let's get the cross compilers working again in edge.
[ci:skip-vercheck]: for generated gccs we keep the same pkgrel as in
alpine. I'll force a rebuild in BPO after merge (not
ideal, but fixing this is rather urgent as cross
compilation is otherwise broken in pmOS edge)
[ci:skip-build]: tested locally
Related: issue 3705
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6500
Run aportgen again with pmbootstrap MR 2597 to fix the conflict when
installing cross gcc and native gcc at the same time:
(52/53) Installing gcc-armv7 (14.2.0-r6)
ERROR: gcc-armv7-14.2.0-r6: trying to overwrite usr/lib/libgcc_s.so.1 owned by libgcc-14.2.0-r6.
[ci:skip-vercheck]: for generated gccs we keep the same pkgrel as in
alpine. I'll force a rebuild in BPO after merge (not
ideal, but fixing this is rather urgent as cross
compilation is otherwise broken in pmOS edge)
[ci:skip-build]: tested locally with gcc-armv7
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6497
Alpine's abuild runs build() without fakeroot, and package() with
fakeroot. From the APKBUILD reference page in the Alpine wiki:
> Note: Building in fakeroot will reduce performance for parallel
> builds dramatically. It is for this reason that we split the build
> and package process into two separate functions.
Every now and then we see a package that tries to run a compiler (gcc,
g++, clang, ...) during package() in the APKBUILD. This is a bug in the
APKBUILD / build system of the program we are packaging. All compiling
should be done during build().
Let crossdirect print the following when this happens:
============================================================================================
ERROR: crossdirect was called with: LD_PRELOAD=libfakeroot.so
This means your package tried to run a compiler during package().
This is not supported by crossdirect, and usually not a good idea.
* Try to fix your APKBUILD so it does not run the compiler during package(), only in build()
* If you're using meson install, try to add '--no-rebuild'
* If this is not possible, you can work around it by setting options="!pmb:crossdirect"
(compilation will be slower!)
============================================================================================
Instead of:
ERROR: crossdirect: can't handle LD_PRELOAD: libfakeroot.so
Please report this at: https://gitlab.com/postmarketOS/pmaports/issues
As a workaround, you can compile without crossdirect.
In the past I've also tried to add 'strcmp(ldPreload, "libfakeroot.so") == 0'
(pmaports MR 2231), and today I made the same patch. The current code
looks like it would then work by just using libfakeroot.so from the
native chroot, but it does not work. And as mentioned, if we hit this
then we are compiling in package() which is something we should not do
anyway!
Fixes: pmb issue 2039
Related: pma issue 2351, pma MR 5738