From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sI9qGb8Xh2BfaQAAgWs5BA (envelope-from ) for ; Mon, 26 Apr 2021 21:42:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SEAcFb8Xh2AYbwAA1q6Kng (envelope-from ) for ; Mon, 26 Apr 2021 19:42:55 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AFC9E15B92 for ; Mon, 26 Apr 2021 21:42:54 +0200 (CEST) Received: from localhost ([::1]:34808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lb789-0000TG-ME for larch@yhetil.org; Mon, 26 Apr 2021 15:42:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lb76M-0006e8-Ly for guix-patches@gnu.org; Mon, 26 Apr 2021 15:41:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lb76M-0002ye-EL for guix-patches@gnu.org; Mon, 26 Apr 2021 15:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lb76M-00029T-Ae for guix-patches@gnu.org; Mon, 26 Apr 2021 15:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48044] [PATCH] build/go: Support cross compiling. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Apr 2021 19:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48044 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner , 48044@debbugs.gnu.org Received: via spool by 48044-submit@debbugs.gnu.org id=B48044.16194660368232 (code B ref 48044); Mon, 26 Apr 2021 19:41:02 +0000 Received: (at 48044) by debbugs.gnu.org; 26 Apr 2021 19:40:36 +0000 Received: from localhost ([127.0.0.1]:47244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lb75v-00028h-HE for submit@debbugs.gnu.org; Mon, 26 Apr 2021 15:40:35 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:34648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lb75s-00028X-Fg for 48044@debbugs.gnu.org; Mon, 26 Apr 2021 15:40:33 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id xXgW2400F0mfAB406XgWjz; Mon, 26 Apr 2021 21:40:30 +0200 Message-ID: <88494b19720f78a81b0eff53b46f134f302247e9.camel@telenet.be> From: Maxime Devos Date: Mon, 26 Apr 2021 21:39:32 +0200 In-Reply-To: <20210426183235.3856-1-efraim@flashner.co.il> References: <20210426183235.3856-1-efraim@flashner.co.il> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-dZYxJwmhYpmCD3t7K6ua" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1619466030; bh=Nt7DAMWKT8A2WUtxTUQnzT1Fzfz3ZGluqpkXjEpAhUI=; h=Subject:From:To:Date:In-Reply-To:References; b=eE333VhUQZrgfoGLdu3ZTGWyVihpBfPORhg80rco5kD0jR/T9uOvK7Seu+0v1YkTO 2akgIBSJMAXZghmu15l1eukUOhDqE9bJ8T/qZSqFPkZdT6qQYIoyp24W9IxR/vdGrr O6T5UKPdm/t4E4JFKZQ95CFl/0xmaZlCG6J8Q9NdohA0SACfvr+IIR0mNAAf7JTbyW ntv0jaE51K1z6gBzoolvSme0jnylM2oRNQQmJEJzokrLmHLMrV6S50O/oz7IBTJQRc DOyHBYEEXdjiF/nrYic8GpMaDSUQfHTqevkGewgCZcSC1PGxuNDxxzPo9JvUsBTbCP 86z9M3ZWCKbMQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619466175; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Nt7DAMWKT8A2WUtxTUQnzT1Fzfz3ZGluqpkXjEpAhUI=; b=FTHESr3u1LevhSISCMoxUULR7WWe59Lzdf41MPQXtL+9GbQJ/Cu6WT/JFtLxhYDBxURoPS Ns5xj1HzndHvD6UepcHA1QgfbSGMulhCmAac0X6BclheO299CXGHstoDy/zPuNQt1T9EMj +z2aeIrgPvrhmBkjVEHJ3Vmx/kD9Eg7ThlH/YAtNQbu7e0AgghN1DJSdTAYoVS34JxgiBz Op50EEZHyvIpuSCdMEEfzCQpG5ujdfbAz/FqQa5LQh6KwuPsf0c0skd9WgzlJouKP9/E+y gsGpbrkq+6AmJynwOpbmbnLRCI4f0cudqmtaMsYl1zYf8VGryoSfJuH97TqFvQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619466175; a=rsa-sha256; cv=none; b=M7bnW3bUxKYWyGPkVaoF3sc3gFhxirqpxHMsyPAGIm/rkmv5sCbwhFZY8PhTXDGrYozkEY YbbMWRYtar4CAB4uM9VQlqOiMME1TvF8NkCbUGUlNrVhp3yVZLfc+gYqJ7/3XApBx2fh9r 3tN4GFvULr9RWIRqHqc+PB0Olqp+TNdP7XT9MiWPtnRmC33Ccw+u5Skise8izMgD/Z300A nGPF7aa9qXW0/vqh+Pb+FCirIRBfef9qbd13ruO3UkjH8wo2nNYlJ4SXIeJaY+tz2Z1Mxt mcRA47nrfvRsW8bPdZ+/suA2swLsyrpYqhtzZMPo6BxikGwe6HxCfXw590VebA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=eE333VhU; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.45 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=eE333VhU; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: AFC9E15B92 X-Spam-Score: -3.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: pWXczFW+UhAW --=-dZYxJwmhYpmCD3t7K6ua Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > + ;; 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 archi= tecture. Would it be possible to only set that variable when targetting armhf-linux? Setting this when targetting other architectures seems unlikely to cause is= sues, 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. --=-dZYxJwmhYpmCD3t7K6ua Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYIcW+RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sOBAQCtuK3GMvSwVHnCx9kEYMe5oepc M6X/hiTLNlZDx+CDoAD+PCbKiPVnCQ7BddbxH3RFYt2CYB6u1aiZbCsg7qHTvQs= =l2nz -----END PGP SIGNATURE----- --=-dZYxJwmhYpmCD3t7K6ua--