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)