GNU bug report logs - #40839
Shepherd activation .GO files are not cross-compiled ... and the Hurd

Previous Next

Package: guix;

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

Date: Sat, 25 Apr 2020 09:50:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 40839 <at> debbugs.gnu.org, Jan Nieuwenhuizen <janneke <at> 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
Hey ho!

Mathieu Othacehe <m.othacehe <at> 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 <at> 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’.




This bug report was last modified 5 years and 78 days ago.

Previous Next


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