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

@ -1135,75 +1135,55 @@ time.")
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://go.googlesource.com/tools") (url "https://go.googlesource.com/tools")
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "1lbb4y1c5b4719pdhfcb90sdzagzsb2lw5hx8gizsba3cj0r0f25")) (base32 "1lbb4y1c5b4719pdhfcb90sdzagzsb2lw5hx8gizsba3cj0r0f25"))
(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 "./container/..."
;; support. "./copyright/..."
(delete 'build) "./cover/..."
(replace 'check "./go/ast/..."
(lambda* (#:key tests? import-path #:allow-other-keys) "./go/buildutil/..."
(when tests? "./go/cfg/..."
(with-directory-excursion (string-append "src/" import-path) "./go/gccgoexportdata/..."
(invoke "go" "test" "-v" "./go/gcexportdata/..."
;; TODO: They contain final project executable builds, "./go/internal/..."
;; would be packed separately. "./go/loader/..."
;; - cmd "./go/types/..."
;; - godoc "./imports/..."
"./playground/..."
;; FIXME: Figure out why they are failing: "./refactor/importgraph/..."
;; "./go/analysis/..." "./refactor/rename/..."
;; "./go/callgraph/..." "./refactor/satisfy/..."
;; "./go/packages/..." "./txtar/...")
;; "./go/ssa/..." #:test-flags
;; "./internal/..." #~(list "-skip" (string-join
;; "./present/..." (list
;; "./refactor/eg/..." ;; The GenericPaths test fails with "invalid memory
;; address or nil pointer dereference".
"./blog/..." ; "TestGenericPaths"
"./container/..." ;; The ordering and paths tests fails because they
"./copyright/..." ;; can't find test packages (perhaps because we do not
"./cover/..." ;; support Go modules).
"./go/ast/..." "TestOrdering" "TestPaths")
"./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")
"|")))))))))
(native-inputs (native-inputs
(list gccgo-14 (list gccgo-14
go-github-com-google-go-cmp)) go-github-com-google-go-cmp))