From patchwork Fri Nov 19 20:37:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Collin J. Doering" X-Patchwork-Id: 34648 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BFDEE27BBE3; Fri, 19 Nov 2021 20:39:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 862CF27BBE1 for ; Fri, 19 Nov 2021 20:39:09 +0000 (GMT) Received: from localhost ([::1]:47790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moAf6-0007Y0-Hi for patchwork@mira.cbaines.net; Fri, 19 Nov 2021 15:39:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moAf0-0007Xr-6E for guix-patches@gnu.org; Fri, 19 Nov 2021 15:39:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moAez-0000T4-Sz for guix-patches@gnu.org; Fri, 19 Nov 2021 15:39:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moAez-0006fq-O6 for guix-patches@gnu.org; Fri, 19 Nov 2021 15:39:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51981] [PATCH 1/1] build: Fix cross compilation for go-build-system References: <87bl2f6gti.fsf@rekahsoft.ca> In-Reply-To: <87bl2f6gti.fsf@rekahsoft.ca> Resent-From: "Collin J. Doering" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 19 Nov 2021 20:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51981 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 51981@debbugs.gnu.org Received: via spool by 51981-submit@debbugs.gnu.org id=B51981.163735428825577 (code B ref 51981); Fri, 19 Nov 2021 20:39:01 +0000 Received: (at 51981) by debbugs.gnu.org; 19 Nov 2021 20:38:08 +0000 Received: from localhost ([127.0.0.1]:40625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moAe7-0006eT-Ky for submit@debbugs.gnu.org; Fri, 19 Nov 2021 15:38:07 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:38759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moAe6-0006e0-Oe for 51981@debbugs.gnu.org; Fri, 19 Nov 2021 15:38:07 -0500 Received: by mail-qv1-f42.google.com with SMTP id a24so7942096qvb.5 for <51981@debbugs.gnu.org>; Fri, 19 Nov 2021 12:38:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rekahsoft.ca; s=google; h=user-agent:from:to:subject:date:message-id:mime-version; bh=lpVfeW0sCsA8Kz2dra1X63GLrzo+ZGZs7Crh8ktfZDQ=; b=jMb7nuZ+ymebVhdneh95/QFvFNjUVi9Ii6PIyMcb69TTBsfMTbfE+fljFDzt5iVIY+ ikCtC3Udtl9B5Yx/ePgQsUngLfowdWSJnZMOdQ5K3D6kusEYLGB5I2IXZp2De69odFrk fBlxMUMUVlzQ3cEplkj7BnaAaKX6s3Y01ua44SlWHbnrOZqQehIkPQ8IDMmzay/eVfgV 8EDf9yQvezacCOMH3qcM8APHfnTbhK6GTfrs+b308K6bTmn/GaLYXs0wEKcMBZcOH9yd YYapiqM9z34bn/n11ubW9FWAgUQWcA5G31YlcSFb2HR1Ht04zp3ECRT4pc/EaIDdYup7 ouKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=lpVfeW0sCsA8Kz2dra1X63GLrzo+ZGZs7Crh8ktfZDQ=; b=ee1kwt/aiFtOFJjkmZdof7VDzVfUEjAs0KE7uUdYR6Kjis8U6pqgaMjXVpQTMfqXBB VVxy1PcUCgS2zvM+VJNHrYSYcE0X7tXr8zYpgOOLSqLABPGADExIcJUstT4WzOaUf4PI CGItV4icJ6hrORx5+3N4fjUuJcSQVGsUAvI14ozXRx7m/s24+tK+nhncPTQkfwSRn5mP oqEmEc70I529EyZrHJu8sc1Xl/0EEwvhkLpUaDbPTD3fwhoAJlhHpdUIpJ7NUw42m1pL i9QXK1nPxd/MEvBl9I0fJIdZX6qU8J8mO4ytYJlLAyaGAkzeEk3ZiVSeTuJeiSZuEOpF u2Yw== X-Gm-Message-State: AOAM533DTi6h+1iV7M8GFlSuF976DBTs0jj2EVKTczCpQYtD3Jwzr2Oo Ny26xRkLKedfBGP6PNCUJuHcJ9MM+UdyoA== X-Google-Smtp-Source: ABdhPJwCpEc3w9BHyW77Kf9ppZq2Gbmh6TY3xmUMjw45N38iEdMVHVdL6RarQGiw2eE2qk6ThURcXA== X-Received: by 2002:ad4:5aa1:: with SMTP id u1mr78360148qvg.44.1637354280819; Fri, 19 Nov 2021 12:38:00 -0800 (PST) Received: from rekahsoft-work (cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com. [99.255.210.233]) by smtp.gmail.com with ESMTPSA id o5sm368676qkl.50.2021.11.19.12.38.00 for <51981@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 12:38:00 -0800 (PST) User-agent: mu4e 1.6.10; emacs 27.2 From: "Collin J. Doering" Date: Fri, 19 Nov 2021 15:37:34 -0500 Message-ID: <877dd36fvc.fsf@rekahsoft.ca> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- guix/build/go-build-system.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 4768ee8562..f36e98f47a 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -148,7 +148,6 @@ (define* (setup-go-environment #:key inputs outputs goos goarch #:allow-other-ke ;; currently support modules, so turn modules off to continue using the old ;; GOPATH behavior. (setenv "GO111MODULE" "off") - (setenv "GOBIN" (string-append (assoc-ref outputs "out") "/bin")) ;; Make sure we're building for the correct architecture and OS targets ;; that Guix targets. @@ -234,14 +233,19 @@ (define (go-inputs inputs) (_ #f)) inputs)))) -(define* (build #:key import-path build-flags #:allow-other-keys) +(define* (build #:key outputs import-path build-flags #:allow-other-keys) "Build the package named by IMPORT-PATH." (with-throw-handler #t (lambda _ - (apply invoke "go" "install" + (apply invoke "go" "build" "-v" ; print the name of packages as they are compiled "-x" ; print each command as it is invoked + ;; Set the output path for the build + (string-append "-o=" + (assoc-ref outputs "out") "/bin/" + (package-name->name+version + (strip-store-file-name (assoc-ref outputs "out")))) ;; Respectively, strip the symbol table and debug ;; information, and the DWARF symbol table. "-ldflags=-s -w"