GNU bug report logs - #33519
[PATCH 0/4] Reporting grafts in the user interface

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Mon, 26 Nov 2018 21:44:02 UTC

Severity: normal

Tags: fixed, patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33519 in the body.
You can then email your comments to 33519 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Mon, 26 Nov 2018 21:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 26 Nov 2018 21:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: rekado <at> elephly.net, Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/4] Reporting grafts in the user interface
Date: Mon, 26 Nov 2018 22:43:06 +0100
Hello Guix!

These patches add UI hints so that grafting derivations can be
distinguished from more expensive derivations, as suggested by
Ricardo a while back.

The end result is something like this:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env  guix package -i libreoffice
The following package will be upgraded:
   libreoffice  6.1.3.2 → 6.1.3.2       /gnu/store/665s4yzjdih5hfyqj25hflxf838ddvhn-libreoffice-6.1.3.2

substitute: updating substitutes from 'https://berlin.guixsd.org'... 100.0%
substitute: updating substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/4007l9zq7aaagh3na9w9674z6mdsba0x-profile.drv
   /gnu/store/zlkrnrp83zn8zqm9zblx1a4dhqszp2p2-info-dir.drv
   /gnu/store/yrji9qkrsijvc8r67i0zqrjsgq0w7y61-glib-schemas.drv
   /gnu/store/ym5yani65vhq46mbnh09v4nj3xp6g9jz-xdg-desktop-database.drv
   /gnu/store/wrqgnm8ys59g5darnscx452vgj79hk7g-ca-certificate-bundle.drv
   /gnu/store/srxlcgzhilgy7gf08cdm05r3sbg7fhb8-gtk-icon-themes.drv
   /gnu/store/mh9lli57ji66k4vs9hspw59pfkjd12x8-fonts-dir.drv
   /gnu/store/fwg6dbirzpcpyn6vridb6acf7h8v8llx-gtk-im-modules.drv
   /gnu/store/29240dgzra7fgllk76jixafbzfzkaqh1-xdg-mime-database.drv
   /gnu/store/ag493qzyl9gghmpc1v24zx7f377qnara-manual-database.drv
129.4 MB will be downloaded:
   /gnu/store/y97qqcmkizk3vc9jfi52yn6r4x2s88nc-libreoffice-6.1.3.2
The following grafts will be made:
   /gnu/store/aa9fn1r87jq7j56nh5jpj94g81bsavzx-texinfo-6.5.drv
   /gnu/store/7s9q5h53j6jiig2z39xp3304z3fpfvk4-glib-2.56.0.drv
   /gnu/store/38a90nvqqvgwj44a7ygrc05f9rspnk5q-gtk+-3.22.30.drv
   […]
   /gnu/store/yz11x1glpgigflw0rwy6g1z1fk7lamx0-orcus-0.13.4.drv
   /gnu/store/4vysnvfh5010b91mvc30m81izg2x1vrr-libreoffice-6.1.3.2.drv
applying 1 graft for /gnu/store/7s9q5h53j6jiig2z39xp3304z3fpfvk4-glib-2.56.0.drv...
downloading from https://berlin.guixsd.org/nar/gzip/y97qqcmkizk3vc9jfi52yn6r4x2s88nc-libreoffice-6.1.3.2...
 libreoffice-6.1.3.2  123.4MiB          33.3MiB/s 00:04 [##################] 100.0%

applying 1 graft for /gnu/store/1w75n56p6sz9rlpqi7wdp4f6mzdxxscq-cyrus-sasl-2.1.26.drv...
applying 1 graft for /gnu/store/cckw8wfjgx78ppmxki8f9hsqyb9rljwi-dbus-glib-0.108.drv...
applying 1 graft for /gnu/store/habjnpc834xjmrjzzahld703cg6sxnf4-hunspell-1.6.2.drv...
applying 2 grafts for /gnu/store/68cldhib78yrw2az4jmbflpx8vkk95rd-gconf-3.2.6.drv...
applying 1 graft for /gnu/store/x2v583bsp0d2mp7bgc37amb0ga2am3bc-hyphen-2.8.8.drv...
applying 1 graft for /gnu/store/7albjprbwf9gynspvwy7caq6rmmvvg27-libcdr-0.1.4.drv...
applying 1 graft for /gnu/store/mkvhlm3663yanyzyl4xcx9kpmnaxi6x2-libfreehand-0.1.2.drv...
applying 1 graft for /gnu/store/6mk42x7awyyldpb05i4bpjl9pmyqjxfi-libwpg-0.3.2.drv...
applying 1 graft for /gnu/store/qgiqzsf6mw6cr302sbw5y0lz3vskcfwc-libxkbcommon-0.8.0.drv...
applying 3 grafts for /gnu/store/q0wcsn269hv5lc7fmr9wcc0b1z46zzhx-libxtst-1.2.3.drv...
applying 2 grafts for /gnu/store/9k2ppp34g4gagfqwnvrnc1w28qrvxnz2-libxv-1.0.11.drv...
applying 5 grafts for /gnu/store/dxzsf8k6dhpz88x18afxgfgr5y85ljq9-at-spi2-core-2.26.2.drv...
applying 6 grafts for /gnu/store/7q39bgqm87xikd5bjbp8zd99hf4mdm13-gst-plugins-base-1.14.2.drv...
applying 6 grafts for /gnu/store/xf7cnfzx6mm9qic3rnzabiif1c5q0wr1-at-spi2-atk-2.26.1.drv...
[…]
--8<---------------cut here---------------end--------------->8---

Overall this makes operations more transparent.  Advanced users
will know what this means, and hopefully others will notice that
grafting is a relatively fast operation and discover that it has to
do with security updates.

Thoughts?

Ludo’.

Ludovic Courtès (4):
  derivations: Add properties.
  grafts: Record metadata as derivation properties.
  status: Report grafting derivations specially.
  ui: 'show-what-to-build' reports grafts separately.

 doc/guix.texi         |  8 ++++++--
 guix/derivations.scm  | 30 +++++++++++++++++++++++++-----
 guix/gexp.scm         |  4 +++-
 guix/grafts.scm       |  7 ++++++-
 guix/status.scm       | 14 +++++++++++++-
 guix/ui.scm           | 26 +++++++++++++++++++++++---
 tests/derivations.scm | 10 ++++++++++
 tests/gexp.scm        | 10 +++++++++-
 tests/grafts.scm      | 13 ++++++++-----
 9 files changed, 103 insertions(+), 19 deletions(-)

-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Mon, 26 Nov 2018 21:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 33519 <at> debbugs.gnu.org
Cc: rekado <at> elephly.net, Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 3/4] status: Report grafting derivations specially.
Date: Mon, 26 Nov 2018 22:47:08 +0100
* guix/status.scm (print-build-event): In 'build-started' event handler,
check the properties of DRV and handle 'graft' derivations specially.
---
 guix/status.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/guix/status.scm b/guix/status.scm
