unofficial mirror of bug-guix@gnu.org 
 help / color / Atom feed
* bug#42047: [PATCH 0/3] Running guix gc on the Hurd.
@ 2020-06-25 20:34 Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-06-25 20:34 UTC (permalink / raw)
  To: 42047

From: Jan Nieuwenhuizen <janneke@gnu.org>

Hi!

As discussed on IRC, we would like to get "guix gc" to work on the Hurd.  It's
kind of essential to get the build nodes running a Childhurd.  We discussed
several workarounds, but an acceptable one is non-trivial; so better look into
a proper fix first.

We found that /proc is missing, so I have added that.  And then we found that
/proc/1/environ (and others) may return EIO; so I've added a catch/workaround
for that.

However, when trying to test this I found that the hurd disk image on master
is pretty broken:

   * it creates an ext2, but not of hurd flavor (fixed in 0001)
   * it fails to call make-hurd-device-nodes (fixed in 0002)

With these two fixes, it boots again.  These are really minor fixes/typo-like
oversights and I was considering to "just push" them... but then I found that
the "guix build" command is also broken:

--8<---------------cut here---------------start------------->8---
root@guixygnu ~# guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
Backtrace:
In ice-9/boot-9.scm:
  1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           3 (apply-smob/0 #<thunk 2d5380>)
In ice-9/boot-9.scm:
    718:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
    619:8  1 (_ #(#(#<directory (guile-user) 2cc820>)))
In guix/ui.scm:
  1948:12  0 (run-guix-command _ . _)

guix/ui.scm:1948:12: In procedure run-guix-command:
In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f
--8<---------------cut here---------------end--------------->8---

How sad!

I'm a bit stuck on this, probably because I'm feeling somewhat discouraged.
Any ideas what could have broken this, how to look into it, fix this?

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (3):
  image: hurd: Create hurd-compatible ext2 file-system.
  image: hurd: Initialize root partition for the Hurd.
  guix: gc: Support for the Hurd.

 gnu/build/hurd-boot.scm    | 21 ++++++++++++++-------
 gnu/system/image.scm       |  7 -------
 gnu/system/images/hurd.scm | 11 ++++++++++-
 guix/store/roots.scm       | 12 +++++++++---
 4 files changed, 33 insertions(+), 18 deletions(-)

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





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

* bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system.
  2020-06-25 20:34 bug#42047: [PATCH 0/3] Running guix gc on the Hurd Jan (janneke) Nieuwenhuizen
@ 2020-06-25 20:38 ` Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38   ` bug#42047: [PATCH 2/3] image: hurd: Initialize root partition for the Hurd Jan (janneke) Nieuwenhuizen
                     ` (2 more replies)
  2020-06-26  8:27 ` bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd Jan Nieuwenhuizen
  2020-06-26 15:46 ` bug#42047: [PATCH 0/3] Running guix gc on " Ludovic Courtès
  2 siblings, 3 replies; 12+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-06-25 20:38 UTC (permalink / raw)
  To: 42047

This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.

* gnu/system/images/hurd.scm (hurd-disk-image): Add file-system-options to
create an ext2 file-system that is compatible with the Hurd.
---
 gnu/system/images/hurd.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 4417f03cc8..e5e120d49c 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,6 +67,7 @@
            (offset root-offset)
            (label root-label)
            (file-system "ext2")
+           (file-system-options '("-o" "hurd" "-O" "ext_attr"))
            (flags '(boot))
            (initializer (gexp initialize-root-partition)))))))
 
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





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

* bug#42047: [PATCH 2/3] image: hurd: Initialize root partition for the Hurd.
  2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
@ 2020-06-25 20:38   ` Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38   ` bug#42047: [PATCH 3/3] guix: gc: Support " Jan (janneke) Nieuwenhuizen
  2020-06-25 20:44   ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Ludovic Courtès
  2 siblings, 0 replies; 12+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-06-25 20:38 UTC (permalink / raw)
  To: 42047

This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.

* gnu/system/image.scm (hurd-initialize-root-partition): Move to ...
* gnu/system/images/hurd.scm (hurd-initialize-root-partition): ... here.
(hurd-disk-image): Use it.
---
 gnu/system/image.scm       | 7 -------
 gnu/system/images/hurd.scm | 9 ++++++++-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index bb73aea65a..a4cc2d1ef9 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -96,13 +96,6 @@
    (flags '(boot))
    (initializer (gexp initialize-root-partition))))
 
-(define hurd-initialize-root-partition
-  #~(lambda* (#:rest args)
-      (apply initialize-root-partition
-             (append args
-                     (list #:make-device-nodes
-                           make-hurd-device-nodes)))))
-
 (define efi-disk-image
   (image
    (format 'disk-image)
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index e5e120d49c..31942e7386 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -57,6 +57,13 @@
                               (password-authentication? #t)))
                %base-services/hurd))))
 
+(define hurd-initialize-root-partition
+  #~(lambda* (#:rest args)
+      (apply initialize-root-partition
+             (append args
+                     (list #:make-device-nodes
+                           make-hurd-device-nodes)))))
+
 (define hurd-disk-image
   (image
    (format 'disk-image)
@@ -69,7 +76,7 @@
            (file-system "ext2")
            (file-system-options '("-o" "hurd" "-O" "ext_attr"))
            (flags '(boot))
-           (initializer (gexp initialize-root-partition)))))))
+           (initializer hurd-initialize-root-partition))))))
 
 (define hurd-barebones-disk-image
   (image
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





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

* bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd.
  2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38   ` bug#42047: [PATCH 2/3] image: hurd: Initialize root partition for the Hurd Jan (janneke) Nieuwenhuizen
@ 2020-06-25 20:38   ` Jan (janneke) Nieuwenhuizen
  2020-06-25 20:48     ` Ludovic Courtès
  2020-06-25 20:44   ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Ludovic Courtès
  2 siblings, 1 reply; 12+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-06-25 20:38 UTC (permalink / raw)
  To: 42047

* guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
* gnu/build/hurd-boot.scm (set-hurd-device-translators): Mount /proc.  Add
symlink to /etc/mtab.  Remove duplicate calls to 'scope'.
---
 gnu/build/hurd-boot.scm | 21 ++++++++++++++-------
 guix/store/roots.scm    | 13 ++++++++++---
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm
index aea2ac3307..2db99cdcce 100644
--- a/gnu/build/hurd-boot.scm
+++ b/gnu/build/hurd-boot.scm
@@ -191,7 +191,8 @@ set."
                                   "10.0.2.15" ;the default QEMU guest IP
                                   "--netmask" "255.255.255.0"
                                   "--gateway" "10.0.2.2"
-                                  "--ipv6" "/servers/socket/16"))))
+                                  "--ipv6" "/servers/socket/16"))
+      ("proc"                    ("/hurd/procfs" "--stat-mode=444"))))
 
   (define devices
     '(("dev/full"    ("/hurd/null"     "--full")            #o666)
@@ -232,17 +233,23 @@ set."
                                                             #o666)))
 
   (for-each scope-set-translator servers)
-  (mkdir* (scope "dev/vcs/1"))
-  (mkdir* (scope "dev/vcs/2"))
-  (mkdir* (scope "dev/vcs/2"))
-  (rename-file (scope "/dev/console") (scope "/dev/console-"))
+  (mkdir* "dev/vcs/1")
+  (mkdir* "dev/vcs/2")
+  (mkdir* "dev/vcs/2")
+  (rename-file (scope "/dev/console") (scope "dev/console-"))
   (for-each scope-set-translator devices)
 
   (false-if-EEXIST (symlink "/dev/random" (scope "dev/urandom")))
-  (mkdir* (scope "dev/fd"))
+  (mkdir* "dev/fd")
   (false-if-EEXIST (symlink "/dev/fd/0" (scope "dev/stdin")))
   (false-if-EEXIST (symlink "/dev/fd/1" (scope "dev/stdout")))
-  (false-if-EEXIST (symlink "/dev/fd/2" (scope "dev/stderr"))))
+  (false-if-EEXIST (symlink "/dev/fd/2" (scope "dev/stderr")))
+
+  ;; Make sure /etc/mtab is a symlink to /proc/mounts.
+  (false-if-exception
+   (delete-file (scope "etc/mtab")))
+  (mkdir* (scope "etc"))
+  (symlink "/proc/mounts" (scope "etc/mtab")))
 
 \f
 (define* (boot-hurd-system #:key (on-error 'debug))
diff --git a/guix/store/roots.scm b/guix/store/roots.scm
index 58653507f8..9b4a05b149 100644
--- a/guix/store/roots.scm
+++ b/guix/store/roots.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -197,9 +198,15 @@ or the empty list."
     (string-append dir "/environ"))
 
   (append-map rhs-file-names
-              (split-on-nul
-               (call-with-input-file environ
-                 get-string-all))))
+              (catch 'system-error
+                (lambda _
+                  (split-on-nul
+                   (call-with-input-file environ
+                     get-string-all)))
+                (lambda args
+                  (if (= EIO (system-error-errno args))
+                      '()
+                      (apply throw args))))))
 
 (define (referenced-files)
   "Return the list of referenced store items."
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





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

* bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system.
  2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38   ` bug#42047: [PATCH 2/3] image: hurd: Initialize root partition for the Hurd Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38   ` bug#42047: [PATCH 3/3] guix: gc: Support " Jan (janneke) Nieuwenhuizen
@ 2020-06-25 20:44   ` Ludovic Courtès
  2020-06-25 20:53     ` Jan Nieuwenhuizen
  2 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2020-06-25 20:44 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 42047

Hi,

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.
>
> * gnu/system/images/hurd.scm (hurd-disk-image): Add file-system-options to
> create an ext2 file-system that is compatible with the Hurd.

[...]

> This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.
>
> * gnu/system/image.scm (hurd-initialize-root-partition): Move to ...
> * gnu/system/images/hurd.scm (hurd-initialize-root-partition): ... here.
> (hurd-disk-image): Use it.

You can definitely push these two patches.

Breakage occurred as a result of the introduction of (gnu system images
hurd)?

If you know which commit introduced the regression, I think it’s useful
to mention it in the commit message.

Thank you!

Ludo’.




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

* bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd.
  2020-06-25 20:38   ` bug#42047: [PATCH 3/3] guix: gc: Support " Jan (janneke) Nieuwenhuizen
@ 2020-06-25 20:48     ` Ludovic Courtès
  2020-06-25 22:25       ` Bengt Richter
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2020-06-25 20:48 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 42047

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> * guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
> * gnu/build/hurd-boot.scm (set-hurd-device-translators): Mount /proc.  Add
> symlink to /etc/mtab.  Remove duplicate calls to 'scope'.

Nitpick: I see 3 mostly unrelated patches: (1) fix duplicate called to
‘scope’, (2) mount /proc, and (3) handle EIO.  I think it’s clearer to
view them separately.

(1) and (2) LGTM!

> -  (mkdir* (scope "dev/vcs/1"))
> -  (mkdir* (scope "dev/vcs/2"))
> -  (mkdir* (scope "dev/vcs/2"))

Was it creating like /some/root/some/root/dev/vcs/1?

>    (append-map rhs-file-names
> -              (split-on-nul
> -               (call-with-input-file environ
> -                 get-string-all))))
> +              (catch 'system-error
> +                (lambda _
> +                  (split-on-nul
> +                   (call-with-input-file environ
> +                     get-string-all)))
> +                (lambda args
> +                  (if (= EIO (system-error-errno args))
> +                      '()
> +                      (apply throw args))))))

This may be papering over a real problem.  Before doing that, I think
“we” :-) should investigate why procfs returns EIO in some cases and
look into fixing it.

Then maybe we can still have the ‘catch’ above, but this time as a
temporary measure and with a reference to the upstream issue/commit.

WDYT?

Thank you!

Ludo’.




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

* bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system.
  2020-06-25 20:44   ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Ludovic Courtès
@ 2020-06-25 20:53     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-25 20:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42047

Ludovic Courtès writes:

Hey Ludo',

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.
>>
>> * gnu/system/images/hurd.scm (hurd-disk-image): Add file-system-options to
>> create an ext2 file-system that is compatible with the Hurd.
>
> [...]
>
>> This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.
>>
>> * gnu/system/image.scm (hurd-initialize-root-partition): Move to ...
>> * gnu/system/images/hurd.scm (hurd-initialize-root-partition): ... here.
>> (hurd-disk-image): Use it.
>
> You can definitely push these two patches.
>
> Breakage occurred as a result of the introduction of (gnu system images
> hurd)?
>
> If you know which commit introduced the regression, I think it’s useful
> to mention it in the commit message.

Yes, breakage occured in the mentioned commit above
(b904b59ce592c89dfb4675a8c06757afed6738a0)

Pushed the two fixups to master as 2463a78d17673581978debff6c6c9fce7966980a.

Now to look into "guix build", i'd like to fix that first before
considering "guix gc".

Thanks.
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




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

* bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd.
  2020-06-25 20:48     ` Ludovic Courtès
@ 2020-06-25 22:25       ` Bengt Richter
  0 siblings, 0 replies; 12+ messages in thread
From: Bengt Richter @ 2020-06-25 22:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42047

On +2020-06-25 22:48:43 +0200, Ludovic Courtès wrote:
> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
> 
> > * guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
> > * gnu/build/hurd-boot.scm (set-hurd-device-translators): Mount /proc.  Add
> > symlink to /etc/mtab.  Remove duplicate calls to 'scope'.
> 
> Nitpick: I see 3 mostly unrelated patches: (1) fix duplicate called to
> ‘scope’, (2) mount /proc, and (3) handle EIO.  I think it’s clearer to
> view them separately.
> 
> (1) and (2) LGTM!
> 
> > -  (mkdir* (scope "dev/vcs/1"))
> > -  (mkdir* (scope "dev/vcs/2"))
> > -  (mkdir* (scope "dev/vcs/2"))
> 
> Was it creating like /some/root/some/root/dev/vcs/1?
> 
> >    (append-map rhs-file-names
> > -              (split-on-nul
> > -               (call-with-input-file environ
> > -                 get-string-all))))
> > +              (catch 'system-error
> > +                (lambda _
> > +                  (split-on-nul
> > +                   (call-with-input-file environ
> > +                     get-string-all)))
> > +                (lambda args
> > +                  (if (= EIO (system-error-errno args))
> > +                      '()
> > +                      (apply throw args))))))
> 
> This may be papering over a real problem.  Before doing that, I think

I fear paperings-over ;) Would this idea be worth implementing?:

To make sure a "papering over" does not remain un-noticed in an executable,
create a catch-wrapping macro that would generate code acting like catch but
before entering catch, start emitting complaint messages on and
after a calendar date, e.g. checked with (> (car (gettimeofday)) *macro-produced-date-constant*)

E.g., something to use in place of catch, like (borrowing above for example)
              (catch-with-sunset "date-string" "complaint-message"
	        'system-error
		 (lambda _
		   (split-on-nul
		   ...etc...
		   (apply throw args))))

"complaint-message" could obviously contain bug#number, commit id, or plea for report, etc.

(gettimeofday) on my machine is about 50ns (i.e., often get 20 equal values within the microsecond resolution),
so there shouldn't be a performance hit ;)

> “we” :-) should investigate why procfs returns EIO in some cases and
> look into fixing it.
> 
> Then maybe we can still have the ‘catch’ above, but this time as a
> temporary measure and with a reference to the upstream issue/commit.
> 
> WDYT?
> 
> Thank you!
> 
> Ludo’.
> 
> 
> 

-- 
Regards,
Bengt Richter




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

* bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd.
  2020-06-25 20:34 bug#42047: [PATCH 0/3] Running guix gc on the Hurd Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
@ 2020-06-26  8:27 ` Jan Nieuwenhuizen
  2020-06-27 11:25   ` bug#42047: [PATCH v2] " Jan Nieuwenhuizen
  2020-06-26 15:46 ` bug#42047: [PATCH 0/3] Running guix gc on " Ludovic Courtès
  2 siblings, 1 reply; 12+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-26  8:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42047

Ludovic Courtès writes:

Hello,

A new day!

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
>> * gnu/build/hurd-boot.scm (set-hurd-device-translators): Mount /proc.  Add
>> symlink to /etc/mtab.  Remove duplicate calls to 'scope'.
>
> Nitpick: I see 3 mostly unrelated patches: (1) fix duplicate called to
> ‘scope’, (2) mount /proc, and (3) handle EIO.  I think it’s clearer to
> view them separately.

Yes, I agree.  I will split into 3 patches.

(Initially my plan was to post a DRAFT/RFC for (3) that would either fix
"guix gc", or show us the next error.  Then I needed the other two and
found there was yet another problem...)

>> -  (mkdir* (scope "dev/vcs/1"))
>> -  (mkdir* (scope "dev/vcs/2"))
>> -  (mkdir* (scope "dev/vcs/2"))
>
> Was it creating like /some/root/some/root/dev/vcs/1?

No... "just" //dev/vcs/1.  However, in my bare-iron experiments I
stumbled upon several "Not a directory", so...just being careful here.

>>    (append-map rhs-file-names
>> -              (split-on-nul
>> -               (call-with-input-file environ
>> -                 get-string-all))))
>> +              (catch 'system-error
>> +                (lambda _
>> +                  (split-on-nul
>> +                   (call-with-input-file environ
>> +                     get-string-all)))
>> +                (lambda args
>> +                  (if (= EIO (system-error-errno args))
>> +                      '()
>> +                      (apply throw args))))))
>
> This may be papering over a real problem.  Before doing that, I think
> “we” :-) should investigate why procfs returns EIO in some cases and
> look into fixing it.

