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 #) 3527:26 13 (_) In unknown file: 12 (primitive-load-path "gnu/system/install" #) In ice-9/eval.scm: 626:19 11 (_ #) 173:47 10 (_ #(#(# #< name: "motd" content: "…>) …)) 196:43 9 (_ #(#(# #< name: "motd" content: "…>) …)) 293:34 8 (_ #(#(#(# #< name: "motd" conte…>) …) #)) 619:8 7 (_ #(#(#(#)) # …)) 626:19 6 (_ #(#(#(#)) # …)) 159:9 5 (_ #(#(#(#) "/tmp/guix-build-guix-1.0.1-18.11fc384…" …) …)) In srfi/srfi-1.scm: 495:18 4 (fold-right # () _ . _) In ice-9/eval.scm: 293:34 3 (_ #(#(#(#(#(#(#(# ("~^m\x18 " (. #) …) …)) …) …) …) …) …)) 155:9 2 (_ #(#(#(#(#) "/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