GNU bug report logs - #47989
[PATCH] channels: Add a #:system argument to channel-instances->manifest.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sat, 24 Apr 2021 08:15:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

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 47989 in the body.
You can then email your comments to 47989 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#47989; Package guix-patches. (Sat, 24 Apr 2021 08:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 24 Apr 2021 08:15:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Sat, 24 Apr 2021 09:14:02 +0100
This allows computing a manifest for a specific system. Previously this was
possible, but only through changing %current-system, which caused the
derivation to be computed using that system as well (so computing a derivation
for aarch64-linux on x86_64-linux would require running aarch64-linux code).

This new argument adds the possibility of computing derivations for non-native
systems, without having to run non-native code.

I'm looking at this as it will enable the Guix Data Service to compute channel
instance derivations without relying on QEMU emulation for non-native
systems (it should be faster as well).

* guix/channels.scm (build-from-source): Add #:system argument and pass to
build.
(build-channel-instance): Add system argument and pass to build-from-source.
(channel-instance-derivations): Add #:system argument and pass to
build-channel-instance, also rename system to current-system-value.
(channel-instances->manifest): Add #:system argument and pass to
channel-instance-derivations.
---
 guix/channels.scm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index c40fc0c507..70a09e74ff 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -657,7 +657,7 @@ that unconditionally resumes the continuation."
               store))))
 
 (define* (build-from-source instance
-                            #:key core verbose? (dependencies '()))
+                            #:key core verbose? (dependencies '()) system)
   "Return a derivation to build Guix from INSTANCE, using the self-build
 script contained therein.  When CORE is true, build package modules under
 SOURCE using CORE, an instance of Guix."
@@ -700,20 +700,22 @@ SOURCE using CORE, an instance of Guix."
           (with-trivial-build-handler
            (build source
                   #:verbose? verbose? #:version commit
+                  #:system system
                   #:channel-metadata (channel-instance->sexp instance)
                   #:pull-version %pull-version))))
 
       ;; Build a set of modules that extend Guix using the standard method.
       (standard-module-derivation name source core dependencies)))
 
-(define* (build-channel-instance instance
+(define* (build-channel-instance instance system
                                  #:optional core (dependencies '()))
   "Return, as a monadic value, the derivation for INSTANCE, a channel
 instance.  DEPENDENCIES is a list of extensions providing Guile modules that
 INSTANCE depends on."
   (build-from-source instance
                      #:core core
-                     #:dependencies dependencies))
+                     #:dependencies dependencies
+                     #:system system))
 
 (define (resolve-dependencies instances)
   "Return a procedure that, given one of the elements of INSTANCES, returns
@@ -743,7 +745,7 @@ list of instances it depends on."
   (lambda (instance)
     (vhash-foldq* cons '() instance edges)))
 
-(define (channel-instance-derivations instances)
+(define* (channel-instance-derivations instances #:key system)
   "Return the list of derivations to build INSTANCES, in the same order as
 INSTANCES."
   (define core-instance
@@ -757,14 +759,15 @@ INSTANCES."
     (resolve-dependencies instances))
 
   (define (instance->derivation instance)
-    (mlet %store-monad ((system (current-system)))
+    (mlet %store-monad ((current-system-value (current-system)))
       (mcached (if (eq? instance core-instance)
-                   (build-channel-instance instance)
+                   (build-channel-instance instance system)
                    (mlet %store-monad ((core (instance->derivation core-instance))
                                        (deps (mapm %store-monad instance->derivation
                                                    (edges instance))))
-                     (build-channel-instance instance core deps)))
+                     (build-channel-instance instance system core deps)))
                instance
+               current-system-value
                system)))
 
   (unless core-instance
@@ -865,7 +868,7 @@ derivation."
                     intro))))))
             '()))))
 
-(define (channel-instances->manifest instances)
+(define* (channel-instances->manifest instances #:key system)
   "Return a profile manifest with entries for all of INSTANCES, a list of
 channel instances."
   (define (instance->entry instance drv)
@@ -883,7 +886,8 @@ channel instances."
         (properties
          `((source ,(channel-instance->sexp instance)))))))
 
-  (mlet* %store-monad ((derivations (channel-instance-derivations instances))
+  (mlet* %store-monad ((derivations (channel-instance-derivations instances
+                                                                  #:system system))
                        (entries ->  (map instance->entry instances derivations)))
     (return (manifest entries))))
 
-- 
2.30.1





Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Mon, 03 May 2021 20:57:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Mon, 03 May 2021 22:56:31 +0200
Hi,

Christopher Baines <mail <at> cbaines.net> skribis:

> This allows computing a manifest for a specific system. Previously this was
> possible, but only through changing %current-system, which caused the
> derivation to be computed using that system as well (so computing a derivation
> for aarch64-linux on x86_64-linux would require running aarch64-linux code).

I remember discussing it, but I wonder if I was confused.

I think you can always do the equivalent of (say):

  guix time-machine -- build -s armhf-linux hello -d

… where Guix itself is built natively but it then computes a derivation
for a different architecture.

The equivalent code would be roughly:

  (let ((inferior (inferior-for-channels …)))
    (inferior-package-derivation store
                                 (car (lookup-inferior-packages inferior "hello"))
                                 "armhf-linux"))

Does that make sense?

(You may also want to turn off grafts in the inferior.)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Mon, 03 May 2021 21:36:01 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Mon, 03 May 2021 22:35:49 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Christopher Baines <mail <at> cbaines.net> skribis:
>
>> This allows computing a manifest for a specific system. Previously this was
>> possible, but only through changing %current-system, which caused the
>> derivation to be computed using that system as well (so computing a derivation
>> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>
> I remember discussing it, but I wonder if I was confused.
>
> I think you can always do the equivalent of (say):
>
>   guix time-machine -- build -s armhf-linux hello -d
>
> … where Guix itself is built natively but it then computes a derivation
> for a different architecture.
>
> The equivalent code would be roughly:
>
>   (let ((inferior (inferior-for-channels …)))
>     (inferior-package-derivation store
>                                  (car (lookup-inferior-packages inferior "hello"))
>                                  "armhf-linux"))
>
> Does that make sense?

Not really, this is just about manifests for channel instances, so
nothing to do with package derivations as far as I'm aware.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Tue, 04 May 2021 13:49:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Tue, 04 May 2021 15:48:21 +0200
Hi Christopher,

Christopher Baines <mail <at> cbaines.net> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Christopher Baines <mail <at> cbaines.net> skribis:
>>
>>> This allows computing a manifest for a specific system. Previously this was
>>> possible, but only through changing %current-system, which caused the
>>> derivation to be computed using that system as well (so computing a derivation
>>> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>>
>> I remember discussing it, but I wonder if I was confused.
>>
>> I think you can always do the equivalent of (say):
>>
>>   guix time-machine -- build -s armhf-linux hello -d
>>
>> … where Guix itself is built natively but it then computes a derivation
>> for a different architecture.
>>
>> The equivalent code would be roughly:
>>
>>   (let ((inferior (inferior-for-channels …)))
>>     (inferior-package-derivation store
>>                                  (car (lookup-inferior-packages inferior "hello"))
>>                                  "armhf-linux"))
>>
>> Does that make sense?
>
> Not really,

:-)

> this is just about manifests for channel instances, so nothing to do
> with package derivations as far as I'm aware.

I re-read your message and must have misunderstood.  It’s the derivation
of channel instances that you want for a given system, right?  (What’s
the use case though?)  In that case something along the lines of the
patch makes perfect sense.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Tue, 04 May 2021 13:53:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Tue, 04 May 2021 15:52:37 +0200
Christopher Baines <mail <at> cbaines.net> skribis:

> This allows computing a manifest for a specific system. Previously this was
> possible, but only through changing %current-system, which caused the
> derivation to be computed using that system as well (so computing a derivation
> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>
> This new argument adds the possibility of computing derivations for non-native
> systems, without having to run non-native code.
>
> I'm looking at this as it will enable the Guix Data Service to compute channel
> instance derivations without relying on QEMU emulation for non-native
> systems (it should be faster as well).
>
> * guix/channels.scm (build-from-source): Add #:system argument and pass to
> build.
> (build-channel-instance): Add system argument and pass to build-from-source.
> (channel-instance-derivations): Add #:system argument and pass to
> build-channel-instance, also rename system to current-system-value.
> (channel-instances->manifest): Add #:system argument and pass to
> channel-instance-derivations.

[...]

>  (define* (build-from-source instance
> -                            #:key core verbose? (dependencies '()))
> +                            #:key core verbose? (dependencies '()) system)
>    "Return a derivation to build Guix from INSTANCE, using the self-build
>  script contained therein.  When CORE is true, build package modules under
>  SOURCE using CORE, an instance of Guix."

Please mention SYSTEM in the docstring.

> +(define* (channel-instance-derivations instances #:key system)
>    "Return the list of derivations to build INSTANCES, in the same order as
>  INSTANCES."
>    (define core-instance
> @@ -757,14 +759,15 @@ INSTANCES."
>      (resolve-dependencies instances))
>  
>    (define (instance->derivation instance)
> -    (mlet %store-monad ((system (current-system)))
> +    (mlet %store-monad ((current-system-value (current-system)))
>        (mcached (if (eq? instance core-instance)
> -                   (build-channel-instance instance)
> +                   (build-channel-instance instance system)
>                     (mlet %store-monad ((core (instance->derivation core-instance))
>                                         (deps (mapm %store-monad instance->derivation
>                                                     (edges instance))))
> -                     (build-channel-instance instance core deps)))
> +                     (build-channel-instance instance system core deps)))
>                 instance
> +               current-system-value
>                 system)))

Here, there should not be any additional key to ‘mcached’ since there’s
only one system being targeted.

Instead, it should look something like this:

  (define (instance->derivation core-instance)
    (mlet %store-monad ((system (if system (return system) (current-system))))
      (mcached …         ;pass ‘system’ to callees
               instance
               system))) ;unchanged

HTH,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Wed, 05 May 2021 09:29:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Wed, 05 May 2021 10:28:31 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Christopher Baines <mail <at> cbaines.net> skribis:
>
>> Ludovic Courtès <ludo <at> gnu.org> writes:
>>
>>> Christopher Baines <mail <at> cbaines.net> skribis:
>>>
>>>> This allows computing a manifest for a specific system. Previously this was
>>>> possible, but only through changing %current-system, which caused the
>>>> derivation to be computed using that system as well (so computing a derivation
>>>> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>>>
>>> I remember discussing it, but I wonder if I was confused.
>>>
>>> I think you can always do the equivalent of (say):
>>>
>>>   guix time-machine -- build -s armhf-linux hello -d
>>>
>>> … where Guix itself is built natively but it then computes a derivation
>>> for a different architecture.
>>>
>>> The equivalent code would be roughly:
>>>
>>>   (let ((inferior (inferior-for-channels …)))
>>>     (inferior-package-derivation store
>>>                                  (car (lookup-inferior-packages inferior "hello"))
>>>                                  "armhf-linux"))
>>>
>>> Does that make sense?
>>
>> Not really,
>
> :-)
>
>> this is just about manifests for channel instances, so nothing to do
>> with package derivations as far as I'm aware.
>
> I re-read your message and must have misunderstood.  It’s the derivation
> of channel instances that you want for a given system, right?  (What’s
> the use case though?)  In that case something along the lines of the
> patch makes perfect sense.

Yep, the Guix Data Service currently uses channel-instances->manifest to
compute the channel instance derivations (which show up here for example
[1]. Currently it computes the derivations for different systems by
setting %current-system, but this has the side effect of also running
the Guile code for computing the derivation with Guile for that system.

1: https://data.guix.gnu.org/revision/afec2784174058fdd85d9698e1fa748c45bfa8ee/channel-instances

That effectively only works if QEMU binfmt support is available for
those other systems. It would be faster just to use the native Guile,
and this would also avoid substitute availability problems (I had to
disable armhf-linux emulation on the data.guix.gnu.org machine when the
substitute availability from ci.guix.gnu.org got worse recently as too
much time was being spent just building armhf-linux things).
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Wed, 05 May 2021 11:25:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: 47989 <at> debbugs.gnu.org
Subject: [PATCH v2] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Wed,  5 May 2021 12:24:19 +0100
This allows computing a manifest for a specific system. Previously this was
possible, but only through changing %current-system, which caused the
derivation to be computed using that system as well (so computing a derivation
for aarch64-linux on x86_64-linux would require running aarch64-linux code).

This new argument adds the possibility of computing derivations for non-native
systems, without having to run non-native code.

I'm looking at this as it will enable the Guix Data Service to compute channel
instance derivations without relying on QEMU emulation for non-native
systems (it should be faster as well).

* guix/channels.scm (build-from-source): Add #:system argument and pass to
build.
(build-channel-instance): Add system argument and pass to build-from-source.
(channel-instance-derivations): Add #:system argument and pass to
build-channel-instance, also rename system to current-system-value.
(channel-instances->manifest): Add #:system argument and pass to
channel-instance-derivations.
---
 guix/channels.scm | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index c40fc0c507..476d62e1f4 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -657,10 +657,11 @@ that unconditionally resumes the continuation."
               store))))
 
 (define* (build-from-source instance
-                            #:key core verbose? (dependencies '()))
+                            #:key core verbose? (dependencies '()) system)
   "Return a derivation to build Guix from INSTANCE, using the self-build
 script contained therein.  When CORE is true, build package modules under
-SOURCE using CORE, an instance of Guix."
+SOURCE using CORE, an instance of Guix.  By default, build for the current
+system, or SYSTEM if specified."
   (define name
     (symbol->string
      (channel-name (channel-instance-channel instance))))
@@ -700,20 +701,22 @@ SOURCE using CORE, an instance of Guix."
           (with-trivial-build-handler
            (build source
                   #:verbose? verbose? #:version commit
+                  #:system system
                   #:channel-metadata (channel-instance->sexp instance)
                   #:pull-version %pull-version))))
 
       ;; Build a set of modules that extend Guix using the standard method.
       (standard-module-derivation name source core dependencies)))
 
-(define* (build-channel-instance instance
+(define* (build-channel-instance instance system
                                  #:optional core (dependencies '()))
   "Return, as a monadic value, the derivation for INSTANCE, a channel
-instance.  DEPENDENCIES is a list of extensions providing Guile modules that
-INSTANCE depends on."
+instance, for SYSTEM.  DEPENDENCIES is a list of extensions providing Guile
+modules that INSTANCE depends on."
   (build-from-source instance
                      #:core core
-                     #:dependencies dependencies))
+                     #:dependencies dependencies
+                     #:system system))
 
 (define (resolve-dependencies instances)
   "Return a procedure that, given one of the elements of INSTANCES, returns
@@ -743,9 +746,9 @@ list of instances it depends on."
   (lambda (instance)
     (vhash-foldq* cons '() instance edges)))
 
-(define (channel-instance-derivations instances)
+(define* (channel-instance-derivations instances #:key system)
   "Return the list of derivations to build INSTANCES, in the same order as
-INSTANCES."
+INSTANCES.  Build for the current system by default, or SYSTEM if specified."
   (define core-instance
     ;; The 'guix' channel is treated specially: it's an implicit dependency of
     ;; all the other channels.
@@ -757,13 +760,13 @@ INSTANCES."
     (resolve-dependencies instances))
 
   (define (instance->derivation instance)
-    (mlet %store-monad ((system (current-system)))
+    (mlet %store-monad ((system (if system (return system) (current-system))))
       (mcached (if (eq? instance core-instance)
-                   (build-channel-instance instance)
+                   (build-channel-instance instance system)
                    (mlet %store-monad ((core (instance->derivation core-instance))
                                        (deps (mapm %store-monad instance->derivation
                                                    (edges instance))))
-                     (build-channel-instance instance core deps)))
+                     (build-channel-instance instance system core deps)))
                instance
                system)))
 
@@ -865,9 +868,10 @@ derivation."
                     intro))))))
             '()))))
 
-(define (channel-instances->manifest instances)
+(define* (channel-instances->manifest instances #:key system)
   "Return a profile manifest with entries for all of INSTANCES, a list of
-channel instances."
+channel instances.  By default, build for the current system, or SYSTEM if
+specified."
   (define (instance->entry instance drv)
     (let ((commit  (channel-instance-commit instance))
           (channel (channel-instance-channel instance)))
@@ -883,7 +887,8 @@ channel instances."
         (properties
          `((source ,(channel-instance->sexp instance)))))))
 
-  (mlet* %store-monad ((derivations (channel-instance-derivations instances))
+  (mlet* %store-monad ((derivations (channel-instance-derivations instances
+                                                                  #:system system))
                        (entries ->  (map instance->entry instances derivations)))
     (return (manifest entries))))
 
-- 
2.30.1





Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Wed, 05 May 2021 11:26:01 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Wed, 05 May 2021 12:25:11 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Christopher Baines <mail <at> cbaines.net> skribis:
>
>> This allows computing a manifest for a specific system. Previously this was
>> possible, but only through changing %current-system, which caused the
>> derivation to be computed using that system as well (so computing a derivation
>> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>>
>> This new argument adds the possibility of computing derivations for non-native
>> systems, without having to run non-native code.
>>
>> I'm looking at this as it will enable the Guix Data Service to compute channel
>> instance derivations without relying on QEMU emulation for non-native
>> systems (it should be faster as well).
>>
>> * guix/channels.scm (build-from-source): Add #:system argument and pass to
>> build.
>> (build-channel-instance): Add system argument and pass to build-from-source.
>> (channel-instance-derivations): Add #:system argument and pass to
>> build-channel-instance, also rename system to current-system-value.
>> (channel-instances->manifest): Add #:system argument and pass to
>> channel-instance-derivations.
>
> [...]
>
>>  (define* (build-from-source instance
>> -                            #:key core verbose? (dependencies '()))
>> +                            #:key core verbose? (dependencies '()) system)
>>    "Return a derivation to build Guix from INSTANCE, using the self-build
>>  script contained therein.  When CORE is true, build package modules under
>>  SOURCE using CORE, an instance of Guix."
>
> Please mention SYSTEM in the docstring.
>
>> +(define* (channel-instance-derivations instances #:key system)
>>    "Return the list of derivations to build INSTANCES, in the same order as
>>  INSTANCES."
>>    (define core-instance
>> @@ -757,14 +759,15 @@ INSTANCES."
>>      (resolve-dependencies instances))
>>
>>    (define (instance->derivation instance)
>> -    (mlet %store-monad ((system (current-system)))
>> +    (mlet %store-monad ((current-system-value (current-system)))
>>        (mcached (if (eq? instance core-instance)
>> -                   (build-channel-instance instance)
>> +                   (build-channel-instance instance system)
>>                     (mlet %store-monad ((core (instance->derivation core-instance))
>>                                         (deps (mapm %store-monad instance->derivation
>>                                                     (edges instance))))
>> -                     (build-channel-instance instance core deps)))
>> +                     (build-channel-instance instance system core deps)))
>>                 instance
>> +               current-system-value
>>                 system)))
>
> Here, there should not be any additional key to ‘mcached’ since there’s
> only one system being targeted.
>
> Instead, it should look something like this:
>
>   (define (instance->derivation core-instance)
>     (mlet %store-monad ((system (if system (return system) (current-system))))
>       (mcached …         ;pass ‘system’ to callees
>                instance
>                system))) ;unchanged

Sure, I've sent an updated patch that updates docstrings and makes the
above changes.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Tue, 11 May 2021 08:49:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Tue, 11 May 2021 10:48:35 +0200
Hi,

Christopher Baines <mail <at> cbaines.net> skribis:

> Yep, the Guix Data Service currently uses channel-instances->manifest to
> compute the channel instance derivations (which show up here for example
> [1]. Currently it computes the derivations for different systems by
> setting %current-system, but this has the side effect of also running
> the Guile code for computing the derivation with Guile for that system.
>
> 1: https://data.guix.gnu.org/revision/afec2784174058fdd85d9698e1fa748c45bfa8ee/channel-instances

I see, that’s because you explicitly want to channel derivations for
several systems in this case.  Got it!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#47989; Package guix-patches. (Tue, 11 May 2021 08:53:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 47989 <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Tue, 11 May 2021 10:52:02 +0200
Christopher Baines <mail <at> cbaines.net> skribis:

> This allows computing a manifest for a specific system. Previously this was
> possible, but only through changing %current-system, which caused the
> derivation to be computed using that system as well (so computing a derivation
> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>
> This new argument adds the possibility of computing derivations for non-native
> systems, without having to run non-native code.
>
> I'm looking at this as it will enable the Guix Data Service to compute channel
> instance derivations without relying on QEMU emulation for non-native
> systems (it should be faster as well).
>
> * guix/channels.scm (build-from-source): Add #:system argument and pass to
> build.
> (build-channel-instance): Add system argument and pass to build-from-source.
> (channel-instance-derivations): Add #:system argument and pass to
> build-channel-instance, also rename system to current-system-value.
> (channel-instances->manifest): Add #:system argument and pass to
> channel-instance-derivations.

LGTM!

(Please double-check that ‘make as-derivation’ or ‘guix pull --url=$PWD …’
work, in case we overlooked something.)

Thank you,
Ludo’.




Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Wed, 12 May 2021 08:54:02 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Wed, 12 May 2021 08:54:03 GMT) Full text and rfc822 format available.

Message #37 received at 47989-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47989-done <at> debbugs.gnu.org
Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to
 channel-instances->manifest.
Date: Wed, 12 May 2021 09:52:58 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Christopher Baines <mail <at> cbaines.net> skribis:
>
>> This allows computing a manifest for a specific system. Previously this was
>> possible, but only through changing %current-system, which caused the
>> derivation to be computed using that system as well (so computing a derivation
>> for aarch64-linux on x86_64-linux would require running aarch64-linux code).
>>
>> This new argument adds the possibility of computing derivations for non-native
>> systems, without having to run non-native code.
>>
>> I'm looking at this as it will enable the Guix Data Service to compute channel
>> instance derivations without relying on QEMU emulation for non-native
>> systems (it should be faster as well).
>>
>> * guix/channels.scm (build-from-source): Add #:system argument and pass to
>> build.
>> (build-channel-instance): Add system argument and pass to build-from-source.
>> (channel-instance-derivations): Add #:system argument and pass to
>> build-channel-instance, also rename system to current-system-value.
>> (channel-instances->manifest): Add #:system argument and pass to
>> channel-instance-derivations.
>
> LGTM!
>
> (Please double-check that ‘make as-derivation’ or ‘guix pull --url=$PWD …’
> work, in case we overlooked something.)

Great, I've pushed this as 34985fb6ae7deffd40443766f5408649a0cbbff2 now.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Jun 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 293 days ago.

Previous Next


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