Sure, let "us" look into that! :)

> Then maybe we can still have the ‘catch’ above, but this time as a
> temporary measure and with a reference to the upstream issue/commit.
>
> WDYT?

Sure, thanks.

So...I think that I found the problem: Using guile-3.0.[34].  This patch

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index a32bd33293..b191a7b93b 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -312,14 +312,14 @@ without requiring the source code to be rewritten.")
   ;; TODO: Make this 'guile-3.0' on the next rebuild cycle.
   (package
     (inherit guile-3.0)
-    (version "3.0.4")
+    (version "3.0.2")
     (source (origin
               (inherit (package-source guile-3.0))
               (uri (string-append "mirror://gnu/guile/guile-"
                                   version ".tar.xz"))
               (sha256
                (base32
-                "0c8dkyvs6xbxp7rgnhkyakajzhakay7qn9kahj1mj49x5vf4fybb"))))))
+                "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))))
 
 (define-public guile-next
   (deprecated-package "guile-next" guile-3.0))
--8<---------------cut here---------------end--------------->8---

fixes guix build...(terrible!)  What shall "we" do with this, maybe
"someone" wants to have a look?  Guess this should find its way into a
Guile bug report?

[later...]

I checked-out guile master on Debian/Hurd and ran the Guile test suite,
which (apart from known failures) passed.  Leaving that for now.

So, then it "must" be our cross-compiled guile-3.0.4 for the Hurd; best
to check that, right?  Look:

--8<---------------cut here---------------start------------->8---
root@guixydevel ~/guile# ./check-guile -i /run/current-system/profile/bin/guile
Testing /run/current-system/profile/bin/guile ...
with GUILE_LOAD_PATH=/root/guile/test-suite:/run/current-system/profile/share/guile/site/3.0
WARNING: Use of `load' in declarative module (test-suite guile-test).  Add #:declarative? #f to your define-module invocation.
Running 00-initial-env.test
Running 00-repl-server.test
Running 00-socket.test
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: bind
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: bind/sockaddr
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: listen
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: connect
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: connect/sockaddr
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: accept
[...]
Running asyncs.test
ERROR: asyncs.test: preemption via sigprof - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
[...]
Running bytevectors.test
FAIL: bytevectors.test: 2.8 Operations on IEEE-754 Representations: bytevector-ieee-single-native-{ref,set!} (compile -O2)
FAIL: bytevectors.test: 2.8 Operations on IEEE-754 Representations: bytevector-ieee-double-native-{ref,set!} (compile -O2)
[...]
Running ftw.test
ERROR: ftw.test: file-system-fold: test-suite - arguments: ((match-error "match" "no matching pattern" ((error "/tmp/guix-build-guile-3.0.4.drv-0/guile-3.0.4/test-suite"))))
FAIL: ftw.test: file-system-fold: test-suite (never enter) - arguments: (expected-value ((skip "/tmp/guix-build-guile-3.0.4.drv-0/guile-3.0.4/test-suite")) actual-value ((error "/tmp/guix-build-guile-3.0.4.drv-0/guile-3.0.4/test-suite")))
FAIL: ftw.test: file-system-fold: test-suite/lib.scm (flat file) - arguments: (expected-value ((leaf "/tmp/guix-build-guile-3.0.4.drv-0/guile-3.0.4/test-suite/test-suite/lib.scm")) actual-value ((error "/tmp/guix-build-guile-3.0.4.drv-0/guile-3.0.4/test-suite/test-suite/lib.scm")))
UNRESOLVED: ftw.test: file-system-fold: EACCES
ERROR: ftw.test: file-system-tree: test-suite (never enter) - arguments: ((match-error "match" "no matching pattern" #f))
ERROR: ftw.test: file-system-tree: test-suite/* - arguments: ((match-error "match" "no matching pattern" #f))
ERROR: ftw.test: file-system-tree: test-suite (recursive) - arguments: ((match-error "match" "no matching pattern" #f))
ERROR: ftw.test: scandir: top-srcdir - arguments: ((match-error "match" "no matching pattern" #f))
ERROR: ftw.test: scandir: test-suite - arguments: ((match-error "match" "no matching pattern" #f))
FAIL: ftw.test: scandir: no select
Running popen.test
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /root/guile/module/ice-9/command-line.scm
;;; compiling /root/guile/module/system/base/compile.scm
;;; it seems /root/guile/module/system/base/compile.scm
;;; is part of the compiler; skipping auto-compilation
;;; compiling /root/guile/module/system/base/language.scm
;;; WARNING: compilation of /root/guile/module/system/base/language.scm failed:
;;; In procedure variable-ref: variable is unbound: #<variable 3882d0 value: #<undefined>>
;;; compiling /root/guile/module/system/base/syntax.scm
[hmm?]
Running ports.test
ERROR: ports.test: %file-port-name-canonicalization: absolute canonicalization from ice-9 - arguments: ((system-error "canonicalize-path" "~A" ("No such file or directory") (1073741826)))
[...]
Running signals.test
ERROR: signals.test: setitimer: current itimers are 0: ITIMER_VIRTUAL - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
ERROR: signals.test: setitimer: current itimers are 0: ITIMER_PROF - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
ERROR: signals.test: setitimer: setting values correctly: initial setting - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
ERROR: signals.test: setitimer: setting values correctly: reset to zero - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
ERROR: signals.test: setitimer: usecs > 1e6: initial setting - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
ERROR: signals.test: setitimer: usecs > 1e6: reset to zero - arguments: ((system-error "setitimer" "~A" ("Function not implemented") (1073741902)))
[...]
Running srfi-18.test
FAIL: srfi-18.test: thread-sleep!: thread sleeps fractions of a second
[...]
Running srfi-4.test
FAIL: srfi-4.test: f32 vectors: f32vector-ref
FAIL: srfi-4.test: f32 vectors: f32vector-set!/ref
FAIL: srfi-4.test: f32 vectors: f32vector->list/array->list
FAIL: srfi-4.test: f64 vectors: f64vector-ref
FAIL: srfi-4.test: f64 vectors: f64vector-set!/ref
FAIL: srfi-4.test: f64 vectors: f64vector->list/array->list
FAIL: srfi-4.test: c32 vectors: c32vector-ref
FAIL: srfi-4.test: c32 vectors: c32vector-set!/ref
FAIL: srfi-4.test: c32 vectors: c32vector->list/array->list
FAIL: srfi-4.test: c32 vectors: array-ref
FAIL: srfi-4.test: c64 vectors: c64vector-ref
FAIL: srfi-4.test: c64 vectors: c64vector-set!/ref
FAIL: srfi-4.test: c64 vectors: c64vector->list/list->c64vector
FAIL: srfi-4.test: c64 vectors: c64vector->list/array->list
FAIL: srfi-4.test: c64 vectors: array-ref
[...]
Running suspendable-ports.test
warning: call to primitive-fork while multiple threads are running;
         further behavior unspecified.  See "Processes" in the
         manual, for more information.
ERROR: suspendable-ports.test: %file-port-name-canonicalization: absolute canonicalization from ice-9 - arguments: ((system-error "canonicalize-path" "~A" ("No such file or directory") (1073741826)))
[...]
Running weaks.test
ERROR: weaks.test: weak-hash: assoc can do anything - arguments: ((out-of-range #f "Value out of range ~S to ~S: ~S" (1 4294967295 18446744073709551615) (18446744073709551615)))
--8<---------------cut here---------------end--------------->8---

Some of these are "known" and I didn't run a "baseline" using 3.0.2
(which works).  However the srfi-4 and bytevector look real bad to me.

(FTW could also be real bad, but running "find-files" from (guix build
utils) by hand just works; looks like a compilation-time file name
problem with the/how I ran the/ test-suite.?)

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




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

* bug#42047: [PATCH 0/3] Running guix gc on the Hurd.
  2020-06-25 20:34 bug#42047: [PATCH 0/3] Running guix gc on the Hurd Jan (janneke) Nieuwenhuizen
  2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
  2020-06-26  8:27 ` bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd Jan Nieuwenhuizen
