GNU bug report logs - #48044
[PATCH] build/go: Support cross compiling.

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Mon, 26 Apr 2021 18:34:02 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 48044 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Efraim Flashner <efraim <at> flashner.co.il>, 48044 <at> debbugs.gnu.org
Subject: Re: [bug#48044] [PATCH] build/go: Support cross compiling.
Date: Mon, 26 Apr 2021 21:39:32 +0200
[Message part 1 (text/plain, inline)]
> +      ;; We really only support targeting Linux and mingw.
> +      (setenv "GOOS" (if (string-contains target "mingw")
> +                       "windows"
> +                       "linux"))

If only Linux and mingw is supported, perhaps some kind of error
could be thrown if 'target' does not contain either "mingw" or "linux",
to avoid silently compiling for the wrong operating system?  There is
the Hurd as well for example.

I would recommend throwing the error (or returning #f?) from lower,
to notify the user cross-compilation is not possible as early as possible.

> +      (setenv "GOARM" "7")  ; Default is 6, target our armhf-linux architecture.

Would it be possible to only set that variable when targetting armhf-linux?
Setting this when targetting other architectures seems unlikely to cause issues,
but still seems subtly wrong to me, for some value of subtle.

Note: I do not know much about go and did not test this.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 249 days ago.

Previous Next


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