GNU bug report logs - #40574
[wip-hurd-vm]: cross-build of `guix' fails

Previous Next

Package: guix;

Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>

Date: Sun, 12 Apr 2020 14:04:01 UTC

Severity: normal

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

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 40574 in the body.
You can then email your comments to 40574 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 bug-guix <at> gnu.org:
bug#40574; Package guix. (Sun, 12 Apr 2020 14:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 12 Apr 2020 14:04:01 GMT) Full text and rfc822 format available.

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

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: [wip-hurd-vm]: cross-build of `guix' fails
Date: Sun, 12 Apr 2020 16:03:05 +0200
[Message part 1 (text/plain, inline)]
Hello Ludo',

As discussed on IRC: current wip-hurd-vm
c757307ed5aa563225e1ab880681006fe42fce62 contains all preperations
necessary to cross-build `guix' itself (and add it to the hurd system).

However, running

    ./pre-inst-env guix build --target=i586-pc-gnu

fails with (full log attached)

--8<---------------cut here---------------start------------->8---
[ 14%] LOAD     gnu/bootloader/depthcharge.scm
[ 14%] LOAD     gnu/ci.scm
WARNING: Use of `load' in declarative module (guix ui).  Add #:declarative? #f to your define-module invocation.
WARNING: (guix build emacs-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build ant-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build download-nar): `dump-port*' imported from both (guix serialization) and (guix progress)
WARNING: (guix build cargo-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build cmake-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build dub-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build ocaml-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build dune-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build meson-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build minify-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build font-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build go-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build asdf-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build copy-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build gnu-dist): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build guile-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build node-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build perl-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build python-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build r-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build rakudo-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build ruby-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build scons-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build texlive-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build waf-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build haskell-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: (guix build julia-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: Use of `load' in declarative module (guix scripts repl).  Add #:declarative? #f to your define-module invocation.
;;; Failed to autoload make-page-map in (charting):
;;; no code for module (charting)
;;; Failed to autoload make-page-map in (charting):
;;; no code for module (charting)
WARNING: Use of `load' in declarative module (gnu system install).  Add #:declarative? #f to your define-module invocation.
error: failed to load 'gnu/system/install.scm': No such file or directory
make[2]: *** [Makefile:5887: make-go] Error 1
make[2]: Leaving directory '/tmp/guix-build-guix-1.0.1-16.0c53d35.drv-0/source'
make[1]: *** [Makefile:4952: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-guix-1.0.1-16.0c53d35.drv-0/source'
make: *** [Makefile:3373: all] Error 2
command "make" "-j" "8" failed with status 2
--8<---------------cut here---------------end--------------->8---


What I found that when entering a cross-build environment that created by

    ./pre-inst-env guix build --target=i586-pc-gnu guix --keep-failed --no-offload

doing

    GUILE_LOAD_COMPILED_PATH= guild compile --target=i586-pc-gnu -L . gnu/ci.scm -o foo.go
    GUILE_LOAD_COMPILED_PATH= guild compile --target=i586-pc-gnu -L . gnu/tests/install.scm -o bar.go

gives something like

--8<---------------cut here---------------start------------->8---
WARNING: Use of `load' in declarative module (guix ui).  Add #:declarative? #f to your define-module invocation.
WARNING: (guix build emacs-build-system): imported module (guix build utils) overrides core binding `delete'
Backtrace:
In ice-9/boot-9.scm:
  3297:17 19 (resolve-interface (gnu system install) #:select _ #:hide _ #:prefix _ #:renamer _ #:version _)
In ice-9/threads.scm:
    390:8 18 (_ _)
In ice-9/boot-9.scm:
  3223:13 17 (_)
In ice-9/threads.scm:
    390:8 16 (_ _)
In ice-9/boot-9.scm:
  3507:20 15 (_)
   2806:4 14 (save-module-excursion #<procedure 7f6220dc7cc0 at ice-9/boot-9.scm:3508:21 ()>)
  3527:26 13 (_)
In unknown file:
          12 (primitive-load-path "gnu/system/install" #<procedure 7f622318f7c0 at ice-9/boot-9.scm:3514:37 ()>)
In ice-9/eval.scm:
   626:19 11 (_ #<directory (gnu system install) 7f6229b65780>)
   173:47 10 (_ #(#(#<directory (gnu system install) 7f6229b65780> #<<plain-file> name: "motd" content: "…>) …))
   196:43  9 (_ #(#(#<directory (gnu system install) 7f6229b65780> #<<plain-file> name: "motd" content: "…>) …))
   293:34  8 (_ #(#(#(#<directory (gnu system install) 7f6229b65780> #<<plain-file> name: "motd" conte…>) …) #))
    619:8  7 (_ #(#(#(#<directory (gnu installer) 7f62248f3dc0>)) #<variable 7f621d5d75b0 value: #<gexp (be…> …))
   626:19  6 (_ #(#(#(#<directory (gnu installer) 7f62248f3dc0>)) #<variable 7f621d5d75b0 value: #<gexp (be…> …))
    159:9  5 (_ #(#(#(#<directory (guix discovery) 7f62339ee280>) "/tmp/guix-build-guix-1.0.1-18.11fc384…" …) …))
In srfi/srfi-1.scm:
   495:18  4 (fold-right #<procedure 7f621d786ca0 at ice-9/eval.scm:336:13 (a b)> () _ . _)
In ice-9/eval.scm:
   293:34  3 (_ #(#(#(#(#(#(#(#<directory (guix discovery) 7f62339ee280> ("~^m\x18 " (. #) …) …)) …) …) …) …) …))
    155:9  2 (_ #(#(#(#(#<directory (guix discovery) 7f62339ee280>) "/tmp/guix-build-guix-1.0.1-18.11…" …) …) …))
In unknown file:
           1 (lstat "/tmp/guix-build-guix-1.0.1-18.11fc384.drv-0/source/gnu/../gnu/installer/~^m\x18 ")
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure lstat: No such file or directory: "/tmp/guix-build-guix-1.0.1-18.11fc384.drv-0/source/gnu/../gnu/installer/~^m\x18 "
--8<---------------cut here---------------end--------------->8---

That inspired me to add this substitution to the guix cross build recipe

--8<---------------cut here---------------start------------->8---
gnu: guix: Avoid loading (gnu installer) when cross compiling.

* gnu/packages/package-management.scm (guix)[arguments]: When cross-compiling,
add `disable-loading-gnu-installer' stage.

