abuild: various USE_CCACHE fixes
- set PATH in the rootbld environment so ccache is actually used. - drop the check for command -v ccache. ccache will be pulled in as build dependency so we don't need to die if its missing. - create ~/.ccache if missing rather than die. This directory will normally be created by ccache itself, but we need to create it so we can bind mount it incase of rootbld. - don't die if ccache.conf is missing. ccache will create it.
This commit is contained in:
parent
3ca7660b66
commit
f9707808ef
15
abuild.in
15
abuild.in
|
@ -2196,7 +2196,7 @@ rootbld() {
|
||||||
--bind "$REPODEST" "$REPODEST" \
|
--bind "$REPODEST" "$REPODEST" \
|
||||||
--hostname "build-$buildhost-$CARCH" \
|
--hostname "build-$buildhost-$CARCH" \
|
||||||
--chdir "$startdir" \
|
--chdir "$startdir" \
|
||||||
--setenv PATH /bin:/usr/bin:/sbin:/usr/sbin \
|
--setenv PATH ${USE_CCACHE:+/usr/lib/ccache/bin:}/bin:/usr/bin:/sbin:/usr/sbin \
|
||||||
/usr/bin/abuild $force rootbld_actions
|
/usr/bin/abuild $force rootbld_actions
|
||||||
update_abuildrepo_index
|
update_abuildrepo_index
|
||||||
cleanup $CLEANUP
|
cleanup $CLEANUP
|
||||||
|
@ -2501,18 +2501,7 @@ fi
|
||||||
|
|
||||||
# check for ccache presence and maybe export its path
|
# check for ccache presence and maybe export its path
|
||||||
if [ -n "$USE_CCACHE" ]; then
|
if [ -n "$USE_CCACHE" ]; then
|
||||||
if ! command -v ccache >/dev/null; then
|
mkdir -p "$HOME/.ccache"
|
||||||
die "Ccache is enabled; however, the binary can not be found."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "$HOME/.ccache" ]; then
|
|
||||||
die "Ccache is enabled; however, the user cache directory is not found."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "$HOME/.ccache/ccache.conf" ]; then
|
|
||||||
die "Ccache is enabled; however, the ccache configuration file is not found."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# prepend ccache path
|
# prepend ccache path
|
||||||
export PATH="/usr/lib/ccache/bin:$PATH"
|
export PATH="/usr/lib/ccache/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue