From unknown Fri Jun 13 10:30:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50327] [PATCH 0/2] Improved =?UTF-8?Q?=E2=80=98free?= disk =?UTF-8?Q?space=E2=80=99?= message + a question Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Sep 2021 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50327@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1630524224845 (code B ref -1); Wed, 01 Sep 2021 19:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Sep 2021 19:23:44 +0000 Received: from localhost ([127.0.0.1]:39038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVpo-0000DY-1U for submit@debbugs.gnu.org; Wed, 01 Sep 2021 15:23:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:44392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVpl-0000DQ-SS for submit@debbugs.gnu.org; Wed, 01 Sep 2021 15:23:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLVpl-0004S2-NR for guix-patches@gnu.org; Wed, 01 Sep 2021 15:23:41 -0400 Received: from tobias.gr ([2a02:c205:2020:6054::1]:51384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLVpj-0006Gi-Lu for guix-patches@gnu.org; Wed, 01 Sep 2021 15:23:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=PjiLHdYJn0ljt 7J7Wnlp/tScNiaWrm0p/f9WpViKj/A=; h=date:subject:to:from; d=tobias.gr; b=nhQgz6ET1tQ4mNfBpIo5Hh25y5gLNhomVdqu5DBv14DXFsoDKTrqAYF6Prfhp3S/zKIw v6sH/V+ufZW63aDu2uEhJ7GT3tcQPjDUaT5UF3xSFw6NCLP57Pf4rrJxGDBxxkZukjB/oe RA9V3+KudZl7f1I1L0biZ0iAS1IXGamHp5Ab/gaeepdMYFpqYAQnafxdl4YrZoPo0RC81g LZR/+7ZA+45QlF+387DKI1mo6tU9cMHrZzy8aI05d5otRlPNVq2wqbS1ao68S7nI2nmSNH vCCrBfNeWm2q245CSrvGsSIrg8WPZF62s7TURRGSI/dzg9FRuGULneOxRwfQOHsQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 432d82b9 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Wed, 1 Sep 2021 19:23:29 +0000 (UTC) From: Tobias Geerinckx-Rice Date: Wed, 01 Sep 2021 21:05:42 +0200 BIMI-Selector: v=BIMI1; s=default; Message-ID: <875yvkaymg.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Guix, This improves the warning given when free space looks sus. From: note: build failure may have been caused by lack of free disk=20 space to: note: only 0.01 MiB available in =E2=80=98/gnu/store=E2=80=99 note: only 5.00 MiB available in =E2=80=98/tmp/guix-build-foo.drv-0=E2=80= =99 note: build failure may have been caused by lack of free disk=20 space It also raises the warning threshold from 8 to 64 MiB, which is a=20 much prettier arbitrary integer. Question: shouldn't all of nix/ have licence headers added too?=20 As it stands, there are two very lonely ones in=20 nix/libstore/builtins.{cc,hh} and that's it. Kind regards, T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYS/TNw0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW15AToA/RzLjaZF0+AXwLi4kKPgZUpolZqgIIr68v4Aitss z1vXAQCY8jx/CBUFuHqevIJtAWbLz7ZQvbD1Fv9uaJPFS1OQAA== =VAsK -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 13 10:30:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50327] [PATCH 1/2] daemon: Print which disk(s) are how full. References: <875yvkaymg.fsf@nckx> In-Reply-To: <875yvkaymg.fsf@nckx> Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Sep 2021 19:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50327@debbugs.gnu.org Received: via spool by 50327-submit@debbugs.gnu.org id=B50327.16305243541088 (code B ref 50327); Wed, 01 Sep 2021 19:26:01 +0000 Received: (at 50327) by debbugs.gnu.org; 1 Sep 2021 19:25:54 +0000 Received: from localhost ([127.0.0.1]:39048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVrt-0000HP-N2 for submit@debbugs.gnu.org; Wed, 01 Sep 2021 15:25:53 -0400 Received: from tobias.gr ([80.241.217.52]:52760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVrs-0000HG-CG for 50327@debbugs.gnu.org; Wed, 01 Sep 2021 15:25:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=cTjlcOLaNrG7T zN+6+jPRIKEcP18fy0/86Az9zUr4sQ=; h=date:subject:to:from; d=tobias.gr; b=ejEhjAKy3lAJS2tr7Ys8QnG5C/Xp0oH6ZgEVrx0wrt8Ym0mK0pEZRCgn85WrxavJS+Za OYTohIr3dsCp+R+AXtjjMK+nX3veCUgfg5FR8AKuyiheqJOBZ9wQwJYskXaP7caQaIgdE5 hbzkIjwsUHp+ve3zg7HDlNDjlfRBlgVQz9/hrapIy/7e7TE3i0CNrtP8SIFnkfrdNHMS+i /qKDC6BPqqFQ3ndft0GFeCv34PtBLAsU1t1CDEhN0PlgWYU2sRArbfe5qZmqg4QrT3OGj8 BUzHqRpG4vfsor/xdDiqx+Ewc0bvE66kBVB1izULZYJLCxjFOdtGt7yNJ+oPspmQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 702b486c (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <50327@debbugs.gnu.org>; Wed, 1 Sep 2021 19:25:47 +0000 (UTC) From: Tobias Geerinckx-Rice Date: Wed, 1 Sep 2021 21:25:44 +0200 Message-Id: <20210901192545.12347-1-me@tobias.gr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * nix/libstore/build.cc (pathFull): New function. (DerivationGoal::buildDone): Use it. --- nix/libstore/build.cc | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 5697ae5a43..963cddb98b 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1297,6 +1297,25 @@ void replaceValidPath(const Path & storePath, const Path tmpPath) deletePath(oldPath); } +static bool pathFull(Path path) +{ +#if HAVE_STATVFS + unsigned long long required = 8ULL * 1024 * 1024; // FIXME: make configurable + struct statvfs st; + + if (statvfs(path.c_str(), &st) == 0) { + unsigned long long free = (unsigned long long) st.f_bavail * st.f_bsize; + if (free < required) { + printMsg(lvlError, format("note: only %1$.2f MiB available in ‘%2%’") + % (free / (1024.0 * 1024.0)) % path); + return true; + } + } +#endif + + return false; +} + MakeError(NotDeterministic, BuildError) @@ -1355,16 +1374,10 @@ void DerivationGoal::buildDone() of knowing whether the build actually got an ENOSPC. So instead, check if the disk is (nearly) full now. If so, we don't mark this build as a permanent failure. */ -#if HAVE_STATVFS - unsigned long long required = 8ULL * 1024 * 1024; // FIXME: make configurable - struct statvfs st; - if (statvfs(settings.nixStore.c_str(), &st) == 0 && - (unsigned long long) st.f_bavail * st.f_bsize < required) + if (pathFull(settings.nixStore)) diskFull = true; - if (statvfs(tmpDir.c_str(), &st) == 0 && - (unsigned long long) st.f_bavail * st.f_bsize < required) + if (pathFull(tmpDir)) diskFull = true; -#endif deleteTmpDir(false); -- 2.32.0 From unknown Fri Jun 13 10:30:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50327] [PATCH 2/2] daemon: Suspect low disk space sooner. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Sep 2021 19:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50327@debbugs.gnu.org Received: via spool by 50327-submit@debbugs.gnu.org id=B50327.16305243551102 (code B ref 50327); Wed, 01 Sep 2021 19:26:02 +0000 Received: (at 50327) by debbugs.gnu.org; 1 Sep 2021 19:25:55 +0000 Received: from localhost ([127.0.0.1]:39052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVrv-0000Hg-0x for submit@debbugs.gnu.org; Wed, 01 Sep 2021 15:25:55 -0400 Received: from tobias.gr ([80.241.217.52]:52760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLVrt-0000HG-I3 for 50327@debbugs.gnu.org; Wed, 01 Sep 2021 15:25:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=iQTHOBEZ3BwAh pmvZTJwfk1DTJ8tjt8f9ll42Q5mXeo=; h=references:in-reply-to:date: subject:to:from; d=tobias.gr; b=YdN4SxdT81itR5AwUeV5LCzZ6sBHgc/zx4QCAo WI8o+j+j5uls0jRPLN5Uo+o6LwLdvVtjHRCASSe5K8yACw6/pI937iIrWd2o9nr/2rYlsv dhddKO0czkJUjPc6HBuUvB1QaPg//W4Hlyl1I5OrDIkJqMt7wvrVxwloBV6+YgsbsFNKbe k0jKXTUvJiiqyha1N5NCCzG8Y6sqUZmXp/odDU5z8BomH9WkEmbj1YHrQl7IRfy1lvcWep 5KsQAHoTB20CGahm+sCHx9ZWs6/Q1oC/fMILwfKdgKjfWpo71hy7DMhZEgi5/tcSdHXiTV CFw5Xd1XiGHaQC2BDa2BMfNA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id c58772aa (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <50327@debbugs.gnu.org>; Wed, 1 Sep 2021 19:25:47 +0000 (UTC) From: Tobias Geerinckx-Rice Date: Wed, 1 Sep 2021 21:25:45 +0200 Message-Id: <20210901192545.12347-2-me@tobias.gr> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210901192545.12347-1-me@tobias.gr> References: <20210901192545.12347-1-me@tobias.gr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * nix/libstore/build.cc (pathFull): Bump the required free space up to a more 2021 amount of 64 MiB. --- nix/libstore/build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 963cddb98b..f62704a107 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1300,7 +1300,7 @@ void replaceValidPath(const Path & storePath, const Path tmpPath) static bool pathFull(Path path) { #if HAVE_STATVFS - unsigned long long required = 8ULL * 1024 * 1024; // FIXME: make configurable + unsigned long long required = 64ULL * 1024 * 1024; // FIXME: make configurable struct statvfs st; if (statvfs(path.c_str(), &st) == 0) { -- 2.32.0 From unknown Fri Jun 13 10:30:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50327] [PATCH 0/2] Improved =?UTF-8?Q?=E2=80=98free?= disk =?UTF-8?Q?space=E2=80=99?= message + a question Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 18 Sep 2021 09:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice Cc: 50327@debbugs.gnu.org Received: via spool by 50327-submit@debbugs.gnu.org id=B50327.163195881114497 (code B ref 50327); Sat, 18 Sep 2021 09:54:02 +0000 Received: (at 50327) by debbugs.gnu.org; 18 Sep 2021 09:53:31 +0000 Received: from localhost ([127.0.0.1]:33555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRX2J-0003ll-JZ for submit@debbugs.gnu.org; Sat, 18 Sep 2021 05:53:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRX2G-0003lV-Pd for 50327@debbugs.gnu.org; Sat, 18 Sep 2021 05:53:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48000) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRX2B-0004y9-E1; Sat, 18 Sep 2021 05:53:23 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35790 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRX2B-0008OR-5s; Sat, 18 Sep 2021 05:53:23 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <875yvkaymg.fsf@nckx> <20210901192545.12347-1-me@tobias.gr> Date: Sat, 18 Sep 2021 11:53:21 +0200 In-Reply-To: <20210901192545.12347-1-me@tobias.gr> (Tobias Geerinckx-Rice's message of "Wed, 1 Sep 2021 21:25:44 +0200") Message-ID: <87ilyyus4u.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tobias Geerinckx-Rice skribis: > * nix/libstore/build.cc (pathFull): New function. > (DerivationGoal::buildDone): Use it. I=E2=80=99d call it =E2=80=98directoryFull=E2=80=99 or =E2=80=98partitionFu= ll=E2=80=99. Otherwise LGTM! Ludo=E2=80=99. From unknown Fri Jun 13 10:30:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50327] [PATCH 0/2] Improved =?UTF-8?Q?=E2=80=98free?= disk =?UTF-8?Q?space=E2=80=99?= message + a question Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 18 Sep 2021 09:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice Cc: 50327@debbugs.gnu.org Received: via spool by 50327-submit@debbugs.gnu.org id=B50327.163195892814711 (code B ref 50327); Sat, 18 Sep 2021 09:56:01 +0000 Received: (at 50327) by debbugs.gnu.org; 18 Sep 2021 09:55:28 +0000 Received: from localhost ([127.0.0.1]:33560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRX4C-0003pD-1H for submit@debbugs.gnu.org; Sat, 18 Sep 2021 05:55:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRX49-0003oy-Vo for 50327@debbugs.gnu.org; Sat, 18 Sep 2021 05:55:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48044) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRX44-0006cd-Ni; Sat, 18 Sep 2021 05:55:20 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35792 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRX3s-0008U4-SP; Sat, 18 Sep 2021 05:55:19 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <875yvkaymg.fsf@nckx> Date: Sat, 18 Sep 2021 11:55:06 +0200 In-Reply-To: <875yvkaymg.fsf@nckx> (Tobias Geerinckx-Rice's message of "Wed, 01 Sep 2021 21:05:42 +0200") Message-ID: <87ee9mus1x.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Tobias Geerinckx-Rice skribis: > This improves the warning given when free space looks sus. > > From: > > note: build failure may have been caused by lack of free disk space > > to: > > note: only 0.01 MiB available in =E2=80=98/gnu/store=E2=80=99 > note: only 5.00 MiB available in =E2=80=98/tmp/guix-build-foo.drv-0=E2= =80=99 > note: build failure may have been caused by lack of free disk space > > It also raises the warning threshold from 8 to 64 MiB, which is a much > prettier arbitrary integer. LGTM. :-) Eventually we should i18n messages coming from the daemon. > Question: shouldn't all of nix/ have licence headers added too? As it > stands, there are two very lonely ones in > nix/libstore/builtins.{cc,hh} and that's it. Yeah well, they were taken as-is from Nix. I wouldn=E2=80=99t bother, especially since we wouldn=E2=80=99t what copyright holders to list in ther= e. Thanks! Ludo=E2=80=99.