all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] derivations: Make <derivation> record datatype immutable.
@ 2017-01-09 23:00 Mathieu Lirzin
  2017-01-09 23:00 ` [PATCH] git download: Remove redundant argument in 'gexp->derivation' call Mathieu Lirzin
  2017-01-10  8:32 ` [PATCH] derivations: Make <derivation> record datatype immutable Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Lirzin @ 2017-01-09 23:00 UTC (permalink / raw)
  To: guix-devel

* guix/derivations.scm (<derivation>): Make it immutable.
(derivation): Use generic 'set-field' instead of ad-hoc functional setter.
---
 guix/derivations.scm | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index d5e4b5730..b712c508e 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017 Mathieu Lirzin <mthl@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -120,7 +121,7 @@
 ;;; Nix derivations, as implemented in Nix's `derivations.cc'.
 ;;;
 
-(define-record-type <derivation>
+(define-immutable-record-type <derivation>
   (make-derivation outputs inputs sources system builder args env-vars
                    file-name)
   derivation?
@@ -817,14 +818,6 @@ output should not be used."
             e
             outputs)))
 
-  (define (set-file-name drv file)
-    ;; Set FILE as the 'file-name' field of DRV.
-    (match drv
-      (($ <derivation> outputs inputs sources system builder
-          args env-vars)
-       (make-derivation outputs inputs sources system builder
-                        args env-vars file))))
-
   (define input->derivation-input
     (match-lambda
       (((? derivation? drv))
@@ -872,9 +865,9 @@ output should not be used."
     (let* ((file (add-text-to-store store (string-append name ".drv")
                                     (derivation->string drv)
                                     (map derivation-input-path inputs)))
-           (drv  (set-file-name drv file)))
-      (hash-set! %derivation-cache file drv)
-      drv)))
+           (drv* (set-field drv (derivation-file-name) file)))
+      (hash-set! %derivation-cache file drv*)
+      drv*)))
 
 (define* (map-derivation store drv mapping
                          #:key (system (%current-system)))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] git download: Remove redundant argument in 'gexp->derivation' call.
  2017-01-09 23:00 [PATCH] derivations: Make <derivation> record datatype immutable Mathieu Lirzin
@ 2017-01-09 23:00 ` Mathieu Lirzin
  2017-01-10  8:32   ` Ludovic Courtès
  2017-01-10  8:32 ` [PATCH] derivations: Make <derivation> record datatype immutable Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Mathieu Lirzin @ 2017-01-09 23:00 UTC (permalink / raw)
  To: guix-devel

* guix/git-download.scm (git-fetch): Call 'gexp->derivation' with only one
'#:local-build?' keyword argument.
---
 guix/git-download.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/guix/git-download.scm b/guix/git-download.scm
index fca44f552..62e625c71 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -109,8 +109,7 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
                       #:hash-algo hash-algo
                       #:hash hash
                       #:recursive? #t
-                      #:guile-for-build guile
-                      #:local-build? #t)))
+                      #:guile-for-build guile)))
 
 (define (git-version version revision commit)
   "Return the version string for packages using git-download."
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] derivations: Make <derivation> record datatype immutable.
  2017-01-09 23:00 [PATCH] derivations: Make <derivation> record datatype immutable Mathieu Lirzin
  2017-01-09 23:00 ` [PATCH] git download: Remove redundant argument in 'gexp->derivation' call Mathieu Lirzin
@ 2017-01-10  8:32 ` Ludovic Courtès
  2017-01-11 18:09   ` Mathieu Lirzin
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-01-10  8:32 UTC (permalink / raw)
  To: Mathieu Lirzin; +Cc: guix-devel

Mathieu Lirzin <mthl@gnu.org> skribis:

> * guix/derivations.scm (<derivation>): Make it immutable.
> (derivation): Use generic 'set-field' instead of ad-hoc functional setter.

LGTM, thanks!

Ludo'.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git download: Remove redundant argument in 'gexp->derivation' call.
  2017-01-09 23:00 ` [PATCH] git download: Remove redundant argument in 'gexp->derivation' call Mathieu Lirzin
@ 2017-01-10  8:32   ` Ludovic Courtès
  2017-01-11 18:10     ` Mathieu Lirzin
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-01-10  8:32 UTC (permalink / raw)
  To: Mathieu Lirzin; +Cc: guix-devel

Mathieu Lirzin <mthl@gnu.org> skribis:

> * guix/git-download.scm (git-fetch): Call 'gexp->derivation' with only one
> '#:local-build?' keyword argument.

Good catch!  Thanks,
Ludo'.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] derivations: Make <derivation> record datatype immutable.
  2017-01-10  8:32 ` [PATCH] derivations: Make <derivation> record datatype immutable Ludovic Courtès
@ 2017-01-11 18:09   ` Mathieu Lirzin
  0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Lirzin @ 2017-01-11 18:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Mathieu Lirzin <mthl@gnu.org> skribis:
>
>> * guix/derivations.scm (<derivation>): Make it immutable.
>> (derivation): Use generic 'set-field' instead of ad-hoc functional setter.
>
> LGTM, thanks!
>
> Ludo'.

Pushed in commit dc673fa1131fb5d1e5ca29acb4a693cfb906986f.

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git download: Remove redundant argument in 'gexp->derivation' call.
  2017-01-10  8:32   ` Ludovic Courtès
@ 2017-01-11 18:10     ` Mathieu Lirzin
  0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Lirzin @ 2017-01-11 18:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Mathieu Lirzin <mthl@gnu.org> skribis:
>
>> * guix/git-download.scm (git-fetch): Call 'gexp->derivation' with only one
>> '#:local-build?' keyword argument.
>
> Good catch!  Thanks,
> Ludo'.

Pushed in commit 5c6a30c5119ffd5702c02e07e7f04669a8f225bb.

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-11 18:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-09 23:00 [PATCH] derivations: Make <derivation> record datatype immutable Mathieu Lirzin
2017-01-09 23:00 ` [PATCH] git download: Remove redundant argument in 'gexp->derivation' call Mathieu Lirzin
2017-01-10  8:32   ` Ludovic Courtès
2017-01-11 18:10     ` Mathieu Lirzin
2017-01-10  8:32 ` [PATCH] derivations: Make <derivation> record datatype immutable Ludovic Courtès
2017-01-11 18:09   ` Mathieu Lirzin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.