Originally "gcc -dumpmachine" was used to detect build gcc triplet.
However, abuild does not depend on gcc or build-base (but installs
it if needed to build) so gcc might not be there. Additionally
abuild-sign can be used standalone, and does not have gcc dependency.
Using ${CC:-gcc} is problematic in cross-compile, as CC might be
already set for the cross-compiler and would result giving the target
host triplet.
It was deemed simplest to use "apk --print-arch" exclusively to detect
the builder host type, or specify CBUILD manually. If there is need
to use abuild/abuild-sign on non-Alpine hosts withou apk, we can
later add fallback that uses "uname -m" to detect the architecture
and guess Alpine CBUILD from it.
Fixes#9974
Fixes: 5adf47c1 "functions.sh: use apk --print-arch for CARCH if gcc is missing"
Fixes: 95cd15c0 "functions.sh: dont die if gcc is missing"
This introduces basic support for ccache, during packaging builds.
If you are building many packages, it is recommended to manually
increase the maximum size of the ccache cache. This is typically
achieved by modifying `~/.ccache/ccache.conf` and adjusting the
`max_size` setting.
Signed-off-by: Joseph Benden <joe@benden.us>
`readconfig()` would return the result of `[ -z "$CBUILDROOT" ]` condition (line 123) and trigger shell termination in abuild.
This also fixes building packages with a different $CTARGET and therefore cross-compile tools.
This permits introducing branch-specific modifications to abuild.conf settings.
Any settings there override /etc/abuild.conf and $HOME/.abuild/abuild.conf.