guix-commits
[Top][All Lists]
Advanced

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

03/04: build-system/go: Use gccgo when go isn't supported.


From: guix-commits
Subject: 03/04: build-system/go: Use gccgo when go isn't supported.
Date: Sat, 28 Oct 2023 15:04:33 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit 84fbfa82af73ee156441935fbc1fa27e017cda90
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Fri Oct 27 21:24:17 2023 +0300

    build-system/go: Use gccgo when go isn't supported.
    
    * guix/build-system/go.scm (default-gccgo): New variable.
    (lower): Only use default-go when it is supported.
    
    Change-Id: I30564d97703344df582accaf741f4fcd159b6be1
---
 guix/build-system/go.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 0a9761aac7..0934fded07 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -114,12 +114,19 @@ commit hash and its date rather than a proper release 
tag."
   (let ((go (resolve-interface '(gnu packages golang))))
     (module-ref go 'go)))
 
+(define (default-gccgo)
+  ;; Lazily resolve the binding to avoid a circular dependency.
+  (let ((gcc (resolve-interface '(gnu packages gcc))))
+    (module-ref gcc 'gccgo-12)))
+
 (define (make-go-std)
   (module-ref (resolve-interface '(gnu packages golang)) 'make-go-std))
 
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
-                (go (default-go))
+                (go (if (supported-package? (default-go))
+                      (default-go)
+                      (default-gccgo)))
                 #:allow-other-keys
                 #:rest arguments)
   "Return a bag for NAME."



reply via email to

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