guix_mirror_bot pushed a commit to branch go-team
in repository guix.

commit 171499be4b4ca46586507876d66229365c40081b
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Fri Sep 12 10:04:58 2025 +0100

    gnu: go-golang-org-x-tools: Simplify.
    
    * gnu/packages/golang-build.scm (go-golang-org-x-tools): Simplify packaging.
    [source] <snippet>: Remove all submodules with their own go.mod file.
    [arguments] <skip-build?>: No go files in project's root.
    <test-subdirs>: Move from custom check here.
    <test-flags>: Likewise.
    <phases>: Preserve 'build; use default 'check.
    
    Change-Id: Ia7a6d074a0d1779a205af34ee605d15a02f08fc9
---
 gnu/packages/golang-build.scm | 98 +++++++++++++++++--------------------------
 1 file changed, 39 insertions(+), 59 deletions(-)

diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm
index 445059447d..f6937b2e4e 100644
--- a/gnu/packages/golang-build.scm
+++ b/gnu/packages/golang-build.scm
@@ -1204,75 +1204,55 @@ time.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://go.googlesource.com/tools";)
-             (commit (string-append "v" version))))
+              (url "https://go.googlesource.com/tools";)
+              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
         (base32 "1lbb4y1c5b4719pdhfcb90sdzagzsb2lw5hx8gizsba3cj0r0f25"))
        (modules '((guix build utils)))
        (snippet
         '(begin
-           ;; gopls versions are tagged separately, and it is a
-           ;; separate Guix package.
-           (delete-file-recursively "gopls")))))
+           ;; Submodules with their own go.mod files and packaged separately:
+           ;;
+           ;; - golang.org/x/tools/cmd/auth
+           ;; - golang.org/x/tools/gopls
+           (delete-file-recursively "gopls")
+           (delete-file-recursively "cmd/auth")))))
     (build-system go-build-system)
     (arguments
      (list
+      #:skip-build? #t
       #:import-path "golang.org/x/tools"
-      #:phases
-      #~(modify-phases %standard-phases
-          ;; XXX: Workaround for go-build-system's lack of Go modules
-          ;; support.
-          (delete 'build)
-          (replace 'check
-            (lambda* (#:key tests? import-path #:allow-other-keys)
-              (when tests?
-                (with-directory-excursion (string-append "src/" import-path)
-                  (invoke "go" "test" "-v"
-                          ;; TODO: They contain final project executable 
builds,
-                          ;; would be packed separately.
-                          ;; - cmd
-                          ;; - godoc
-
-                          ;; FIXME: Figure out why they are failing:
-                          ;; "./go/analysis/..."
-                          ;; "./go/callgraph/..."
-                          ;; "./go/packages/..."
-                          ;; "./go/ssa/..."
-                          ;; "./internal/..."
-                          ;; "./present/..."
-                          ;; "./refactor/eg/..."
-
-                          "./blog/..."  ;
-                          "./container/..."
-                          "./copyright/..."
-                          "./cover/..."
-                          "./go/ast/..."
-                          "./go/buildutil/..."
-                          "./go/cfg/..."
-                          "./go/expect/..."
-                          "./go/gccgoexportdata/..."
-                          "./go/gcexportdata/..."
-                          "./go/internal/..."
-                          "./go/loader/..."
-                          "./go/types/..."
-                          "./imports/..."
-                          "./playground/..."
-                          "./refactor/importgraph/..."
-                          "./refactor/rename/..."
-                          "./refactor/satisfy/..."
-                          "./txtar/..."
-                          "-skip"
-                          (string-join
-                           (list
-                            ;; The GenericPaths test fails with "invalid
-                            ;; memory address or nil pointer dereference".
-                            "TestGenericPaths"
-                            ;; The ordering and paths tests fails because they
-                            ;; can't find test packages (perhaps because we do
-                            ;; not support Go modules).
-                            "TestOrdering" "TestPaths")
-                           "|")))))))))
+      #:test-subdirs
+      #~(list "./blog/..."
+              "./container/..."
+              "./copyright/..."
+              "./cover/..."
+              "./go/ast/..."
+              "./go/buildutil/..."
+              "./go/cfg/..."
+              "./go/gccgoexportdata/..."
+              "./go/gcexportdata/..."
+              "./go/internal/..."
+              "./go/loader/..."
+              "./go/types/..."
+              "./imports/..."
+              "./playground/..."
+              "./refactor/importgraph/..."
+              "./refactor/rename/..."
+              "./refactor/satisfy/..."
+              "./txtar/...")
+      #:test-flags
+      #~(list "-skip" (string-join
+                       (list
+                        ;; The GenericPaths test fails with "invalid memory
+                        ;; address or nil pointer dereference".
+                        "TestGenericPaths"
+                        ;; The ordering and paths tests fails because they
+                        ;; can't find test packages (perhaps because we do not
+                        ;; support Go modules).
+                        "TestOrdering" "TestPaths")
+                       "|"))))
     (native-inputs
      (list gccgo-14
            go-github-com-google-go-cmp))

Reply via email to