@ 2020-06-26 15:46 ` Ludovic Courtès
  2 siblings, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2020-06-26 15:46 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 42047

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> With these two fixes, it boots again.  These are really minor fixes/typo-like
> oversights and I was considering to "just push" them... but then I found that
> the "guix build" command is also broken:
>
> root@guixygnu ~# guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
> Backtrace:
> In ice-9/boot-9.scm:
>   1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
> In unknown file:
>            3 (apply-smob/0 #<thunk 2d5380>)
> In ice-9/boot-9.scm:
>     718:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
> In ice-9/eval.scm:
>     619:8  1 (_ #(#(#<directory (guile-user) 2cc820>)))
> In guix/ui.scm:
>   1948:12  0 (run-guix-command _ . _)
>
> guix/ui.scm:1948:12: In procedure run-guix-command:
> In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f

For the record, janneke found that this was cause by ‘open-connection’
returning #f; that, in turn, happened due to a bug introduced in Guile
3.0.4:

  https://bugs.gnu.org/42060

Guix commit 641631c1a2590acb1778ebb7b3a141beb8e7448b solves this
problem.

Ludo’.




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

* bug#42047: [PATCH v2] guix: gc: Support for the Hurd.
  2020-06-26  8:27 ` bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd Jan Nieuwenhuizen
