From patchwork Tue Sep 13 11:01:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 42581 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 4424C27BBEA; Tue, 13 Sep 2022 12:07:55 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A2E4B27BBE9 for ; Tue, 13 Sep 2022 12:07:54 +0100 (BST) Received: from localhost ([::1]:40070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY3lh-00011v-Oe for patchwork@mira.cbaines.net; Tue, 13 Sep 2022 07:07:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY3h0-0007sq-7y for guix-patches@gnu.org; Tue, 13 Sep 2022 07:03:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oY3g2-0002o5-Fp for guix-patches@gnu.org; Tue, 13 Sep 2022 07:02:16 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oY3g2-00089v-3U for guix-patches@gnu.org; Tue, 13 Sep 2022 07:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57766] [PATCH] build-system: go: Respect #:imported-modules when cross-compiling. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Sep 2022 11:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57766@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166306688531313 (code B ref -1); Tue, 13 Sep 2022 11:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Sep 2022 11:01:25 +0000 Received: from localhost ([127.0.0.1]:48996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY3fQ-00088z-Fv for submit@debbugs.gnu.org; Tue, 13 Sep 2022 07:01:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:35772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY3fL-00088n-5S for submit@debbugs.gnu.org; Tue, 13 Sep 2022 07:01:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY3fK-0007YH-Ew for guix-patches@gnu.org; Tue, 13 Sep 2022 07:01:18 -0400 Received: from albert.telenet-ops.be ([2a02:1800:110:4::f00:1a]:58500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oY3fI-0002Zu-0q for guix-patches@gnu.org; Tue, 13 Sep 2022 07:01:18 -0400 Received: from localhost.localdomain ([188.188.237.141]) by albert.telenet-ops.be with bizsmtp id KP172800R33jvW406P19Yh; Tue, 13 Sep 2022 13:01:10 +0200 From: Maxime Devos Date: Tue, 13 Sep 2022 13:01:05 +0200 Message-Id: <20220913110105.10443-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1663066870; bh=G3GJJuYdzc0c5BMqPBL8gMYIs2zJ4HVbNMhkAQmSQ9E=; h=From:To:Cc:Subject:Date; b=i4iutcy3u8JdGPcarYxDLarGTT4KTD5MLRWJpH83puFCxRUM86sc7wDrnvZSc5+xC FfNxNUx6QYTCDXQ6GiYQFMqqHJUOgeQr6epgZOa0QICjZ23MP0uoRK1i/7QjOfrb0E TM5lIAEPaTJGJ5qoz2D72khmo5D88twKD0v5GifJbuWXvtLBOvAcuAiWn8mEhEVL76 nbrZlwOCrHQbkUj6Czb09hZb3Cpo2MqNB3VvZyFjcWy1cUJD9t1eBm5EoOrkkxwmiE cObpZTXnfUYeb+qb+9pVlX17JXCsQDcBPi6AB8juAJi+OZVZiBecixkS7hEGZ+rKsY mCkX2SC0AKQUg== Received-SPF: pass client-ip=2a02:1800:110:4::f00:1a; envelope-from=maximedevos@telenet.be; helo=albert.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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 Previously, #:imported-modules was ignored, causing cross-compilation failures. This bug seems seems to have been introduced in e37dcf63dcea0817ffd74722ee5ff2d103aa2157. After this commit, there remain other cross-compilation problems, e.g. fixes one of them. * guix/build-system/go.scm (go-cross-build)[builder]: Wrapp in with-imported-modules. --- guix/build-system/go.scm | 67 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 33 deletions(-) base-commit: a44e08337d15b3f254a35d0311663c2bbd501852 prerequisite-patch-id: 0caac311875ee39cb48573657ebb960e90da6dfb prerequisite-patch-id: 418285493d89ebf102175902d9b09a0174e88190 prerequisite-patch-id: 3c39eb839d9d3ff3fca6cd98621a5d5c411b7af4 prerequisite-patch-id: 8d5662e874c469f5ee496ef5181cf2d0a30ad1d8 prerequisite-patch-id: 26513c3b3b86963df718ee41d14a25d1cc6a8f3f prerequisite-patch-id: 2b2497e2edec0afc48ebadd6f09f0c661c466127 prerequisite-patch-id: 2712efb97bf33985fd0658e4dd8e936dc08be5fe prerequisite-patch-id: 9d2409b480a8bff0fef029b4b095922d4957e06f prerequisite-patch-id: 51a32abca3efec1ba67ead59b8694c5ea3129ad3 prerequisite-patch-id: 7d55e3b39eb8803f058857d4412796b3f5dc0856 diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 5e0e5bbad3..4b3b67b08f 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -240,45 +240,46 @@ (define* (go-cross-build name (substitutable? #t)) "Cross-build NAME using GO, where TARGET is a GNU triplet and with INPUTS." (define builder - #~(begin - (use-modules #$@(sexp->gexp modules)) + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) - (define %build-host-inputs - #+(input-tuples->gexp build-inputs)) + (define %build-host-inputs + #+(input-tuples->gexp build-inputs)) - (define %build-target-inputs - (append #$(input-tuples->gexp host-inputs) + (define %build-target-inputs + (append #$(input-tuples->gexp host-inputs) #+(input-tuples->gexp target-inputs))) - (define %build-inputs - (append %build-host-inputs %build-target-inputs)) + (define %build-inputs + (append %build-host-inputs %build-target-inputs)) - (define %outputs - #$(outputs->gexp outputs)) + (define %outputs + #$(outputs->gexp outputs)) - (go-build #:name #$name - #:source #+source - #:system #$system - #:phases #$phases - #:outputs %outputs - #:target #$target - #:goarch #$goarch - #:goos #$goos - #:inputs %build-target-inputs - #:native-inputs %build-host-inputs - #:search-paths '#$(map search-path-specification->sexp - search-paths) - #:native-search-paths '#$(map - search-path-specification->sexp - native-search-paths) - #:install-source? #$install-source? - #:import-path #$import-path - #:unpack-path #$unpack-path - #:build-flags #$build-flags - #:tests? #$tests? - #:make-dynamic-linker-cache? #f ;cross-compiling - #:allow-go-reference? #$allow-go-reference? - #:inputs %build-inputs))) + (go-build #:name #$name + #:source #+source + #:system #$system + #:phases #$phases + #:outputs %outputs + #:target #$target + #:goarch #$goarch + #:goos #$goos + #:inputs %build-target-inputs + #:native-inputs %build-host-inputs + #:search-paths '#$(map search-path-specification->sexp + search-paths) + #:native-search-paths '#$(map + search-path-specification->sexp + native-search-paths) + #:install-source? #$install-source? + #:import-path #$import-path + #:unpack-path #$unpack-path + #:build-flags #$build-flags + #:tests? #$tests? + #:make-dynamic-linker-cache? #f ;cross-compiling + #:allow-go-reference? #$allow-go-reference? + #:inputs %build-inputs)))) (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f)))