1 file changed, 9 insertions(+), 1 deletion(-)
gnu/packages/package-management.scm | 10 +++++++++-

modified   gnu/packages/package-management.scm
@@ -216,7 +216,15 @@ $(prefix)/etc/init.d\n")))
                                      (string-append gzip "/bin/gzip"))
                                     (("/gnu/store/.*/xz")
                                      (string-append xz "/bin/xz")))
-                                  #t))))
+                                  #t)))
+                            ;; XXX Avoid: In procedure lstat: No such file or directory: ".../source/gnu/../gnu/installer/~^m\x18 "
+                            (add-before 'build 'disable-loading-gnu-installer
+                              (lambda _
+                                  (substitute* "gnu/system/install.scm"
+                                    (("#:use-module \\(gnu installer\\)" all)
+                                     (string-append ";;" all))
+                                    (("\\(installer-program\\)" all)
+                                     (string-append "'" all))))))
                           '())
                     (add-before 'check 'copy-bootstrap-guile
                       (lambda* (#:key system inputs #:allow-other-keys)

--8<---------------cut here---------------end--------------->8---

because it will allow the manual guild invocations to succeed.  However,
the cross build still fails (or creates 64-bit .go files) unless I revert

    a05ad01122 records: Have ABI check work well for cross-compilation.
    041c3c22dc compile: Run the load phase within 'with-target'.

and instead, use the prior hack

--8<---------------cut here---------------start------------->8---
ce136711e0 REMOVEME gnu: guix: Bugfix for cross compiling to the Hurd.

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 7165edf5d2..66c71a3fa5 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -226,6 +226,16 @@ $(prefix)/etc/init.d\n")))
                                     (("\\(installer-program\\)" all)
                                      (string-append "'" all))))))
                           '())
