Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting the ccache archive size #970

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ RUN_SHELL_CMD=
CCACHE=
CCACHE_ARCHIVE=
CCACHE_CREATE_ARCHIVE=
CCACHE_MAXSIZE=
CCACHE_TYPE=
CCACHE_CLEAN=
DLNOSIGNATURE=
Expand Down Expand Up @@ -608,9 +609,11 @@ ccache_setup() {
if test -e $cconf; then
grep -q "^compression*" $cconf && sed -i "s:compression.*:compression = true:g" $cconf || echo "compression = true" >> $cconf
grep -q "^cache_dir*" $cconf && sed -i "s:cache_dir.*:cache_dir = /.ccache:g" $cconf || echo "cache_dir = /.ccache" >> $cconf
grep -q "^max_size*" $cconf && sed -i "s:max_size.*:max_size = ${CCACHE_MAXSIZE:-5G}:g" $cconf || echo "max_size = ${CCACHE_MAXSIZE:-5G}" >> $cconf
else
echo "compression = true" >> $cconf
echo "cache_dir = /.ccache" >> $cconf
echo "max_size = ${CCACHE_MAXSIZE:-5G}" >> $cconf
fi
test -n "$CCACHE_ARCHIVE" -a -e "$CCACHE_ARCHIVE" && ccache_unpack "$BUILD_ROOT/.ccache" ccache
chown -hR "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/.ccache"
Expand Down Expand Up @@ -1215,6 +1218,12 @@ while test -n "$1"; do
-ccache-create-archive)
CCACHE_CREATE_ARCHIVE=true
;;
-ccache-maxsize)
CCACHE_MAXSIZE=$ARG
shift
CCACHE=true
CCACHE_TYPE=ccache
;;
-sccache)
CCACHE=true
CCACHE_TYPE=sccache
Expand Down
1 change: 1 addition & 0 deletions build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ vm_first_stage() {
echo "CCACHE_ARCHIVE='$CCACHE_ARCHIVE'" >> $BUILD_ROOT/.build/build.data
echo "CCACHE_CREATE_ARCHIVE='$CCACHE_CREATE_ARCHIVE'" >> $BUILD_ROOT/.build/build.data
echo "CCACHE_CLEAN='$CCACHE_CLEAN'" >> $BUILD_ROOT/.build/build.data
echo "CCACHE_MAXSIZE='$CCACHE_MAXSIZE'" >> $BUILD_ROOT/.build/build.data
echo "ABUILD_TARGET='$ABUILD_TARGET'" >> $BUILD_ROOT/.build/build.data
echo "BUILD_FLAVOR='$BUILD_FLAVOR'" >> $BUILD_ROOT/.build/build.data
echo "OBS_PACKAGE='$OBS_PACKAGE'" >> $BUILD_ROOT/.build/build.data
Expand Down