@ 2020-06-27 11:25   ` Jan Nieuwenhuizen
  2020-06-28 14:31     ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-27 11:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42047

[-- Attachment #1: Type: text/plain, Size: 5169 bytes --]

Jan Nieuwenhuizen writes:

Hello,

>> Nitpick: I see 3 mostly unrelated patches: (1) fix duplicate called to
>> ‘scope’, (2) mount /proc, and (3) handle EIO.  I think it’s clearer to
>> view them separately.

> Yes, I agree.  I will split into 3 patches.

I have split and pushed the trivial hurd-boot patches as
65d95e5d852e47343b9acc1717918c9db7364c01

>>>    (append-map rhs-file-names
>>> -              (split-on-nul
>>> -               (call-with-input-file environ
>>> -                 get-string-all))))
>>> +              (catch 'system-error
>>> +                (lambda _
>>> +                  (split-on-nul
>>> +                   (call-with-input-file environ
>>> +                     get-string-all)))
>>> +                (lambda args
>>> +                  (if (= EIO (system-error-errno args))
>>> +                      '()
>>> +                      (apply throw args))))))
>>
>> This may be papering over a real problem.  Before doing that, I think
>> “we” :-) should investigate why procfs returns EIO in some cases and
>> look into fixing it.
>
> Sure, let "us" look into that! :)

I have (with some kind fixup help from Marius) created a gdb-minimal
package that cross-builds and works on the Hurd.  I tried to gain
insight by attaching to guix-daemon or just running guix-daemon in gdb,
but it does not seem to run under gdb; but that could be my
inexperience.  I'm only getting mig/ipc or thread messages...

So...attached is a pretty blunt hack that does "fix" guix gc.  Where the
above "tried" to paper over the problem, "catch #t" is the only thing I
could get to actually work.

I'm really puzzled here.  This

--8<---------------cut here---------------start------------->8---
  (append-map rhs-file-names
              (split-on-nul
               (catch #t ;;'system-error
                 (lambda _
                   (call-with-input-file environ
                     get-string-all))
                 (lambda args
                   (format (current-error-port) "KETS: args=~s\n" args)
                   (format (current-error-port) "sys: ~s\n" (system-error-errno args))
                   ""))))
--8<---------------cut here---------------end--------------->8---

gives

--8<---------------cut here---------------start------------->8---
KETS: args=(r6rs:exception #<r6rs:record:&raise-object-wrapper>)
sys: #f
Backtrace:
          19 (apply-smob/1 #<catch-closure 4003b0>)
In ice-9/boot-9.scm:
    705:2 18 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8 17 (_ #(#(#<directory (guile-user) 3ec910>)))
In guix/ui.scm:
  1948:12 16 (run-guix-command _ . _)
In ice-9/boot-9.scm:
    829:9 15 (catch _ _ #<procedure 5f5df8 at guix/ui.scm:662:2 (key c)> _)
    829:9 14 (catch _ _ #<procedure 5f5e08 at guix/ui.scm:796:6 (key proc format-string format-args . rest)> _)
In guix/scripts/gc.scm:
   280:14 13 (_)
In guix/store/roots.scm:
   290:39 12 (busy-store-items)
madvise failed: Function not implemented
In srfi/srfi-1.scm:
   679:15 11 (append-map _ _ . _)
   592:29 10 (map1 _)
   592:29  9 (map1 _)
   592:29  8 (map1 _)
   592:29  7 (map1 _)
   592:29  6 (map1 ("5" "6" "7" "9" "10" "12" "19" "23" "24" "25" "26" "27" "42" "93" "95" "109" "197" "503" …))
   592:29  5 (map1 ("6" "7" "9" "10" "12" "19" "23" "24" "25" "26" "27" "42" "93" "95" "109" "197" "503" "5…" …))
   592:29  4 (map1 ("7" "9" "10" "12" "19" "23" "24" "25" "26" "27" "42" "93" "95" "109" "197" "503" "516" # …))
   592:17  3 (map1 ("9" "10" "12" "19" "23" "24" "25" "26" "27" "42" "93" "95" "109" "197" "503" "516" "538" …))
In ice-9/boot-9.scm:
    829:9  2 (catch system-error #<procedure 3846800 at guix/store/roots.scm:254:20 ()> #<procedure 3d28048 a…> …)
In guix/store/roots.scm:
   259:30  1 (_)
   204:15  0 (proc-environ-roots _)

guix/store/roots.scm:204:15: In procedure proc-environ-roots:
ERROR: R6RS exception:
  1. &i/o-read
  2. &i/o-port: #<input: /proc/9/environ 13>
--8<---------------cut here---------------end--------------->8---

which shows 'system-error as well as conditions.  But using "catch
'system-error' or even

--8<---------------cut here---------------start------------->8---
 (append-map rhs-file-names
             (split-on-nul
              (guard (c (else ;;(i/o-read-error? c)
                         (format #t "KETS\n")
                         (format (current-error-port) "KETS\n")
                         (format (current-error-port) "~a: ignoring EIO: Good luck!\n" environ)
                         "")
                        ;; (#t
                        ;;  (format (current-error-port) "~a: DUNNO\n" c)
                        ;;  "")
                        )
                (format (current-error-port) "gonna call\n")
                (call-with-input-file environ
                  get-string-all))))
--8<---------------cut here---------------end--------------->8---

shows no debug printing at all except "gonna call", and the
exception/condition/raisy-thing somehow "escapes".

Greetings,
Janneke


[-- Attachment #2: v2-0001-guix-gc-Support-for-the-Hurd.patch --]
[-- Type: text/x-patch, Size: 1848 bytes --]

From 751423e35e9b4b30e066de9ae6305748fd8f3b0d Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Thu, 25 Jun 2020 17:07:25 +0200
Subject: [PATCH v2] guix: gc: Support for the Hurd.

* guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
---
 guix/store/roots.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/guix/store/roots.scm b/guix/store/roots.scm
index 58653507f8..ad4f111b79 100644
--- a/guix/store/roots.scm
+++ b/guix/store/roots.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,9 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-34)
+  #:use-module (srfi srfi-35)
+  #:use-module (rnrs exceptions)
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 rdelim)
@@ -198,8 +202,13 @@ or the empty list."
 
   (append-map rhs-file-names
               (split-on-nul
-               (call-with-input-file environ
-                 get-string-all))))
+               (catch #t
+                 (lambda _
+                   (call-with-input-file environ
+                     get-string-all))
+                 (lambda args
+                   (format (current-error-port) "~a: ignoring EIO: Good luck!\n" environ)
+                   "")))))
 
 (define (referenced-files)
   "Return the list of referenced store items."
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

* bug#42047: [PATCH v2] guix: gc: Support for the Hurd.
  2020-06-27 11:25   ` bug#42047: [PATCH v2] " Jan Nieuwenhuizen
