diff mbox series

[bug#41785,v4] services: Add 'hurd-in-vm service-type'.

Message ID 875zbtk5l8.fsf@gnu.org
State Accepted
Headers show
Series [bug#41785,v4] services: Add 'hurd-in-vm service-type'. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Mathieu Othacehe June 14, 2020, 3:52 p.m. UTC
> (define (hurd-multiboot-modules os)
> ...
>          (libc (if target
>                    (with-parameters ((%current-target-system #f))
>                      ;; TODO: cross-libc has extra patches for the Hurd;
>                      ;; remove in next rebuild cycle
>                      (cross-libc target))
>                    glibc))
>
> we take the ELSE branch here -- and that does not work.  AIUI, this is
> really a temporary kludge until the next rebuild cycle we can move some
> hurd-specific glibc patches from cross-libc to glibc-proper.

Oh, I know why! In "system-image", there are a few calls, in the first
let, that are outside the "with-parameters", in particular "bootcfg"
which triggers the problem you are describing above.

Maybe something as naive as:

--8<---------------cut here---------------start------------->8---
Thanks,

Mathieu

Comments

Mathieu Othacehe June 14, 2020, 4:22 p.m. UTC | #1
> +  (with-parameters ((%current-target-system target))
> +    (let* ((os (operating-system-for-image image))
> +           (image* (image-with-os image os))
> +           (target (image-target image))
> +           (register-closures? (has-guix-service-type? os))
> +           (bootcfg (operating-system-bootcfg os))
> +           (bootloader (bootloader-configuration-bootloader
> +                        (operating-system-bootloader os))))
>
> would do the trick.

I went ahead and pushed a variant of this as
c9f6e2e5bdff186583bdc360832b57f4c56e3427.

Thanks,

Mathieu
Janneke Nieuwenhuizen June 14, 2020, 4:42 p.m. UTC | #2
Mathieu Othacehe writes:

>> (define (hurd-multiboot-modules os)
>> ...
>>          (libc (if target
>>                    (with-parameters ((%current-target-system #f))
>>                      ;; TODO: cross-libc has extra patches for the Hurd;
>>                      ;; remove in next rebuild cycle
>>                      (cross-libc target))
>>                    glibc))
>>
>> we take the ELSE branch here -- and that does not work.  AIUI, this is
>> really a temporary kludge until the next rebuild cycle we can move some
>> hurd-specific glibc patches from cross-libc to glibc-proper.
>
> Oh, I know why! In "system-image", there are a few calls, in the first
> let, that are outside the "with-parameters", in particular "bootcfg"
> which triggers the problem you are describing above.

Ah, yes that makes sense.

> Maybe something as naive as:
>
> diff --git a/gnu/system/image.scm b/gnu/system/image.scm

[..]
> -  (let* ((os (operating-system-for-image image))
[..]
> -    (with-parameters ((%current-target-system target))
> +  (with-parameters ((%current-target-system target))
> +    (let* ((os (operating-system-for-image image))
>
> would do the trick.

It does!

> I went ahead and pushed a variant of this as
> c9f6e2e5bdff186583bdc360832b57f4c56e3427.

Woohoo!  I remove the with-parameters in hurd-vm-disk-image and pushed
to master 5e9cf93364d87c70f8bfad915417cd75d21c0fed

Greetings,
Janneke
diff mbox series

Patch

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 1bda25fd7f..8a3c4e22d9 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -525,14 +525,14 @@  it can be used for bootloading."
 image, depending on IMAGE format."
   (define substitutable? (image-substitutable? image))
 
-  (let* ((os (operating-system-for-image image))
-         (image* (image-with-os image os))
-         (target (image-target image))
-         (register-closures? (has-guix-service-type? os))
-         (bootcfg (operating-system-bootcfg os))
-         (bootloader (bootloader-configuration-bootloader
-                      (operating-system-bootloader os))))
-    (with-parameters ((%current-target-system target))
+  (with-parameters ((%current-target-system target))
+    (let* ((os (operating-system-for-image image))
+           (image* (image-with-os image os))
+           (target (image-target image))
+           (register-closures? (has-guix-service-type? os))
+           (bootcfg (operating-system-bootcfg os))
+           (bootloader (bootloader-configuration-bootloader
+                        (operating-system-bootloader os))))
--8<---------------cut here---------------end--------------->8---

would do the trick.