all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Craven <david@craven.ch>
Cc: help-guix@gnu.org
Subject: Re: Cross-building GuixSD (and maybe using pre-built toolchains)
Date: Thu, 01 Sep 2016 13:59:14 +0200	[thread overview]
Message-ID: <87twdzq19p.fsf@gnu.org> (raw)
In-Reply-To: <87k2ewuj9e.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 01 Sep 2016 10:17:01 +0200")

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

ludo@gnu.org (Ludovic Courtès) skribis:

> David Craven <david@craven.ch> skribis:
>
>>>> So one issue that happens when cross building is for things that have
>>>> the #:no-substitutes #t enabled. This is mainly found in service
>>>> derivations for generating configuration files.
>>>
>>> I think there’s currently no easy way to cross build a full GuixSD
>>> anyway, like ‘guix system build --target=mips64el-linux-gnu’ (the
>>> --target flag doesn’t exist yet).  Or did you experiment in this area?
>>>
>>> I’d be curious.  It’s designed to allow this (in particular because
>>> gexps are cross-compilation-aware), but I’ve never tried.
>>
>> I'm currently not trying to cross-compile everything. The
>> --system=mips64el-linux gets us pretty far already. The missing parts
>> are only the ones where no substitutes are available.
>
> Aaah OK.  That’s not cross-compilation though, so it works if and only
> if substitutes are available or builds can be offloaded to a machine of
> that architecture.  Otherwise it cannot really work.
>
> Now, in most cases, the tiny Guile derivations created via
> ‘gexp->derivation’ et al. in GuixSD (e.g., the derivation that builds
> the initrd) could use, say, an x86_64 Guile, even if building for
> mips64el.  However, it would be difficult to take advantage of this
> AFAICS.

There’s an untested hack to illustrate:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2531 bytes --]

diff --git a/guix/gexp.scm b/guix/gexp.scm
index 302879f..53239ac 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -523,6 +523,8 @@ The other arguments are as for 'derivation'."
             (cons file-name thing)))
          graphs))
 
+  (define gsystem "x86_64-linux")
+
   (mlet* %store-monad (;; The following binding forces '%current-system' and
                        ;; '%current-target-system' to be looked up at >>=
                        ;; time.
@@ -546,13 +548,13 @@ The other arguments are as for 'derivation'."
                                             (object->string sexp)))
                        (modules  (if (pair? %modules)
                                      (imported-modules %modules
-                                                       #:system system
+                                                       #:system gsystem
                                                        #:module-path module-path
                                                        #:guile guile-for-build)
                                      (return #f)))
                        (compiled (if (pair? %modules)
                                      (compiled-modules %modules
-                                                       #:system system
+                                                       #:system gsystem
                                                        #:module-path module-path
                                                        #:guile guile-for-build)
                                      (return #f)))
@@ -587,7 +589,7 @@ The other arguments are as for 'derivation'."
                         ,builder)
                       #:outputs outputs
                       #:env-vars env-vars
-                      #:system system
+                      #:system gsystem
                       #:inputs `((,guile)
                                  (,builder)
                                  ,@(if modules
diff --git a/guix/packages.scm b/guix/packages.scm
index 3646b9b..fe23d35 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1104,7 +1104,7 @@ symbolic output name, such as \"out\".  Note that this procedure calls
   "This monadic procedure changes the Guile currently used to run the build
 code of derivations to GUILE, a package object."
   (lambda (store)
-    (let ((guile (package-derivation store guile)))
+    (let ((guile (package-derivation store guile "x86_64-linux")))
       (values (%guile-for-build guile) store))))
 
 (define* (package-file package

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


Ludo’.

  parent reply	other threads:[~2016-09-01 11:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 16:15 Cross-building GuixSD (and maybe using pre-built toolchains) David Craven
2016-08-31 20:08 ` Ludovic Courtès
2016-08-31 22:01   ` David Craven
2016-08-31 22:13     ` David Craven
2016-09-01  8:17     ` Ludovic Courtès
2016-09-01 10:11       ` David Craven
2016-09-01 11:16         ` Ludovic Courtès
2016-09-01 11:59       ` Ludovic Courtès [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-08-30 21:26 Paul Boddie
2016-08-31 20:04 ` Ludovic Courtès
2016-08-31 21:49   ` Paul Boddie
2016-09-01  8:10     ` Ludovic Courtès
2016-09-01 15:51       ` Paul Boddie
2016-09-01 19:43         ` Ludovic Courtès
2016-09-02 18:52         ` David Craven
2016-09-03 12:56           ` Ludovic Courtès
2016-09-03 12:59             ` David Craven
2016-09-03 21:18               ` Ludovic Courtès
2016-09-03 21:27                 ` David Craven
2016-07-03 14:51 Paul Boddie
2016-07-04 13:48 ` Ludovic Courtès
2016-07-05  8:10 ` Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twdzq19p.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=david@craven.ch \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.