unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <m.othacehe@gmail.com>
Cc: 40839@debbugs.gnu.org
Subject: bug#40839: Shepherd activation .GO files are not cross-compiled ... and the Hurd
Date: Sat, 25 Apr 2020 17:53:40 +0200	[thread overview]
Message-ID: <875zdnd0jf.fsf@gnu.org> (raw)
In-Reply-To: <87wo63u5j6.fsf@gmail.com> (Mathieu Othacehe's message of "Sat, 25 Apr 2020 14:13:49 +0200")

Hey ho!

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> That would look like:
>
> (if target
>     (with-target target
>                  (compile-file #$file #:output-file #$output
>                                #:env env))
>   (compile-file #$file #:output-file #$output
>                 #:env env))
>
>
> Now, the tricky part is the value of target, because
> #$(%current-target-system) might not be correct in that context.

Yes, that brings us back to <https://issues.guix.gnu.org/issue/29296>.
Time flies!  But now we really need to address it.

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> +  (let ((target (%current-target-system)))
> +    (with-extensions (list shepherd)
> +      (computed-file (string-append (basename (scheme-file-name file) ".scm")
> +                                    ".go")
> +                     #~(begin

The problem here is that ‘%current-target-system’ is not resolved in the
right context.  Though in practice, it’s “good enough” when using ‘guix
system build --target’ though, because ‘%current-target-system’ is bound
once and for all at the beginning.

What about applying this patch, but adding a FIXME comment above ‘let’
pointing at <https://bugs.gnu.org/29296>?

Also, you can avoid duplicating the ‘compile-file’ call by writing it
like this:

  (with-target #$(or target #~%host-type)
    (compile-file …))

Thanks!

Ludo’.

  parent reply	other threads:[~2020-04-25 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25  9:49 bug#40839: Shepherd activation .GO files are not cross-compiled ... and the Hurd Jan Nieuwenhuizen
2020-04-25 12:13 ` Mathieu Othacehe
2020-04-25 13:28   ` Jan Nieuwenhuizen
2020-04-25 15:53   ` Ludovic Courtès [this message]
2020-04-25 17:38     ` Jan Nieuwenhuizen
2020-05-02 13:15       ` Ludovic Courtès
2020-04-25 12:32 ` Mathieu Othacehe
2020-04-25 17:59   ` Jan Nieuwenhuizen
2020-04-27 12:35     ` Mathieu Othacehe
2020-04-28 17:20       ` Jan Nieuwenhuizen
2020-04-29  8:48         ` Mathieu Othacehe

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=875zdnd0jf.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=40839@debbugs.gnu.org \
    --cc=m.othacehe@gmail.com \
    /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 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).