+                    ,@(if (hurd-target?)
+                          ;; (with-target "i586-pc-gnu" target-most-positive-fixnum)
+                          ;;   => 2305843009213693951
+                          `((add-before 'build 'patch-guix/records.scm
+                              (lambda _
+                                (substitute* "guix/records.scm"
+                                  ((" most-positive-fixnum")
+                                   " 536870911"))
+                                #t)))
+                          '())
                     (add-before 'check 'copy-bootstrap-guile
                       (lambda* (#:key system inputs #:allow-other-keys)
                         ;; Copy the bootstrap guile tarball in the store used

--8<---------------cut here---------------end--------------->8---

Greetings,
janneke

[ncsp53ws1vg4kpbgzl3q99n442ixz8-guix-1.0.1-16.0c53d35.drv.bz2 (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

Information forwarded to bug-guix <at> gnu.org:
bug#40574; Package guix. (Thu, 16 Apr 2020 16:35:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 40574 <at> debbugs.gnu.org
Subject: Re: bug#40574: [wip-hurd-vm]: cross-build of `guix' fails
Date: Thu, 16 Apr 2020 18:34:07 +0200
Hello!

Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:

> In procedure lstat: No such file or directory: "/tmp/guix-build-guix-1.0.1-18.11fc384.drv-0/source/gnu/../gnu/installer/~^m\x18 "

This one is funny:

--8<---------------cut here---------------start------------->8---
$ (unset GUILE_LOAD_COMPILED_PATH; COLUMNS=200 XDG_CACHE_HOME=/nowhere guild compile --target=i586-pc-gnu -L . gnu/ci.scm -o foo.go)
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/ludo/.guix-profile/bin/guild
;;; WARNING: compilation of /home/ludo/.guix-profile/bin/guild failed:
;;; failed to create path for auto-compiled file "/home/ludo/.guix-profile/bin/guild"
WARNING: Use of `load' in declarative module (guix ui).  Add #:declarative? #f to your define-module invocation.
WARNING: (guix build emacs-build-system): imported module (guix build utils) overrides core binding `delete'
WARNING: Use of `load' in declarative module (gnu system install).  Add #:declarative? #f to your define-module invocation.
Backtrace:
In ice-9/boot-9.scm:
  3297:17 19 (resolve-interface (gnu system install) #:select _ #:hide _ #:prefix _ #:renamer _ #:version _)
In ice-9/threads.scm:
    390:8 18 (_ _)
In ice-9/boot-9.scm:
  3223:13 17 (_)
In ice-9/threads.scm:
    390:8 16 (_ _)
In ice-9/boot-9.scm:
  3507:20 15 (_)
   2806:4 14 (save-module-excursion _)
  3527:26 13 (_)
In unknown file:
          12 (primitive-load-path "gnu/system/install" #<procedure 7fb03993e6e0 at ice-9/boot-9.scm:3514:37 ()>)
In ice-9/eval.scm:
   626:19 11 (_ #<directory (gnu system install) 7fb03817caa0>)
   173:47 10 (_ #(#(#<directory (gnu system install) 7fb03817caa0> #<<plain-file> name: "motd" content: "\n\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m\n\n\x1b[2mUsing this shell…>) …))
   196:43  9 (_ #(#(#<directory (gnu system install) 7fb03817caa0> #<<plain-file> name: "motd" content: "\n\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m\n\n\x1b[2mUsing this shell…>) …))
   293:34  8 (_ #(#(#(#<directory (gnu system install) 7fb03817caa0> #<<plain-file> name: "motd" content: "\n\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m\n\n\x1b[2mUsing this …>) …) #))
    619:8  7 (_ #(#(#(#<directory (gnu installer) 7fb03abbfe60>)) #<variable 7fb03f5d5110 value: #<gexp (begin (bindtextdomain "guix" (string-append #<gexp-input #<package guix <at> 1.1.0 gnu/packag…> …))
   626:19  6 (_ #(#(#(#<directory (gnu installer) 7fb03abbfe60>)) #<variable 7fb03f5d5110 value: #<gexp (begin (bindtextdomain "guix" (string-append #<gexp-input #<package guix <at> 1.1.0 gnu/packag…> …))
    159:9  5 (_ #(#(#(#<directory (guix discovery) 7fb04977f320>) "/home/ludo/src/guix/gnu/.." "gnu/installer") 26))
In srfi/srfi-1.scm:
   495:18  4 (fold-right #<procedure 7fb03f077e40 at ice-9/eval.scm:336:13 (a b)> () _ . _)
In ice-9/eval.scm:
   293:34  3 (_ #(#(#(#(#(#(#(#<directory (guix discovery) 7fb04977f320> ("ރl^ " (type . unknown) (inode . 17571939)) "/home/ludo/src/guix/gnu/../gnu/installer" #<variable 7fb03…> …)) …) …) …) …) …))
    155:9  2 (_ #(#(#(#(#<directory (guix discovery) 7fb04977f320>) "/home/ludo/src/guix/gnu/../gnu/installer/ރl^ " ((type . unknown) (inode . 17571939))) unknown) #<procedure failure ()>))
In unknown file:
           1 (lstat "/home/ludo/src/guix/gnu/../gnu/installer/ރl^ ")
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure lstat: Dosiero aŭ dosierujo ne ekzistas: "/home/ludo/src/guix/gnu/../gnu/installer/ރl^ "
--8<---------------cut here---------------end--------------->8---

(A good opportunity to learn about THAANA LETTER RAA!
<https://en.wikipedia.org/wiki/Thaana#Alphabet>)

Here ‘scandir*’ from (guix build syscalls) is being interpreted and
presumably it gets all the struct offsets wrong (32-bit instead of
64-bit I guess), hence the funny file name.  (‘scandir*’ is called from
‘scheme-modules*’ in (gnu installer), itself from the
‘installer-program’ call in (gnu system install).)

This bit is fixed in 82d8959e5d137b2061a68878d78a8f74a238ac44.

To be continued…

Thank you,
Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 23 Apr 2020 22:15:02 GMT) Full text and rfc822 format available.

Notification sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
bug acknowledged by developer. (Thu, 23 Apr 2020 22:15:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 40574-done <at> debbugs.gnu.org
Subject: Re: bug#40574: [wip-hurd-vm]: cross-build of `guix' fails
Date: Fri, 24 Apr 2020 00:14:35 +0200
Hello!

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

> (A good opportunity to learn about THAANA LETTER RAA!
> <https://en.wikipedia.org/wiki/Thaana#Alphabet>)

I believe these commits on ‘master’ solve remaining cross-compilation
issues:

  62bc3c5b04 build: Don't build man pages when cross-compiling.
  12da5162e4 compile: Pre-load the compiler outside 'with-target'.

The way I tested it is by running this command from current
‘core-updates’:

  guix build --target=i586-pc-gnu guix --with-branch=guix=master

There’s another thing that needs to be done: in the ‘guix’ package, the
‘copy-bootstrap-guile’ phase must be skipped when cross-compiling (it’s
useless since tests aren’t run and it crashes).

When these commits are cherry-picked or merged on ‘core-updates’,
someone can run “make update-guix-package” there and it should be all
fine.

I’m optimistically closing the bug, but let me know if I was
over-optimistic!  :-)

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 May 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 362 days ago.

Previous Next


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