Skip to content

Commit 9810a02

Browse files
authored
Merge pull request #139 from archlinux/max-memory
Allow placing upper limit on RAM use on build container
2 parents 210f9d0 + 31e10df commit 9810a02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

repro.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ function exec_nspawn(){
219219
--register=no \
220220
${EPHEMERAL:+--ephemeral} \
221221
${ISSYSTEMD242:+--pipe} \
222+
${MAX_MEMORY:+--property="MemoryMax=${MAX_MEMORY}"} \
222223
-E "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" \
223224
-D "$BUILDDIRECTORY/$container" "${@:2}"
224225
if ((EPHEMERAL)); then
@@ -582,6 +583,7 @@ General Options:
582583
-d Run diffoscope if packages are not reproducible
583584
-f Use the local PKGBUILD for building
584585
-n Run makepkg with --nocheck
586+
-M <value> Set an upper limit for RAM use on the build container (e.g. 12G)
585587
-V Print version information
586588
-o <path> Set the output directory (default: ./build)
587589
__END__
@@ -592,13 +594,14 @@ function print_version() {
592594
}
593595

594596
function parse_args() {
595-
while getopts :hdnfVo: arg; do
597+
while getopts :hdnfM:Vo: arg; do
596598
case $arg in
597599
h) print_help; exit 0;;
598600
V) print_version; exit 0;;
599601
f) pkgbuild_file=1;;
600602
d) run_diffoscope=1;;
601603
n) NOCHECK=1;;
604+
M) MAX_MEMORY="$OPTARG";;
602605
o) OUTDIR="$OPTARG";;
603606
*) error "unknown argument ${OPTARG}" ; print_help; exit 1;;
604607
esac

0 commit comments

Comments
 (0)