Package: devscripts
Version: 2.25.5
Severity: wishlist
x-debbugs-cc: reproducible-b...@lists.alioth.debian.org
User reproducible-bui...@lists.alioth.debian.org
Usertag environment

Dear Maintainer,

please add a --cache-size-limit option or some such.

from #debian-reproducible today:

< h01ger> josch: i just committed this crime: bin/debrebuild_cache_limiter.sh * 
r.d.n: add script to work around/implement a missing feature of debrebuild * 
https://salsa.debian.org/qa/jenkins.debian.net/-/commit/2db5e98
< h01ger> josch: for the upcoming debrebuild bug report, i'm not sure whether 
you can rely on atime being a sensible source of information and how to 
implement host specific limits. i guess with --cache-size, and then its up to 
the user how to call that
< h01ger> for the time being i intend to call bin/debrebuild_cache_limiter.sh 
manually, as i've been doing the last weeks anyway. (only 2-3 hosts really need 
it and there's i just ran one long command daily manually. this is a bit better 
and probably even safe to run in cron or some such...)

For easier reference, the script is as follows:

$ cat bin/debrebuild_cache_limiter.sh 
#!/bin/bash
#
# Copyright 2025 Holger Levsen (hol...@layer-acht.org)
# released under the GPLv2

CACHE=~rebuilderd/cache

if [ ! -d $CACHE ] ; then
        echo "$CACHE does not exist."
        exit 1
fi

case $HOSTNAME in
        ionos17*)       LIMIT=50  ;;
        codethink*)     LIMIT=20  ;;
        osuosl*)        LIMIT=333 ;;
        infom07*)       LIMIT=200 ;; # FIXME: drop extra partition again?
        infom08*)       LIMIT=100 ;;
        riscv64*)       LIMIT=180 ;;
        *)              echo "Limit for $HOSTNAME not defined."
                        exit 1 ;;
esac

# delete 1000 oldest files
# FIXME: use atime, but then, this script should not exist in the first 
place... :)
find $CACHE -type f -printf '%T+ %p\n' | sort | head -n 1000|cut -d ' ' 
-f2-|xargs sudo rm 

set -e
set -o pipefail 

SIZE=$(du -sh $CACHE | grep G | cut -d 'G' -f 1)

if [ $SIZE -gt $LIMIT ] ; then
        echo "$CACHE is still ${SIZE}G, reducing further."
        $0
else
        echo "$CACHE is ${SIZE}G, voila."
fi

exit 0


& thanks a lot for debrebuild, it's extremely useful and very much works very
well!

-- 
cheers,
        Holger

 ⢀⣴⠾⠻⢶⣦⠀
 ⣾⠁⢠⠒⠀⣿⡁  holger@(debian|reproducible-builds|layer-acht).org
 ⢿⡄⠘⠷⠚⠋⠀  OpenPGP: B8BF54137B09D35CF026FE9D 091AB856069AAA1C
 ⠈⠳⣄

Another end of the world is possible.

Attachment: signature.asc
Description: PGP signature

Reply via email to