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 ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021-2022 Ludovic Courtès -;;; Copyright © 2021 Efraim Flashner +;;; Copyright © 2021, 2023 Efraim Flashner ;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. @@ -114,12 +114,19 @@ (define (default-go) (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."