The setfattr/getfattr commands were not guaranteed to be available and
abuild wouldn't properly error when they are not. That may cause some
hidden issues.
Changing the code to not need setfattr/getfattr like it is done in
default_dbg ([3ad93d9a83]) and pacman mkpkg ([pacman@88d054093c1]).
The code works by first writing the stripped output into a temporary file
and then replace the contents of the already existing file without changing
any file metadata.
[3ad93d9a83]: 3ad93d9a83
[pacman@88d054093c1]: 88d054093c
This mechanism was an optional speed optimization for apk-tools which has
been replaced with a better one **before the 2.0 full release** of apk-tools.
This in combination with the fact that the code is endian dependant and
therefor is incompatible with reproducible builds seems enough reason to
remove the code.
This fixes 'abuild rootbld' failing to mount when srcdir is moved
outside of $HOME (eg. in /run). This also has the advantage of building
more reproducible even when the build path leaks into the packges (which
happens in most -dbg packages).
I rebuilt networkmanager locally and was greeted with this:
>>> Size difference for networkmanager: 16 MiB -> 2772 KiB
It turns out networkmanager-elogind provides networkmanager so apk info
will list both, and the former is much bigger so it looked like the
rebuilt package was much smaller when there was almost no difference (as
expected)
Fix by matching on exact package name for both lines; this is already
what we were doing with the local package anyway and the apk fetch
correctly picks the correct package in this case
according to the meson documentation the arguments are
'meson setup <builddir> <srcdir>'. meson is very relaxed and allows the
wrong order but this behavior should not be endorsed by a template.
This is because of the following race condition case:
A B
|
lockfd = open(lockfile, ...) |
| unlink(lockfile)
lockf(lockfd, F_LOCK, 0) |
According to [1], to recover from an ESTALE error, an application must
close the file or directory where the error occurred, and reopen it so
the NFS client can resolve the pathname again and retrieve the new file
handle.
[1] https://nfs.sourceforge.net/#faq_a10
The test suite expects ABUILD_USERDIR to be "$HOME"/.abuild but that
could be overwritten in ABUILD_CONF. So use the fixed value instead of
relying on the default.
Otherwise the default hardcoded in abuild-fetch (var/cache/distfiles) is
used.
(in the same vein as 6864df03aa)
Fixes: 1582617 ("abuild-rootbld: clear environment for bwrap container")
the '@' characted serves as a repository separator (eg. pkg@repo) so we
should not add a cmd: provides for binaries having this character.
This avoids conflicts with for example `who` from coreutils and `who@`
from ucspi-tpc6.
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10074