[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
126/169: gnu: build/go: Apply default 'fix-embed-files phase.
From: |
guix-commits |
Subject: |
126/169: gnu: build/go: Apply default 'fix-embed-files phase. |
Date: |
Thu, 26 Sep 2024 06:43:01 -0400 (EDT) |
sharlatan pushed a commit to branch go-team
in repository guix.
commit 7078606ebc2af894335417db270e99d69f835e45
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Thu Sep 19 14:00:56 2024 +0100
gnu: build/go: Apply default 'fix-embed-files phase.
These changes remove redundant phases where files, requiring to be embed
during build or check phases, are copied to the build directory as
proposed in <https://issues.guix.gnu.org/73299>.
* gnu/packages/backup.scm (restic-rest-server) [arguments]: <#:phases>:
Remove 'fix-embed-files phase.
* gnu/packages/configuration-management.scm (chezmoi): Likewise.
* gnu/packages/packages/golang-build.scm (go-github-com-golang-protobuf):
Likewise.
* gnu/packages/golang-web.scm (go-github-com-go-openapi-loads,
go-github-com-go-openapi-runtime, go-github-com-golang-groupcache):
Likewise.
* gnu/packages/golang-xyz.scm (go-github-com-dgraph-io-badger): Likewise.
* gnu/packages/golang.scm (go-github-com-ssgelm-cookiejarparser): Likewise.
* gnu/packages/ipfs.scm (go-github-com-ipfs-go-ds-badger,
go-github-com-libp2p-go-libp2p, kubo): Likewise.
* gnu/packages/irc.scm (soju): Likewise.
* gnu/packages/networking.scm (nebula): Likewise.
* gnu/packages/prometheus.scm (go-github-com-nbrownus-go-metrics-prometheus,
go-github-com-prometheus-client-golang, go-github-com-prometheus-common,
go-github-com-prometheus-common-sigv4,
go-github-com-prometheus-exporter-toolkit,
go-github-com-prometheus-statsd-exporter): Likewise
* gnu/packages/version-control.scm (git-lfs): Likewise.
* gnu/packages/web.scm (miniflux): Likewise.
* gnu/packages/golang-crypto.scm (go-filippo-io-age): [arguments]:
<#:phases>: Remove 'copy-input-to-vendor-direcotyr and
'remove-vendor-directory phases.
* gnu/packages/golang-web.scm (go-github-com-go-openapi-analysis,
go-github-com-go-openapi-analysis, go-github-com-go-openapi-validate):
Likewise.
* gnu/packages/golang.scm (go-github-com-charmbracelet-glamour): Likewise.
* gnu/packages/textutils.scm (vale): Likewise.
Change-Id: Ic2ec01c8caf86f3ae69d7a1812c1e0b78a549e91
---
gnu/packages/backup.scm | 18 ----
gnu/packages/configuration-management.scm | 21 +----
gnu/packages/golang-build.scm | 18 ----
gnu/packages/golang-crypto.scm | 31 +------
gnu/packages/golang-web.scm | 133 ++----------------------------
gnu/packages/golang-xyz.scm | 84 +------------------
gnu/packages/golang.scm | 39 +--------
gnu/packages/ipfs.scm | 69 +---------------
gnu/packages/irc.scm | 18 ----
gnu/packages/networking.scm | 18 ----
gnu/packages/prometheus.scm | 122 +--------------------------
gnu/packages/textutils.scm | 27 +-----
gnu/packages/version-control.scm | 8 +-
gnu/packages/web.scm | 18 ----
14 files changed, 31 insertions(+), 593 deletions(-)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 025398888f..0973c5ddca 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -1058,24 +1058,6 @@ precious backup space.
#:unpack-path "github.com/restic/rest-server"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
;; Unit tests seems to break with Guix' non-standard TMPDIR.
(add-before 'check 'set-tmpdir
(lambda _
diff --git a/gnu/packages/configuration-management.scm
b/gnu/packages/configuration-management.scm
index 6d81f0dcac..b654975a42 100644
--- a/gnu/packages/configuration-management.scm
+++ b/gnu/packages/configuration-management.scm
@@ -50,6 +50,7 @@
(arguments
(list
#:import-path "github.com/twpayne/chezmoi"
+ #:embed-files #~(list ".*\\.xml")
#:install-source? #f
#:phases
#~(modify-phases %standard-phases
@@ -80,25 +81,7 @@
"secretkeepassxc.txt"
"secretlastpass.txt"
"secretonepassword.txt"
- "secretpass.txt"))))
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append "\\.xml$"))))))))
+ "secretpass.txt")))))))
(native-inputs
(list go-github-com-masterminds-sprig-v3
go-github-com-bmatcuk-doublestar-v2
diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm
index 8fdd652b63..7049acf8c2 100644
--- a/gnu/packages/golang-build.scm
+++ b/gnu/packages/golang-build.scm
@@ -103,24 +103,6 @@ functions that have a name matched by regex:.")
#:import-path "github.com/golang/protobuf"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Workaround for go-build-system's lack of Go modules
;; support.
(delete 'build)
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index 016592e776..9a845612a3 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -137,33 +137,10 @@ can be ignored.")
(build-system go-build-system)
(arguments
(list
- #:import-path "filippo.io/age"
- #:phases
- #~(modify-phases %standard-phases
- ;; FIXME: src/c2sp.org/CCTV/age/age.go:13:12: pattern testdata:
- ;; cannot embed directory testdata: contains no embeddable files
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-native-input "go-c2sp-org-cctv-age")
- "/src/c2sp.org")
- "vendor/c2sp.org"))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (delete-file-recursively "vendor")))))))
+ #:embed-files #~(list "armor.*" "header_crlf" "hmac_.*" "scrypt.*"
+ "stanza_.*" "stream_.*" "version_unsupported"
+ "x25519.*" "x25519_.*")
+ #:import-path "filippo.io/age"))
(native-inputs
(list go-c2sp-org-cctv-age
go-github-com-rogpeppe-go-internal))
diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm
index ff5d51f3ca..13cb59a65e 100644
--- a/gnu/packages/golang-web.scm
+++ b/gnu/packages/golang-web.scm
@@ -1545,6 +1545,7 @@ language.")
(build-system go-build-system)
(arguments
(list
+ #:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
#:import-path "github.com/go-openapi/analysis"
#:phases
#~(modify-phases %standard-phases
@@ -1555,35 +1556,11 @@ language.")
;; Tests requiring network access.
(("TestFlatten_RemoteAbsolute")
"OffTestFlatten_RemoteAbsolute")))))
- ;; FIXME: pattern schemas/*.json: cannot embed irregular file
- ;; schemas/jsonschema-draft-04.json
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-go-openapi-spec")
- "/src/github.com")
- "vendor/github.com"))))
(replace 'check
(lambda* (#:key tests? import-path #:allow-other-keys)
(when tests?
(with-directory-excursion (string-append "src/" import-path)
- (invoke "go" "test" "-v" "./...")))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (delete-file-recursively "vendor")))))))
+ (invoke "go" "test" "-v" "./..."))))))))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -1698,28 +1675,8 @@ prototyped in
@url{https://github.com/xeipuuv/gojsonreference}.")
(build-system go-build-system)
(arguments
(list
- #:import-path "github.com/go-openapi/loads"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src"
-
"^(jsonschema-draft-04|schema)\\.json$")))))))
+ #:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
+ #:import-path "github.com/go-openapi/loads"))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -1751,27 +1708,8 @@ Supports JSON and YAML documents.")
(build-system go-build-system)
(arguments
(list
- #:import-path "github.com/go-openapi/runtime"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" "\\.json$")))))))
+ #:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
+ #:import-path "github.com/go-openapi/runtime"))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -1906,6 +1844,7 @@ projects.")
(build-system go-build-system)
(arguments
(list
+ #:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
#:import-path "github.com/go-openapi/validate"
#:phases
#~(modify-phases %standard-phases
@@ -1916,41 +1855,7 @@ projects.")
(for-each delete-file
(list "benchmark_test.go"
"example_validator_test.go"
- "doc_test.go")))))
- ;; FIXME: pattern schemas/*.json: cannot embed irregular file
- ;; schemas/jsonschema-draft-04.json
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-go-openapi-loads")
- "/src/github.com")
- "vendor/github.com")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-go-openapi-spec")
- "/src/github.com")
- "vendor/github.com")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-go-openapi-analysis")
- "/src/github.com")
- "vendor/github.com"))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (delete-file-recursively "vendor")))))))
+ "doc_test.go"))))))))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -2118,27 +2023,7 @@ from CloudFlare's github.com/cloudflare/cfssl/revoke.")
(build-system go-build-system)
(arguments
(list
- #:import-path "github.com/golang/groupcache"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$")))))))
+ #:import-path "github.com/golang/groupcache"))
(propagated-inputs
(list go-github-com-golang-protobuf))
(home-page "https://github.com/golang/groupcache")
diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index 3cb3d08f1c..7ffdd1ca39 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -2087,25 +2087,6 @@ encoding/decoding. It has no dependencies.")
#:import-path "github.com/dgraph-io/badger"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append
- ".*(editions_defaults.binpb)$")))))
(add-after 'unpack 'patch-failing-tests
(lambda* (#:key unpack-path tests? #:allow-other-keys)
(with-directory-excursion (string-append "src/" unpack-path)
@@ -4518,24 +4499,6 @@ allocator. This is primarily useful for long lived
buffers that usually sit emp
#:import-path "github.com/libp2p/go-msgio"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Replace when go-build-system supports nested path.
(replace 'check
(lambda* (#:key import-path tests? #:allow-other-keys)
@@ -5087,24 +5050,6 @@ other directories. It is optimized for filewalking.")
#:import-path "github.com/matttproud/golang_protobuf_extensions/v2"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Activate when go-build-system supports submodules.
(delete 'build)
;; XXX: Replace when go-build-system supports nested path.
@@ -5699,33 +5644,8 @@ list of sentences.")
(build-system go-build-system)
(arguments
(list
- #:import-path "github.com/niklasfasching/go-org"
- #:phases
- #~(modify-phases %standard-phases
- ;; FIXME: Pattern embedded: cannot embed directory embedded:
- ;; contains no embeddable files.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-alecthomas-chroma-v2")
- "/src/github.com")
- "vendor/github.com"))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (delete-file-recursively "vendor")))))))
+ #:embed-files #~(list ".*\\.xml")
+ #:import-path "github.com/niklasfasching/go-org"))
(propagated-inputs
(list go-golang-org-x-net
go-github-com-pmezard-go-difflib
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 9c941abe8f..da5eb30778 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5872,6 +5872,7 @@ size of the terminal.")
(build-system go-build-system)
(arguments
(list
+ #:embed-files #~(list ".*\\.xml")
#:import-path "github.com/charmbracelet/glamour"
#:phases
#~(modify-phases %standard-phases
@@ -5885,31 +5886,7 @@ size of the terminal.")
#o644)
(substitute*
"src/github.com/charmbracelet/glamour/glamour_test.go"
((" generate = false")
- " generate = true"))))
- ;; FIXME: Pattern embedded: cannot embed directory embedded:
- ;; contains no embeddable files.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-input "go-github-com-alecthomas-chroma-v2")
- "/src/github.com")
- "vendor/github.com"))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (delete-file-recursively "vendor")))))))
+ " generate = true")))))))
(propagated-inputs
(list go-github-com-alecthomas-chroma-v2
go-github-com-microcosm-cc-bluemonday
@@ -7736,16 +7713,8 @@ of the current user.")
(build-system go-build-system)
(arguments
(list
- #:import-path "github.com/ssgelm/cookiejarparser"
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'unpack 'fix-embed-x-net
- (lambda _
- (delete-file-recursively
"src/golang.org/x/net/publicsuffix/data")
- (copy-recursively
- #$(file-append (this-package-input "go-golang-org-x-net")
- "/src/golang.org/x/net/publicsuffix/data")
- "src/golang.org/x/net/publicsuffix/data"))))))
+ #:embed-files #~(list "children" "nodes" "text")
+ #:import-path "github.com/ssgelm/cookiejarparser"))
(propagated-inputs (list go-golang-org-x-net))
(home-page "https://github.com/ssgelm/cookiejarparser")
(synopsis "Parse a curl cookiejar with Go")
diff --git a/gnu/packages/ipfs.scm b/gnu/packages/ipfs.scm
index d8dd8676fb..52e54a7052 100644
--- a/gnu/packages/ipfs.scm
+++ b/gnu/packages/ipfs.scm
@@ -385,27 +385,7 @@ throughout its lifetime.")
(list
;; XXX: Tests time out, figure out workaround.
#:tests? #f
- #:import-path "github.com/ipfs/go-ds-badger"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$")))))))
+ #:import-path "github.com/ipfs/go-ds-badger"))
(propagated-inputs
(list go-github-com-dgraph-io-badger
go-github-com-ipfs-go-datastore
@@ -885,30 +865,8 @@ their levels to be controlled individually.")
(build-system go-build-system)
(arguments
(list
- #:import-path "github.com/libp2p/go-libp2p"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each
- (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append
- ".*(editions_defaults.binpb"
- "|sorted-network-list.bin)$"))))))))
+ #:embed-files #~(list "sorted-network-list.bin")
+ #:import-path "github.com/libp2p/go-libp2p"))
(propagated-inputs
(list go-github-com-benbjohnson-clock
go-github-com-davidlazar-go-crypto
@@ -1129,30 +1087,11 @@ types.")
(build-system go-build-system)
(arguments
(list
+ #:embed-files #~(list "sorted-network-list.bin")
#:unpack-path "github.com/ipfs/kubo"
#:import-path "github.com/ipfs/kubo/cmd/ipfs"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append
- ".*(editions_defaults.binpb"
- "|sorted-network-list.bin)$")))))
;;
https://github.com/ipfs/kubo/blob/master/docs/command-completion.md
(add-after 'install 'install-bashcompletion
(lambda _
diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 4b1ff47803..c1c35691cd 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -1114,24 +1114,6 @@ what.")
#:import-path "codeberg.org/emersion/soju"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
(add-after 'unpack 'adjust-makefile
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index ac8ad2ecc8..d0949618da 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -4762,24 +4762,6 @@ IPv6 Internet connectivity - it also works over IPv4.")
#:install-source? #f
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
(replace 'build
(lambda* (#:key import-path #:allow-other-keys)
;; Suggested option to provide build time flags is not supported
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm
index fe2fa18e95..3e3a51b805 100644
--- a/gnu/packages/prometheus.scm
+++ b/gnu/packages/prometheus.scm
@@ -112,27 +112,7 @@ x/net/trace)} tracing wrappers @code{net.Conn}, both
inbound
;; The project looks abandoned, tests failed with a new go-metrics, see
;; <https://github.com/nbrownus/go-metrics-prometheus/pull/2>.
#:tests? #f
- #:import-path "github.com/nbrownus/go-metrics-prometheus"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$")))))))
+ #:import-path "github.com/nbrownus/go-metrics-prometheus"))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -169,25 +149,6 @@ registry.")
#:import-path "github.com/prometheus/client_golang"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append
- ".*(editions_defaults.binpb)$")))))
(add-after 'unpack 'remove-examples-and-tutorials
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
@@ -278,25 +239,6 @@ Prometheus metrics.")
#:import-path "github.com/prometheus/common"
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append
- ".*(editions_defaults.binpb)$")))))
;; XXX: Workaround for go-build-system's lack of Go modules support.
(delete 'build)
(replace 'check
@@ -408,27 +350,7 @@ metrics.")
(arguments
(list
#:import-path "github.com/prometheus/common/sigv4"
- #:unpack-path "github.com/prometheus/common"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$")))))))
+ #:unpack-path "github.com/prometheus/common"))
(native-inputs
(list go-github-com-stretchr-testify))
(propagated-inputs
@@ -463,22 +385,6 @@ from the default AWS credential chain.")
#:import-path "github.com/prometheus/exporter-toolkit"
#:phases
#~(modify-phases %standard-phases
- (add-after 'unpack 'fix-embed-editions-defaults-binpb
- (lambda _
- (let* ((import-path "google.golang.org/protobuf")
- (subdir "internal/editiondefaults")
- (embed-file "editions_defaults.binpb")
- (embed-file-path
- (string-append "src/"
- import-path "/"
- subdir "/"
- embed-file)))
- (delete-file-recursively embed-file-path)
- (copy-file
- (string-append
- #$(this-package-native-input "go-google-golang-org-protobuf")
- "/" embed-file-path)
- embed-file-path))))
;; XXX: Workaround for go-build-system's lack of Go modules support.
(delete 'build)
(replace 'check
@@ -572,29 +478,7 @@ kernel, and process metrics from the @file{/proc} pseudo
file system.")
(arguments
(list
#:import-path "github.com/prometheus/statsd_exporter"
- #:phases
- #~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" (string-append
- ".*(editions_defaults.binpb"
- "|landing_page.css"
- "|landing_page.html)$"))))))))
+ #:embed-files #~(list "landing_page.css" "landing_page.html")))
(native-inputs
(list go-github-com-stvp-go-udp-testing))
(propagated-inputs
diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index deebd893d6..22a40866c9 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -1517,6 +1517,7 @@ of a Unix terminal to HTML code.")
(arguments
(list
#:install-source? #f
+ #:embed-files #~(list ".*\\.gob")
#:import-path "github.com/errata-ai/vale/cmd/vale"
#:unpack-path "github.com/errata-ai/vale"
#:phases
@@ -1536,26 +1537,6 @@ of a Unix terminal to HTML code.")
(("TestLocalZip") "OffTestLocalZip")
(("TestNoPkgFound") "OffTestNoPkgFound")
(("TestV3Pkg") "OffTestV3Pkg")))))
- ;; FIXME: Pattern embedded: cannot embed directory embedded:
- ;; contains no embeddable files.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module which is sourced during setup environment phase, but
- ;; easy resolved after coping to expected directory "vendor" within
- ;; the current package, see details in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-before 'build 'copy-input-to-vendor-directory
- (lambda* (#:key unpack-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" unpack-path)
- (mkdir "vendor")
- (copy-recursively
- (string-append
- #$(this-package-native-input "go-github-com-jdkato-twine")
- "/src/github.com")
- "vendor/github.com"))))
;; XXX: Workaround for go-build-system's lack of Go modules
;; support.
(replace 'check
@@ -1563,11 +1544,7 @@ of a Unix terminal to HTML code.")
(when tests?
(with-directory-excursion (string-append "src/" unpack-path)
(setenv "HOME" "/tmp")
- (invoke "go" "test" "-v" "./...")))))
- (add-before 'install 'remove-vendor-directory
- (lambda* (#:key unpack-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" unpack-path)
- (delete-file-recursively "vendor")))))))
+ (invoke "go" "test" "-v" "./..."))))))))
(native-inputs
(list go-github-com-masterminds-sprig-v3
go-github-com-adrg-strutil
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index ac0c60404d..8b03746c93 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -3595,6 +3595,7 @@ will reconstruct the object along its delta-base chain
and return it.")
(build-system go-build-system)
(arguments
(list
+ #:embed-files #~(list "children" "nodes" "text")
#:import-path "github.com/git-lfs/git-lfs"
#:install-source? #f
#:phases
@@ -3604,13 +3605,6 @@ will reconstruct the object along its delta-base chain
and return it.")
(substitute* "src/github.com/git-lfs/git-lfs/lfs/hook.go"
(("/bin/sh")
(search-input-file inputs "bin/sh")))))
- (add-after 'unpack 'fix-embed-x-net
- (lambda _
- (delete-file-recursively
"src/golang.org/x/net/publicsuffix/data")
- (copy-recursively
- #$(file-append (this-package-input "go-golang-org-x-net")
- "/src/golang.org/x/net/publicsuffix/data")
- "src/golang.org/x/net/publicsuffix/data")))
;; Only build the man pages if ruby-asciidoctor is available.
#$@(if (this-package-native-input "ruby-asciidoctor")
#~((add-before 'build 'man-gen
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 5be742ee21..5d8f043355 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -367,24 +367,6 @@ and its related documentation.")
#$version))
#:phases
#~(modify-phases %standard-phases
- ;; TODO: Implement it in go-build-system.
- ;;
- ;; This happens due to Golang can't determine the valid directory of
- ;; the module of embed file which is symlinked during setup
- ;; environment phase, but easy resolved after coping file from the
- ;; store to the build directory of the current package, see details
- ;; in Golang source:
- ;;
- ;; - URL: <https://github.com/golang/go/blob/>
- ;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
- ;; - file: src/cmd/go/internal/load/pkg.go#L2059
- (add-after 'unpack 'fix-embed-files
- (lambda _
- (for-each (lambda (file)
- (let ((file-store-path (readlink file)))
- (delete-file file)
- (copy-recursively file-store-path file)))
- (find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Replace when go-build-system supports nested path.
(replace 'check
(lambda* (#:key import-path tests? #:allow-other-keys)
- 151/169: gnu: go-github-com-emersion-go-autostart: Move to golang-xyz., (continued)
- 151/169: gnu: go-github-com-emersion-go-autostart: Move to golang-xyz., guix-commits, 2024/09/26
- 148/169: gnu: trezord: Refresh package style., guix-commits, 2024/09/26
- 161/169: gnu: Add go-github-com-caarlos0-testfs., guix-commits, 2024/09/26
- 163/169: gnu: Add go-github-com-goreleaser-fileglob., guix-commits, 2024/09/26
- 162/169: gnu: Add go-github-com-matryer-is., guix-commits, 2024/09/26
- 165/169: gnu: go-github-com-tekwizely-go-parsing: Adjust description., guix-commits, 2024/09/26
- 168/169: gnu: go-github-com-subosito-gotenv: Move to golang-xyz., guix-commits, 2024/09/26
- 123/169: gnu: nebula: Fix build., guix-commits, 2024/09/26
- 133/169: gnu: go-github-com-shadowsocks-go-shadowsocks2: Update to 0.1.5., guix-commits, 2024/09/26
- 122/169: gnu: go-github-com-nbrownus-go-metrics-prometheus: Fix build., guix-commits, 2024/09/26
- 126/169: gnu: build/go: Apply default 'fix-embed-files phase.,
guix-commits <=
- 141/169: gnu: go-github-com-smartystreets-goconvey: Update to v1.8.1., guix-commits, 2024/09/26
- 149/169: gnu: Add go-github-com-cretz-bine., guix-commits, 2024/09/26
- 159/169: gnu: go-github-com-dustin-go-humanize: Move to golang-xyz., guix-commits, 2024/09/26
- 166/169: gnu: go-github-com-tekwizely-go-parsing: Move to golang-xyz., guix-commits, 2024/09/26
- 40/169: gnu: go-github-com-prometheus-common: Fix build., guix-commits, 2024/09/26
- 72/169: gnu: go-github-com-google-uuid: Move to golang-build., guix-commits, 2024/09/26
- 80/169: gnu: go-github-com-go-git-go-git-fixtures: Update to 4.3.1., guix-commits, 2024/09/26
- 116/169: gnu: Add go-msgp., guix-commits, 2024/09/26
- 119/169: gnu: soju: Fix build., guix-commits, 2024/09/26
- 129/169: gnu: Add go-github-com-workiva-go-datastructures., guix-commits, 2024/09/26