From patchwork Wed Apr 9 14:23:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41497 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 20DD427BC4D; Wed, 9 Apr 2025 15:24:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3E4DA27BC4A for ; Wed, 9 Apr 2025 15:24:37 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2WLi-0003hY-5F; Wed, 09 Apr 2025 10:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLW-0003cJ-D9 for guix-patches@gnu.org; Wed, 09 Apr 2025 10:24:11 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2WLW-0002q6-0D; Wed, 09 Apr 2025 10:24:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Q/Ab67I5C3aE19soHcWl7rJqJU9p3eqirmYrVfEQqVM=; b=KUbASUbtIOGp8OUaqlUw6pZuVxRfcY1Ngab6tsT2UsfpELtUA82Sm/Nuuqqb5bADH2z0zxX4Q4KRd37EHBCohThRcKAhy5o3B6UpG1E0jUgUfpj4eZqSS4laChrppoD1SJNPlCywrlbDv00LQGdr9CDrdIcSVEvJnQHLVksgTtwm/Igf/hAKKD1Jpu/zfFcqeXR65bPIxR+VjFLpnalslPwzyKkRkC3R4RY7wvi0npOrdRKEyUDtV0dkVibblHzJV2JOpVssNPdBRSEm5C4XaqG7KuXmRsYGZKnf+vsilcEvS1WHUFEPwj/WlJnezkuFGME5o6AF+ahBx9QZzCL2CA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u2WLV-0007TQ-3n; Wed, 09 Apr 2025 10:24:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77680] [PATCH 1/4] cache: Remove unused import. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 09 Apr 2025 14:24:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77680@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77680-submit@debbugs.gnu.org id=B77680.174420864128700 (code B ref 77680); Wed, 09 Apr 2025 14:24:05 +0000 Received: (at 77680) by debbugs.gnu.org; 9 Apr 2025 14:24:01 +0000 Received: from localhost ([127.0.0.1]:40914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2WLN-0007Sg-Tg for submit@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54602) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2WLK-0007SH-Qi for 77680@debbugs.gnu.org; Wed, 09 Apr 2025 10:23:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLE-0002n8-UF; Wed, 09 Apr 2025 10:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Q/Ab67I5C3aE19soHcWl7rJqJU9p3eqirmYrVfEQqVM=; b=KkyGmWEckP39aNlmlxPj mB3N3MSb6wjRodgfJslnWofY+GTII1YAOAKmDJO7OuCxmQARxt8VyvUZiy23jU0VKH3DHHWxDMyjl l0W8P3GTWR0fRWiMxxp96h2T+d0Y3OUmwASnZ0lcX8LK1GJ28sTOwpLk0AIBdoBQJg/2WFgU4A1/j /j15uQ4LcHQWemZAM790hDqU51aA63y0CExR1dADiofKNl3OjJrD7CLHo25++i/Hyeh0OeB9fJ6Oa yHsFsmo19PF+dz0VpiKYTKsOjdVAdTrDKtA4ULV4z/by+yzxdQeOjLMJJPn0+eBb3RUOoslJgriw2 WYvfiEEm8C64Fw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 9 Apr 2025 16:23:36 +0200 Message-ID: <3ff0009f0332d9b28191de3a986b0dbc26330221.1744208418.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/cache.scm: Remove unused import. Change-Id: I06956534aa5342a084ebf71b61518c515ce9288c --- guix/cache.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/guix/cache.scm b/guix/cache.scm index 8b12312c77..5d8a0edbaa 100644 --- a/guix/cache.scm +++ b/guix/cache.scm @@ -18,7 +18,6 @@ ;;; along with GNU Guix. If not, see . (define-module (guix cache) - #:use-module ((guix utils) #:select (with-atomic-file-output)) #:autoload (guix build syscalls) (lock-file unlock-file) #:use-module (srfi srfi-19) #:use-module (srfi srfi-26) From patchwork Wed Apr 9 14:23:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41498 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B1AE027BC49; Wed, 9 Apr 2025 15:24:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3EDAD27BC4B for ; Wed, 9 Apr 2025 15:24:37 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2WLh-0003hN-JI; Wed, 09 Apr 2025 10:24:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLX-0003cM-1l for guix-patches@gnu.org; Wed, 09 Apr 2025 10:24:11 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2WLW-0002qO-LJ; Wed, 09 Apr 2025 10:24:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=aGeG7j1Bmh1K9z0mhsJ66S4LuOy7cbMuuYtHZrDZ4qI=; b=nNc3KL2j6eXUY8s8k94g4nXtMnQHp7gAgujVbhlrGztYz2QDPLMvi2zVMsqClNJjq8dTnDPxW+zD2WGVn06Fr+a4BJ2ciMnm0KLoQ05p1IEogCQgWX1HgP0aX2LUjxohkrcIIH2RhFLJxAk7eLAbMjb1mvw8nJI7IBTd/GHFEUROmCOhUNOd93a69oev/LH00CJ7SjmbUC2y8rg0I0Nq2P+Lw4o1altjPl7X6X8Uw2DQAq6CmeE7dw4Wo/awr1f4MvOaejoAhGqvTtY3n7QTLx2SEOlZsUzzLS0vzwqPun8lS/lflAUJeyNHGT1GPprTV15Pfjnq1b9tW4tzZUAMXw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u2WLV-0007TY-No; Wed, 09 Apr 2025 10:24:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77680] [PATCH 2/4] utils: Add #:sync? parameter to =?utf-8?b?4oCYd2l0aC1hdG9taWMtZmlsZS1vdXRwdXTigJku?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 09 Apr 2025 14:24:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77680@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77680-submit@debbugs.gnu.org id=B77680.174420864328716 (code B ref 77680); Wed, 09 Apr 2025 14:24:05 +0000 Received: (at 77680) by debbugs.gnu.org; 9 Apr 2025 14:24:03 +0000 Received: from localhost ([127.0.0.1]:40916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2WLR-0007Ss-6m for submit@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51656) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2WLL-0007SK-Si for 77680@debbugs.gnu.org; Wed, 09 Apr 2025 10:23:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLG-0002o5-Ht; Wed, 09 Apr 2025 10:23:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=aGeG7j1Bmh1K9z0mhsJ66S4LuOy7cbMuuYtHZrDZ4qI=; b=MJ1DL1H7+txCwONAk5aX aRkDmkTreGMPgyJMnT5eNMTPI5FgjGeOgjCnnzMTJqE8rohIVpbqHgK5OqFf2m6LIefiCkp3EJaSw uHBLGJDzTDi05/OOpib2ixPA+SBXtCK+EqivaRE0wM31nllAo5wozzrWLaVVh/sKhY+QIP/9jUGu8 uu+hE1dFMqal4TJz4r9jf91wpz/aTHD2rgvbnGrSHmkaTSeQmhT/S4XXVSN9NMF6//fmQJxsuJRhx HOtojnONCLwNzTgjGAudo7pYIgLy4E5zR+h9Mk38aNKGVhuZilsu8vqOY6k9HjUNTg+gCL3+RAFCB 7pzH4oOCbHV29g==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 9 Apr 2025 16:23:37 +0200 Message-ID: <0b4f5c1d6e1be1ed563be7aca347817f725a6b10.1744208418.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/utils.scm (with-atomic-file-output): Add #:sync? and honor it. Add ‘force-output’ call. Change-Id: I2479778ae55360c0fab3389ac9249045a27b3568 --- guix/utils.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/guix/utils.scm b/guix/utils.scm index c7c23d9d5b..7ae98096c2 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2022, 2024 Ludovic Courtès +;;; Copyright © 2012-2022, 2024-2025 Ludovic Courtès ;;; Copyright © 2013, 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014 Ian Denhardt @@ -1057,16 +1057,22 @@ (define (call-with-temporary-directory proc) (lambda () (false-if-exception (delete-file-recursively tmp-dir)))))) -(define (with-atomic-file-output file proc) +(define* (with-atomic-file-output file proc #:key (sync? #t)) "Call PROC with an output port for the file that is going to replace FILE. Upon success, FILE is atomically replaced by what has been written to the -output port, and PROC's result is returned." +output port, and PROC's result is returned. + +When SYNC? is true, call 'fdatasync' on the temporary file before renaming it +to FILE; set it to #false for caches and temporary files to improve +performance." (let* ((template (string-append file ".XXXXXX")) (out (mkstemp! template))) (with-throw-handler #t (lambda () (let ((result (proc out))) - (fdatasync out) + (when sync? + (force-output out) + (fdatasync out)) (close-port out) (rename-file template file) result)) From patchwork Wed Apr 9 14:23:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41499 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 16FAA27BC4B; Wed, 9 Apr 2025 15:25:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BE8E627BC49 for ; Wed, 9 Apr 2025 15:25:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2WMd-0004Bn-90; Wed, 09 Apr 2025 10:25:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WMT-00047C-0O for guix-patches@gnu.org; Wed, 09 Apr 2025 10:25:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2WMR-0002zB-Ui; Wed, 09 Apr 2025 10:25:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=rhI9CwQ2rXZA7G2pqrpoNcM35bWjAz2JiDILrj36Odg=; b=MbEpU/IKznNj4ujmhTjVNY1Qbd8WNXmQhoHOYNX148YwhUtlICgejXY4kj6BcCQomi6WgVapEnbzGuINxbFEA6G5OPfHbezIwECZGSO32ytIJO9GH7oaXqvjVaqhp8lxf6p4UWzg6Tz0UI6gjX+F7ROblUZ8VzynVpAMoWcne8LT25zjYYxlW4xCbkhJy+AYpsciVXL8RyWvoMFvHUVY6MbQuLYhCC1U+DxXA1CjSaVqHjMSoKX1d6wTo+0vonhKPLBjnYdbsDFLu5ZnXF8WIYbqOKl9qA9EtVZp3yroU2uJ9SK3jxeF2KNtGeWn45HZRlgbCOIf60HxnKGBjTthrA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u2WMQ-0007WU-AF; Wed, 09 Apr 2025 10:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77680] [PATCH 3/4] substitutes: Ignore corrupt cached narinfos. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 09 Apr 2025 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77680@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77680-submit@debbugs.gnu.org id=B77680.174420866028809 (code B ref 77680); Wed, 09 Apr 2025 14:25:02 +0000 Received: (at 77680) by debbugs.gnu.org; 9 Apr 2025 14:24:20 +0000 Received: from localhost ([127.0.0.1]:40933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2WLk-0007Ua-DL for submit@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46216) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2WLh-0007UF-Ns for 77680@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLc-0002rN-9i; Wed, 09 Apr 2025 10:24:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=rhI9CwQ2rXZA7G2pqrpoNcM35bWjAz2JiDILrj36Odg=; b=MZSZsNnd5TStxyaisKXK WSbzXFdrRBFUtFlGT9Xz4yRM1BG/SdxPjRwk0++uJgUPti8xEH5Vueevqpu0cT67ewDFwpyyVnOi/ 9A0V3wGAK/eMMJqF4b5EiYtksRtPDi1uew64kL8qe81psziiyyu2Dd9czlFk2GEfuSF6jn3ziGPdE 0Or8UgvMJKMSMSCCfiXpNJhes3XQauIbyOskFYfhMdkwTDe70kFSGIJ8gwmgfW+rLScOIGhLONDlq rNwkVmAfGLKX1DxPvj2UzkFPXvFa090z7/hhUZ82dB8vmIryOb4aQmW1nOUFHcUt8d7pV+dDpP2Sr 8iW/ScCoERWGJA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 9 Apr 2025 16:23:39 +0200 Message-ID: <2774fbdd96e93995194d5f56bc3d328dc5905326.1744208418.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/substitutes.scm (cached-narinfo): Wrap ‘read’ call in ‘false-if-exception’. Add catch-all ‘match’ clause. Change-Id: I2d776f64b6521f778b4ab3f956b35cdef2ddb383 --- guix/substitutes.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/substitutes.scm b/guix/substitutes.scm index 86b9f5472a..45c165e03e 100644 --- a/guix/substitutes.scm +++ b/guix/substitutes.scm @@ -300,7 +300,7 @@ (define (cached-narinfo cache-url path) (lambda () (call-with-input-file cache-file (lambda (p) - (match (read p) + (match (false-if-exception (read p)) (('narinfo ('version 2) ('cache-uri cache-uri) ('date date) ('ttl ttl) ('value #f)) @@ -315,7 +315,8 @@ (define (cached-narinfo cache-url path) (if (obsolete? date now ttl) (values #f #f) (values #t (string->narinfo value cache-uri)))) - (('narinfo ('version v) _ ...) + (_ + ;; Corrupt or incompatible cached entry. (values #f #f)))))) (lambda _ (values #f #f)))) From patchwork Wed Apr 9 14:23:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41500 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8506F27BC4A; Wed, 9 Apr 2025 15:25:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2213527BC49 for ; Wed, 9 Apr 2025 15:25:28 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2WMi-0004D6-KS; Wed, 09 Apr 2025 10:25:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WMT-00047S-Or for guix-patches@gnu.org; Wed, 09 Apr 2025 10:25:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2WMT-000324-0Z; Wed, 09 Apr 2025 10:25:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ouRxti9NXZfHmqYVd1tC9kAwXFEbokPZzUgA5jlW6Og=; b=CyhmEQgLbEbduVkyaiu22/ThBgccN2EU4zUuzWPaox9XQuxCW9sUjdzUMIWO/i9CNxirj1vhFsWw8oFjdSODvQUMRkjygxjfbQDmvqy0yN4QrfdnIquQDbQC8xY6uMtsREaxU5zROlc9DoJLywxT6T4bWXgClucxqGFAEpeac3xFDXDrVJUwh2q73ZE//8D5Koi8a/iIpS+SzZM/zao42l+3e8ghUyFgpBjc0kTiD7xZcaKD0UwWHFWrUgTBY1ZWjqaaeokd8ccnxiqusEHOzotFcIZMSnaC8uEkxLZwwhEPHgIgHB3g1kKLxM+GFBt0N+0B1q5XPaT8rAOT4VnEQg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u2WMQ-0007We-SX; Wed, 09 Apr 2025 10:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77680] [PATCH 4/4] guix: Avoid =?utf-8?b?4oCYZmRhdGFzeW5j4oCZ?= call for caches and regular files. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 09 Apr 2025 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77680@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77680-submit@debbugs.gnu.org id=B77680.174420866828838 (code B ref 77680); Wed, 09 Apr 2025 14:25:02 +0000 Received: (at 77680) by debbugs.gnu.org; 9 Apr 2025 14:24:28 +0000 Received: from localhost ([127.0.0.1]:40937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2WLq-0007V2-Ss for submit@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46218) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2WLn-0007UX-FO for 77680@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLh-0002sO-WC; Wed, 09 Apr 2025 10:24:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ouRxti9NXZfHmqYVd1tC9kAwXFEbokPZzUgA5jlW6Og=; b=bmRnynJ4h+ZN0NZlOZGz RtpT4e0F7zqSRD9TQzsCRX6AqU5zyh1E+KbAMWy1GfV2lrC5kgQL4aoS8sZzTmoF0QFQF6msWRWm0 o0ufXBk2/Yz+sb/jG10omBIwzxhWTOweJNZD9HJwPCUxex2EYoAoIFSCmZaOngRXpxEHz2mzfD72u PvyUc2BzG5Axk7+ddwBJllNYyO/GMtoIZHWGoc1isMbTFoJ8jgBCrhUAC0NgT+bqglEBl8Eg83kuN eAg3eCKHX3gPOt/T3t+PwIU6MGUVqyTqow3tfaMD9tYUcEEVnJXGhw7zEzV/UdlC1IpH4Tu5DNapp X8sGzxWASMBHZQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 9 Apr 2025 16:23:40 +0200 Message-ID: <812224bace6510526d09f6cf661bc147ef157c92.1744208418.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Fixes . Calling ‘fdatasync’ for each and every narinfo file created by ‘guix substitute’ proved to be too expensive on spinning HDDs and/or under load (from 0.1s to 1.3s for the ‘fdatasync’ call alone). * guix/git-authenticate.scm (cache-authenticated-commit): Pass #:sync? #f. * guix/http-client.scm (http-fetch/cached): Likewise. * guix/scripts/discover.scm (write-publish-file): Likewise. * guix/scripts/style.scm (format-whole-file): Likewise. * guix/substitutes.scm (cache-narinfo!): Likewise. Reported-by: Christopher Baines Change-Id: I82297eae737bc5aae8a3f7604119e9f3d4b625bf --- guix/git-authenticate.scm | 5 +++-- guix/http-client.scm | 5 +++-- guix/scripts/discover.scm | 3 ++- guix/scripts/style.scm | 5 +++-- guix/substitutes.scm | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/guix/git-authenticate.scm b/guix/git-authenticate.scm index 37c69d0880..3cd1175c32 100644 --- a/guix/git-authenticate.scm +++ b/guix/git-authenticate.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019, 2020, 2021, 2022 Ludovic Courtès +;;; Copyright © 2019-2022, 2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -344,7 +344,8 @@ (define (cache-authenticated-commit key commit-id) (chmod port #o600) (display ";; List of previously-authenticated commits.\n\n" port) - (pretty-print lst port)))))) + (pretty-print lst port))) + #:sync? #f))) ;;; diff --git a/guix/http-client.scm b/guix/http-client.scm index 9138a627ac..4e0cc59e91 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2018, 2020-2022 Ludovic Courtès +;;; Copyright © 2012-2018, 2020-2022, 2025 Ludovic Courtès ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2012, 2015 Free Software Foundation, Inc. ;;; Copyright © 2017 Tobias Geerinckx-Rice @@ -346,7 +346,8 @@ (define* (http-fetch/cached uri #:key (ttl (%http-cache-ttl)) text? (when cache-port (close-port cache-port)) (with-atomic-file-output file - (cut write-cache port <>)) + (cut write-cache port <>) + #:sync? #f) (close-port port) (open-input-file file)))) diff --git a/guix/scripts/discover.scm b/guix/scripts/discover.scm index 32bf6085a5..cbe01638f5 100644 --- a/guix/scripts/discover.scm +++ b/guix/scripts/discover.scm @@ -87,7 +87,8 @@ (define* (write-publish-file #:key (file (%publish-file))) (format port "http://~a:~a~%" (avahi-service-address service) (avahi-service-port service))) - %publish-services))) + %publish-services)) + #:sync? #f) (chmod file #o644)) (define* (read-substitute-urls #:key (file (%publish-file))) diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm index 4801529f7e..c45bdd4458 100644 --- a/guix/scripts/style.scm +++ b/guix/scripts/style.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021-2024 Ludovic Courtès +;;; Copyright © 2021-2025 Ludovic Courtès ;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. @@ -554,7 +554,8 @@ (define* (format-whole-file file order? #:rest rest) (apply pretty-print-with-comments/splice port lst #:format-comment canonicalize-comment #:format-vertical-space canonicalize-vertical-space - rest)))))) + rest)) + #:sync? #f)))) ;;; diff --git a/guix/substitutes.scm b/guix/substitutes.scm index 45c165e03e..44d666f851 100644 --- a/guix/substitutes.scm +++ b/guix/substitutes.scm @@ -127,7 +127,8 @@ (define (cache-narinfo! cache-url path narinfo ttl) (mkdir-p (dirname file)) (with-atomic-file-output file (lambda (out) - (write (cache-entry cache-url narinfo) out)))) + (write (cache-entry cache-url narinfo) out)) + #:sync? #f)) narinfo)