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
This commit is contained in:
Sharlatan Hellseher 2025-09-12 10:04:58 +01:00
parent 44ff5565c2
commit db4a1c0756
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -1143,45 +1143,25 @@ time.")
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
;; gopls versions are tagged separately, and it is a ;; Submodules with their own go.mod files and packaged separately:
;; separate Guix package. ;;
(delete-file-recursively "gopls"))))) ;; - 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) (build-system go-build-system)
(arguments (arguments
(list (list
#:skip-build? #t
#:import-path "golang.org/x/tools" #:import-path "golang.org/x/tools"
#:phases #:test-subdirs
#~(modify-phases %standard-phases #~(list "./blog/..."
;; 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/..." "./container/..."
"./copyright/..." "./copyright/..."
"./cover/..." "./cover/..."
"./go/ast/..." "./go/ast/..."
"./go/buildutil/..." "./go/buildutil/..."
"./go/cfg/..." "./go/cfg/..."
"./go/expect/..."
"./go/gccgoexportdata/..." "./go/gccgoexportdata/..."
"./go/gcexportdata/..." "./go/gcexportdata/..."
"./go/internal/..." "./go/internal/..."
@ -1192,18 +1172,18 @@ time.")
"./refactor/importgraph/..." "./refactor/importgraph/..."
"./refactor/rename/..." "./refactor/rename/..."
"./refactor/satisfy/..." "./refactor/satisfy/..."
"./txtar/..." "./txtar/...")
"-skip" #:test-flags
(string-join #~(list "-skip" (string-join
(list (list
;; The GenericPaths test fails with "invalid ;; The GenericPaths test fails with "invalid memory
;; memory address or nil pointer dereference". ;; address or nil pointer dereference".
"TestGenericPaths" "TestGenericPaths"
;; The ordering and paths tests fails because they ;; The ordering and paths tests fails because they
;; can't find test packages (perhaps because we do ;; can't find test packages (perhaps because we do not
;; not support Go modules). ;; support Go modules).
"TestOrdering" "TestPaths") "TestOrdering" "TestPaths")
"|"))))))))) "|"))))
(native-inputs (native-inputs
(list gccgo-14 (list gccgo-14
go-github-com-google-go-cmp)) go-github-com-google-go-cmp))