unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40574: [wip-hurd-vm]: cross-build of `guix' fails
@ 2020-04-12 14:03 Jan Nieuwenhuizen
  2020-04-16 16:34 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Nieuwenhuizen @ 2020-04-12 14:03 UTC (permalink / raw)
  To: 40574

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

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


[-- Attachment #2: ncsp53ws1vg4kpbgzl3q99n442ixz8-guix-1.0.1-16.0c53d35.drv.bz2 --]
[-- Type: application/octet-stream, Size: 36504 bytes --]

[-- 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 related	[flat|nested] 3+ messages in thread

* bug#40574: [wip-hurd-vm]: cross-build of `guix' fails
  2020-04-12 14:03 bug#40574: [wip-hurd-vm]: cross-build of `guix' fails Jan Nieuwenhuizen
@ 2020-04-16 16:34 ` Ludovic Courtès
  2020-04-23 22:14   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2020-04-16 16:34 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 40574

Hello!

Jan Nieuwenhuizen <janneke@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@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@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’.

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

* bug#40574: [wip-hurd-vm]: cross-build of `guix' fails
  2020-04-16 16:34 ` Ludovic Courtès
@ 2020-04-23 22:14   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2020-04-23 22:14 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 40574-done

Hello!

Ludovic Courtès <ludo@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’.

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

end of thread, other threads:[~2020-04-23 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12 14:03 bug#40574: [wip-hurd-vm]: cross-build of `guix' fails Jan Nieuwenhuizen
2020-04-16 16:34 ` Ludovic Courtès
2020-04-23 22:14   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).