index 2ceb56788a..868bfdca21 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -325,7 +325,19 @@ addition to build events."
     (display "\r" port))                          ;erase the spinner
   (match event
     (('build-started drv . _)
-     (format port (info (G_ "building ~a...")) drv)
+     (let ((properties (derivation-properties
+                        (read-derivation-from-file drv))))
+       (match (assq-ref properties 'type)
+         ('graft
+           (let ((count (match (assq-ref properties 'graft)
+                          (#f  0)
+                          (lst (or (assq-ref lst 'count) 0)))))
+             (format port (info (N_ "applying ~a graft for ~a..."
+                                    "applying ~a grafts for ~a..."
+                                    count))
+                     count drv)))
+         (_
+          (format port (info (G_ "building ~a...")) drv))))
      (newline port))
     (('build-succeeded drv . _)
      (when (or print-log? (not (extended-build-trace-supported?)))
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Mon, 26 Nov 2018 21:48:02 GMT) Full text and rfc822 format available.

Message #11 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 33519 <at> debbugs.gnu.org
Cc: rekado <at> elephly.net, Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/4] grafts: Record metadata as derivation properties.
Date: Mon, 26 Nov 2018 22:47:07 +0100
* guix/grafts.scm (graft-derivation/shallow): Pass #:properties to
'build-expression->derivation'.
* tests/grafts.scm ("graft-derivation, grafted item is a direct
dependency"): Check the value returned by 'derivation-properties'.
---
 guix/grafts.scm  |  7 ++++++-
 tests/grafts.scm | 13 ++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/guix/grafts.scm b/guix/grafts.scm
index 01e245d8eb..63f384555b 100644
--- a/guix/grafts.scm
+++ b/guix/grafts.scm
@@ -123,6 +123,10 @@ are not recursively applied to dependencies of DRV."
   (define add-label
     (cut cons "x" <>))
 
+  (define properties
+    `((type . graft)
+      (graft (count . ,(length grafts)))))
+
   (match grafts
     ((($ <graft> sources source-outputs targets target-outputs) ...)
      (let ((sources (zip sources source-outputs))
@@ -140,7 +144,8 @@ are not recursively applied to dependencies of DRV."
                                                 ,@(append (map add-label sources)
                                                           (map add-label targets)))
                                      #:outputs outputs
-                                     #:local-build? #t)))))
+                                     #:local-build? #t
+                                     #:properties properties)))))
 (define (item->deriver store item)
   "Return two values: the derivation that led to ITEM (a store item), and the
 name of the output of that derivation ITEM corresponds to (for example
diff --git a/tests/grafts.scm b/tests/grafts.scm
index abb074d628..f85f3c6913 100644
--- a/tests/grafts.scm
+++ b/tests/grafts.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,7 +51,8 @@
 
 (test-begin "grafts")
 
-(test-assert "graft-derivation, grafted item is a direct dependency"
+(test-equal "graft-derivation, grafted item is a direct dependency"
+  '((type . graft) (graft (count . 2)))
   (let* ((build `(begin
                    (mkdir %output)
                    (chdir %output)
@@ -76,14 +77,16 @@
                                             (origin %mkdir)
                                             (replacement two))))))
     (and (build-derivations %store (list grafted))
-         (let ((two     (derivation->output-path two))
-               (grafted (derivation->output-path grafted)))
+         (let ((properties (derivation-properties grafted))
+               (two        (derivation->output-path two))
+               (grafted    (derivation->output-path grafted)))
            (and (string=? (format #f "foo/~a/bar" two)
                           (call-with-input-file (string-append grafted "/text")
                             get-string-all))
                 (string=? (readlink (string-append grafted "/sh")) one)
                 (string=? (readlink (string-append grafted "/self"))
-                          grafted))))))
+                          grafted)
+                properties)))))
 
 (test-assert "graft-derivation, grafted item uses a different name"
   (let* ((build   `(begin
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Mon, 26 Nov 2018 21:48:02 GMT) Full text and rfc822 format available.

Message #14 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 33519 <at> debbugs.gnu.org
Cc: rekado <at> elephly.net, Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 4/4] ui: 'show-what-to-build' reports grafts separately.
Date: Mon, 26 Nov 2018 22:47:09 +0100
* guix/ui.scm (graft-derivation?): New procedure.
(show-what-to-build): Distinguish among BUILD derivations that match
'graft-derivation?'.  Report them separately.
---
 guix/ui.scm | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 96f403acf5..60636edac0 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -816,6 +816,12 @@ warning."
       (warning (G_ "at least ~,1h MB needed but only ~,1h MB available in ~a~%")
                (/ need 1e6) (/ free 1e6) directory))))
 
+(define (graft-derivation? drv)
+  "Return true if DRV is definitely a graft derivation, false otherwise."
+  (match (assq-ref (derivation-properties drv) 'type)
+    ('graft #t)
+    (_ #f)))
+
 (define* (show-what-to-build store drv
                              #:key dry-run? (use-substitutes? #t)
                              (mode (build-mode normal)))
@@ -865,7 +871,11 @@ report what is prerequisites are available for download."
                                           (append-map
                                            substitutable-references
                                            download))))
-                     download)))
+                     download))
+                ((graft build)
+                 (partition (compose graft-derivation?
+                                     read-derivation-from-file)
+                            build)))
     (define installed-size
       (reduce + 0 (map substitutable-nar-size download)))
 
@@ -898,7 +908,12 @@ report what is prerequisites are available for download."
                           "~:[The following files would be downloaded:~%~{   ~a~%~}~;~]"
                           (length download))
                       (null? download)
-                      (map substitutable-path download))))
+                      (map substitutable-path download)))
+          (format (current-error-port)
+                  (N_ "~:[The following graft would be made:~%~{   ~a~%~}~;~]"
+                      "~:[The following grafts would be made:~%~{   ~a~%~}~;~]"
+                      (length graft))
+                  (null? graft) graft))
         (begin
           (format (current-error-port)
                   (N_ "~:[The following derivation will be built:~%~{   ~a~%~}~;~]"
@@ -918,7 +933,12 @@ report what is prerequisites are available for download."
                           "~:[The following files will be downloaded:~%~{   ~a~%~}~;~]"
                           (length download))
                       (null? download)
-                      (map substitutable-path download)))))
+                      (map substitutable-path download)))
+          (format (current-error-port)
+                  (N_ "~:[The following graft will be made:~%~{   ~a~%~}~;~]"
+                      "~:[The following grafts will be made:~%~{   ~a~%~}~;~]"
+                      (length graft))
+                  (null? graft) graft)))
 
     (check-available-space installed-size)
 
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Mon, 26 Nov 2018 21:48:03 GMT) Full text and rfc822 format available.

Message #17 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 33519 <at> debbugs.gnu.org
Cc: rekado <at> elephly.net, Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 1/4] derivations: Add properties.
Date: Mon, 26 Nov 2018 22:47:06 +0100
* guix/derivations.scm (derivation): Add #:properties parameter.
[user+system-env-vars]: Honor it.
(derivation-properties): New procedure.
(build-expression->derivation): Add #:properties and pass it to
'derivation'.
* guix/gexp.scm (gexp->derivation): Likewise.
* tests/derivations.scm ("derivation-properties"): New test.
* tests/gexp.scm ("gexp->derivation properties"): New test.
* doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
---
 doc/guix.texi         |  8 ++++++--
 guix/derivations.scm  | 30 +++++++++++++++++++++++++-----
 guix/gexp.scm         |  4 +++-
 tests/derivations.scm | 10 ++++++++++
 tests/gexp.scm        | 10 +++++++++-
 5 files changed, 53 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 917a3e9d57..c040a8531a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5060,7 +5060,7 @@ a derivation is the @code{derivation} procedure:
   [#:system (%current-system)] [#:references-graphs #f] @
   [#:allowed-references #f] [#:disallowed-references #f] @
   [#:leaked-env-vars #f] [#:local-build? #f] @
-  [#:substitutable? #t]
+  [#:substitutable? #t] [#:properties '()]
 Build a derivation with the given arguments, and return the resulting
 @code{<derivation>} object.
 
@@ -5097,6 +5097,9 @@ When @var{substitutable?} is false, declare that substitutes of the
 derivation's output should not be used (@pxref{Substitutes}).  This is
 useful, for instance, when building packages that capture details of the
 host CPU instruction set.
+
+@var{properties} must be an association list describing ``properties'' of the
+derivation.  It is kept as-is, uninterpreted, in the derivation.
 @end deffn
 
 @noindent
@@ -5790,7 +5793,8 @@ information about monads.)
        [#:leaked-env-vars #f] @
        [#:script-name (string-append @var{name} "-builder")] @
        [#:deprecation-warnings #f] @
-       [#:local-build? #f] [#:substitutable? #t] [#:guile-for-build #f]
+       [#:local-build? #f] [#:substitutable? #t] @
+       [#:properties '()] [#:guile-for-build #f]
 Return a derivation @var{name} that runs @var{exp} (a gexp) with
 @var{guile-for-build} (a derivation) on @var{system}; @var{exp} is
 stored in a file called @var{script-name}.  When @var{target} is true,
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 7afecb10cc..f6176a78fd 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -80,6 +80,7 @@
             substitutable-derivation?
             substitution-oracle
             derivation-hash
+            derivation-properties
 
             read-derivation
             read-derivation-from-file
@@ -681,7 +682,8 @@ name of each input with that input's hash."
                      references-graphs
                      allowed-references disallowed-references
                      leaked-env-vars local-build?
-                     (substitutable? #t))
+                     (substitutable? #t)
+                     (properties '()))
   "Build a derivation with the given arguments, and return the resulting
 <derivation> object.  When HASH and HASH-ALGO are given, a
 fixed-output derivation is created---i.e., one whose result is known in
@@ -708,7 +710,10 @@ for offloading and should rather be built locally.  This is the case for small
 derivations where the costs of data transfers would outweigh the benefits.
 
 When SUBSTITUTABLE? is false, declare that substitutes of the derivation's
-output should not be used."
+output should not be used.
+
+PROPERTIES must be an association list describing \"properties\" of the
+derivation.  It is kept as-is, uninterpreted, in the derivation."
   (define (add-output-paths drv)
     ;; Return DRV with an actual store path for each of its output and the
     ;; corresponding environment variable.
@@ -763,6 +768,10 @@ output should not be used."
                             `(("impureEnvVars"
                                . ,(string-join leaked-env-vars)))
                             '())
+                      ,@(match properties
+                          (() '())
+                          (lst `(("guix properties"
+                                  . ,(object->string properties)))))
                       ,@env-vars)))
       (match references-graphs
         (((file . path) ...)
@@ -851,6 +860,14 @@ long-running processes that know what they're doing.  Use with care!"
   (invalidate-memoization! derivation-path->base16-hash)
   (hash-clear! %derivation-cache))
 
+(define derivation-properties
+  (mlambdaq (drv)
+    "Return the property alist associated with DRV."
+    (match (assoc "guix properties"
+                  (derivation-builder-environment-vars drv))
+      ((_ . str) (call-with-input-string str read))
+      (#f        '()))))
+
 (define* (map-derivation store drv mapping
                          #:key (system (%current-system)))
   "Given MAPPING, a list of pairs of derivations, return a derivation based on
@@ -1129,7 +1146,8 @@ they can refer to each other."
                                        references-graphs
                                        allowed-references
                                        disallowed-references
-                                       local-build? (substitutable? #t))
+                                       local-build? (substitutable? #t)
+                                       (properties '()))
   "Return a derivation that executes Scheme expression EXP as a builder
 for derivation NAME.  INPUTS must be a list of (NAME DRV-PATH SUB-DRV)
 tuples; when SUB-DRV is omitted, \"out\" is assumed.  MODULES is a list
@@ -1149,7 +1167,8 @@ EXP is built using GUILE-FOR-BUILD (a derivation).  When GUILE-FOR-BUILD is
 omitted or is #f, the value of the `%guile-for-build' fluid is used instead.
 
 See the `derivation' procedure for the meaning of REFERENCES-GRAPHS,
-ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUILD?, and SUBSTITUTABLE?."
+ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUILD?, SUBSTITUTABLE?,
+and PROPERTIES."
   (define guile-drv
     (or guile-for-build (%guile-for-build)))
 
@@ -1277,7 +1296,8 @@ ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUILD?, and SUBSTITUTABLE?."
                 #:allowed-references allowed-references
                 #:disallowed-references disallowed-references
                 #:local-build? local-build?
-                #:substitutable? substitutable?)))
+                #:substitutable? substitutable?
+                #:properties properties)))
 
 
 ;;;
diff --git a/guix/gexp.scm b/guix/gexp.scm
index f33fb198e4..786e378308 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -631,6 +631,7 @@ names and file names suitable for the #:allowed-references argument to
                            allowed-references disallowed-references
                            leaked-env-vars
                            local-build? (substitutable? #t)
+                           (properties '())
 
                            ;; TODO: This parameter is transitional; it's here
                            ;; to avoid a full rebuild.  Remove it on the next
@@ -800,7 +801,8 @@ The other arguments are as for 'derivation'."
                       #:disallowed-references disallowed
                       #:leaked-env-vars leaked-env-vars
                       #:local-build? local-build?
-                      #:substitutable? substitutable?))))
+                      #:substitutable? substitutable?
+                      #:properties properties))))
 
 (define* (gexp-inputs exp #:key native?)
   "Return the input list for EXP.  When NATIVE? is true, return only native
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 159a6971b3..5f294c1827 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -1132,6 +1132,16 @@
                                     ((p2 . _)
                                      (string<? p1 p2)))))))))))))
 
+(test-equal "derivation-properties"
+  (list '() '((type . test)))
+  (let ((drv1 (build-expression->derivation %store "bar"
+                                            '(mkdir %output)))
+        (drv2 (build-expression->derivation %store "foo"
+                                           '(mkdir %output)
+                                           #:properties '((type . test)))))
+    (list (derivation-properties drv1)
+          (derivation-properties drv2))))
+
 (test-equal "map-derivation"
   "hello"
   (let* ((joke (package-derivation %store guile-1.8))
diff --git a/tests/gexp.scm b/tests/gexp.scm
index ab60bdab68..7ae9201c81 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -476,7 +476,15 @@
     (return (and (string=? (readlink (string-append out "/foo")) guile)
                  (string=? (readlink out2) file)
                  (equal? refs (list (dirname (dirname guile))))
-                 (equal? refs2 (list file))))))
+                 (equal? refs2 (list file))
+                 (null? (derivation-properties drv))))))
+
+(test-assertm "gexp->derivation properties"
+  (mlet %store-monad ((drv (gexp->derivation "foo"
+                                             #~(mkdir #$output)
+                                             #:properties '((type . test)))))
+    (return (equal? '((type . test))
+                    (derivation-properties drv)))))
 
 (test-assertm "gexp->derivation vs. grafts"
   (mlet* %store-monad ((graft?  (set-grafting #f))
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Tue, 27 Nov 2018 07:51:01 GMT) Full text and rfc822 format available.

Message #20 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: rekado <at> elephly.net, 33519 <at> debbugs.gnu.org
Subject: Re: [bug#33519] [PATCH 0/4] Reporting grafts in the user interface
Date: Tue, 27 Nov 2018 08:50:56 +0100
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello Guix!
>
> These patches add UI hints so that grafting derivations can be
> distinguished from more expensive derivations, as suggested by
> Ricardo a while back.

[...]

> Overall this makes operations more transparent.  Advanced users
> will know what this means, and hopefully others will notice that
> grafting is a relatively fast operation and discover that it has to
> do with security updates.
>
> Thoughts?

This is awesome!  And I imagine it will allow to distinguish packages
and tests in Cuirass :-)




Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Tue, 27 Nov 2018 08:29:01 GMT) Full text and rfc822 format available.

Message #23 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Clément Lassieur <clement <at> lassieur.org>
Cc: rekado <at> elephly.net, 33519 <at> debbugs.gnu.org
Subject: Re: [bug#33519] [PATCH 0/4] Reporting grafts in the user interface
Date: Tue, 27 Nov 2018 09:27:34 +0100
Clément Lassieur <clement <at> lassieur.org> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Hello Guix!
>>
>> These patches add UI hints so that grafting derivations can be
>> distinguished from more expensive derivations, as suggested by
>> Ricardo a while back.
>
> [...]
>
>> Overall this makes operations more transparent.  Advanced users
>> will know what this means, and hopefully others will notice that
>> grafting is a relatively fast operation and discover that it has to
>> do with security updates.
>>
>> Thoughts?
>
> This is awesome!

Glad you like it.  :-)

> And I imagine it will allow to distinguish packages and tests in
> Cuirass :-)

It’s tempting to use properties for all sorts of things (like we could
distinguish profile hooks, too), so yes, we could do more of that, but I
feel we should not go too far either.  :-)

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Tue, 27 Nov 2018 08:52:01 GMT) Full text and rfc822 format available.

Message #26 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 33519 <at> debbugs.gnu.org
Subject: Re: [bug#33519] [PATCH 0/4] Reporting grafts in the user interface
Date: Tue, 27 Nov 2018 09:05:53 +0100
Clément Lassieur <clement <at> lassieur.org> writes:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Hello Guix!
>>
>> These patches add UI hints so that grafting derivations can be
>> distinguished from more expensive derivations, as suggested by
>> Ricardo a while back.
>
> [...]
>
>> Overall this makes operations more transparent.  Advanced users
>> will know what this means, and hopefully others will notice that
>> grafting is a relatively fast operation and discover that it has to
>> do with security updates.
>>
>> Thoughts?
>
> This is awesome!

I agree!  This looks great.

> And I imagine it will allow to distinguish packages
> and tests in Cuirass :-)

How would that work?

-- 
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Wed, 28 Nov 2018 09:42:02 GMT) Full text and rfc822 format available.

Message #29 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 33519 <at> debbugs.gnu.org,
 Clément Lassieur <clement <at> lassieur.org>
Subject: Re: [bug#33519] [PATCH 0/4] Reporting grafts in the user interface
Date: Wed, 28 Nov 2018 10:41:20 +0100
Pushed!

  d4aa147eec ui: 'show-what-to-build' reports grafts separately.
  af1f1c38fb status: Report grafting derivations specially.
  64fd1c01bc grafts: Record metadata as derivation properties.
  8856f409d1 derivations: Add properties.

Ludo’.




Added tag(s) fixed. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Wed, 28 Nov 2018 09:42:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 33519 <at> debbugs.gnu.org and Ludovic Courtès <ludo <at> gnu.org> Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Wed, 28 Nov 2018 09:42:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#33519; Package guix-patches. (Fri, 30 Nov 2018 11:57:03 GMT) Full text and rfc822 format available.

Message #36 received at 33519 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 33519 <at> debbugs.gnu.org
Subject: Re: [bug#33519] [PATCH 0/4] Reporting grafts in the user interface
Date: Fri, 30 Nov 2018 12:56:14 +0100
Ricardo Wurmus <rekado <at> elephly.net> writes:

> Clément Lassieur <clement <at> lassieur.org> writes:
>
>> Ludovic Courtès <ludo <at> gnu.org> writes:
>>
>>> Hello Guix!
>>>
>>> These patches add UI hints so that grafting derivations can be
>>> distinguished from more expensive derivations, as suggested by
>>> Ricardo a while back.
>>
>> [...]
>>
>>> Overall this makes operations more transparent.  Advanced users
>>> will know what this means, and hopefully others will notice that
>>> grafting is a relatively fast operation and discover that it has to
>>> do with security updates.
>>>
>>> Thoughts?
>>
>> This is awesome!
>
> I agree!  This looks great.
>
>> And I imagine it will allow to distinguish packages
>> and tests in Cuirass :-)
>
> How would that work?

As a way to link Cuirass packages to tools like hpcguix-web.  It's not a
priority though.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Dec 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 119 days ago.

Previous Next


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