GNU bug report logs - #75647
[PATCH 0/2] Optimize profile hooks to avoid unnecessary reruns.

Previous Next

Package: guix-patches;

Reported by: iyzsong <at> envs.net

Date: Sat, 18 Jan 2025 11:35:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: iyzsong <at> envs.net
To: 75647 <at> debbugs.gnu.org
Cc: 宋文武 <iyzsong <at> member.fsf.org>, Christopher Baines <guix <at> cbaines.net>, Josselin Poiret <dev <at> jpoiret.xyz>, Ludovic Courtès <ludo <at> gnu.org>, Mathieu Othacehe <othacehe <at> gnu.org>, Simon Tournier <zimon.toutoune <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: [bug#75647] [PATCH v2 1/2] profiles: Add #:build? argument to lower-manifest-entry.
Date: Sat, 18 Jan 2025 20:07:00 +0800
From: 宋文武 <iyzsong <at> member.fsf.org>

* guix/profiles.scm (lower-manifest-entry): Add #:build? keyword argument.

Change-Id: Ifb86d581156034897377f3614fac67b7748e0ec3
---
 guix/profiles.scm | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index a28cf872cf..0f47268541 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2013 Nikita Karetnikov <nikita <at> karetnikov.org>
 ;;; Copyright © 2014, 2016 Alex Kost <alezost <at> gmail.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw <at> netris.org>
-;;; Copyright © 2015 Sou Bunnbu <iyzsong <at> gmail.com>
+;;; Copyright © 2015, 2025 宋文武 <iyzsong <at> envs.net>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2021, 2022 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich <at> gmail.com>
 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas <at> gmail.com>
@@ -308,9 +308,10 @@ (define (manifest-entry-lookup manifest)
       ((_ . entry) entry)
       (#f          #f))))
 
-(define* (lower-manifest-entry entry system #:key target)
+(define* (lower-manifest-entry entry system #:key target
+                               (build? #f))
   "Lower ENTRY for SYSTEM and TARGET such that its 'item' field is a store
-file name."
+file name.  When BUILD? is true, build the entry before returning."
   (define (recurse entry)
     (mapm/accumulate-builds (lambda (entry)
                               (lower-manifest-entry entry system
@@ -319,12 +320,20 @@ (define* (lower-manifest-entry entry system #:key target)
 
   (let ((item (manifest-entry-item entry)))
     (if (string? item)
-        (with-monad %store-monad
+        (mbegin %store-monad
+          (build (list item))
+          (if build?
+              (build (list item))
+              (return #t))
           (return entry))
-        (mlet %store-monad ((drv (lower-object item system
+        (mlet* %store-monad ((drv (lower-object item system
                                                #:target target))
+
                             (dependencies (recurse entry))
-                            (output -> (manifest-entry-output entry)))
+                            (output -> (manifest-entry-output entry))
+                            (built (if build?
+                                       (built-derivations (list (cons drv output)))
+                                       (return #t))))
           (return (manifest-entry
                     (inherit entry)
                     (item (derivation->output-path drv output))

base-commit: 87045f0982bd7aebb07b380cbf322651227546f4
-- 
2.47.1





This bug report was last modified 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.