From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B9E01158041 for ; Sat, 9 Mar 2024 18:46:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C0E2DE2A2C; Sat, 9 Mar 2024 18:46:14 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A34E7E2A2C for ; Sat, 9 Mar 2024 18:46:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A3DA633BE3B for ; Sat, 9 Mar 2024 18:46:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CDBBC1108 for ; Sat, 9 Mar 2024 18:46:11 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1710009960.8eb2502bf264d54dfbf180222f162f7a593b947d.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 8eb2502bf264d54dfbf180222f162f7a593b947d X-VCS-Branch: master Date: Sat, 9 Mar 2024 18:46:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 82e29b6f-3c81-4d7e-a18f-6e0600bdcd04 X-Archives-Hash: 155c4a470121cce99527dc82fe9d72bc commit: 8eb2502bf264d54dfbf180222f162f7a593b947d Author: Florian Schmaus gentoo org> AuthorDate: Wed Mar 6 20:52:08 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sat Mar 9 18:46:00 2024 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8eb2502b phase-functions: prematurely delete WORKDIR if FEATURES=merge-wait Using the merge-wait feature together with many parallel emerge jobs potentially leads to a high disk space usage due to the created portage build directories waiting for their packages to be merged into the live filesystem prior portage will clean them. This can easily lead to out-of-space errors. Prematurely deleting WORKDIR at the end of src_install() helps reducing the temporarily used disk space. All that portage need to merge a package into the live filesystem are the files in the image/ directory (D). (At least in theory) Signed-off-by: Florian Schmaus gentoo.org> Closes: https://github.com/gentoo/portage/pull/1302 Signed-off-by: Sam James gentoo.org> bin/phase-functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index ebcf5f242a..ab130a3be5 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -723,6 +723,13 @@ __dyn_install() { >> DEBUGBUILD fi trap - SIGINT SIGQUIT + + # Prematurely delete WORKDIR in case merge-wait is enabled to + # decrease the space used by portage build directories until the + # packages are merged and cleaned. + if has merge-wait ${FEATURES} && ! has keepwork ${FEATURES}; then + rm -rf "${WORKDIR}" + fi } __dyn_help() {