@ 2020-06-28 14:31     ` Ludovic Courtès
  0 siblings, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2020-06-28 14:31 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 42047

Hi,

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> I'm really puzzled here.  This
>
>   (append-map rhs-file-names
>               (split-on-nul
>                (catch #t ;;'system-error
>                  (lambda _
>                    (call-with-input-file environ
>                      get-string-all))
>                  (lambda args
>                    (format (current-error-port) "KETS: args=~s\n" args)
>                    (format (current-error-port) "sys: ~s\n" (system-error-errno args))
>                    ""))))
>
>
> gives
>
> KETS: args=(r6rs:exception #<r6rs:record:&raise-object-wrapper>)

Ah yes, it’s really an R6RS condition here, not 'system-error, because
we’re using ‘get-string-all’ (from R6RS).  So we’d need to use ‘guard’
and the R6RS I/O error predicate.

But I do think we should take a closer look at procfs; we’ll have to fix
it anyway, and it’s relatively little code, so the sooner the better
IMO.  As discussed yesterday on IRC, gdb is a somewhat flaky, so perhaps
we can try (cross)building procfs and with a bunch of printfs, and then
starting it as an active translator so it has stdout/stderr.  High tech!  :-)

Thanks,
Ludo’.




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

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-25 20:34 bug#42047: [PATCH 0/3] Running guix gc on the Hurd Jan (janneke) Nieuwenhuizen
2020-06-25 20:38 ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Jan (janneke) Nieuwenhuizen
2020-06-25 20:38   ` bug#42047: [PATCH 2/3] image: hurd: Initialize root partition for the Hurd Jan (janneke) Nieuwenhuizen
2020-06-25 20:38   ` bug#42047: [PATCH 3/3] guix: gc: Support " Jan (janneke) Nieuwenhuizen
2020-06-25 20:48     ` Ludovic Courtès
2020-06-25 22:25       ` Bengt Richter
2020-06-25 20:44   ` bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system Ludovic Courtès
2020-06-25 20:53     ` Jan Nieuwenhuizen
2020-06-26  8:27 ` bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd Jan Nieuwenhuizen
2020-06-27 11:25   ` bug#42047: [PATCH v2] " Jan Nieuwenhuizen
2020-06-28 14:31     ` Ludovic Courtès
2020-06-26 15:46 ` bug#42047: [PATCH 0/3] Running guix gc on " Ludovic Courtès

unofficial mirror of bug-guix@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-bugs/0 guix-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-bugs guix-bugs/ https://yhetil.org/guix-bugs \
		bug-guix@gnu.org
	public-inbox-index guix-bugs

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.bugs
	nntp://news.gmane.io/gmane.comp.gnu.guix.bugs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git