guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#48044] [PATCH] build/go: Support cross compiling.


From: Maxime Devos
Subject: [bug#48044] [PATCH] build/go: Support cross compiling.
Date: Mon, 26 Apr 2021 21:39:32 +0200
User-agent: Evolution 3.34.2

> +      ;; 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.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]