[PATCH] Update direnv to 2.28.0

  • Done
  • quality assurance status badge
Details
2 participants
  • Artem Chernyak
  • Ludovic Courtès
Owner
unassigned
Submitted by
Artem Chernyak
Severity
normal
A
A
Artem Chernyak wrote on 5 Oct 2021 04:23
(address . guix-patches@gnu.org)
CALP7HJsaFG3hnwJnnz+7xdiVZAyRoWK2760Ey3snc3F3qW=LRg@mail.gmail.com
This patch includes an update to direnv. As part of the updated a few
extra changes were necessary to support the new version:

- Addition of go-golang-org-x-mod as a new dependency.
- Removal of the delete-vendor step since direnv no longer depends on
vendor files.
- Removal of the test run. The new tests depend on
https://github.com/golangci/golangci-lintwhich requires a lot of othe
dependencies. Since it's only needed for tests, maybe we can handle it
in a separate patch or once golangci-lint becomes needed in other
places.
From ced4b50ad1dda92e7ba58bebbe702b9dd7a3dae9 Mon Sep 17 00:00:00 2001
From: hackeryarn <artemchernyak@gmail.com>
Date: Mon, 4 Oct 2021 21:08:46 -0500
Subject: [PATCH] Update direnv to 2.28.0

---
gnu/packages/golang.scm | 37 +++++++++++++++++++++++++++++++++++++
gnu/packages/shellutils.scm | 13 +++++--------
2 files changed, 42 insertions(+), 8 deletions(-)

Toggle diff (93 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a96f743f68..3e4e691631 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2669,6 +2669,43 @@ time.")
(home-page "https://godoc.org/golang.org/x/xerrors")
(license license:bsd-3))))
+(define-public go-golang-org-x-mod
+ (let ((commit "0f08993efd8a8ec67e75bcccf86b0e1569b0ab0a")
+ (revision "0"))
+ (package
+ (name "go-golang-org-x-mod")
+ (version (git-version "0.5.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://go.googlesource.com/x/mod")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0pl0jc5jvg7hxj4z66zg6kglnq5g7li09f3k9klwvyr4jx5dw88k"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "golang.org/x/mod/"
+ #:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ ;; Source-only package
+ (delete 'build))))
+ (home-page "https://golang.org/x/mod")
+ (synopsis "Tools to work directly with Go module mechanics")
+ (description
+ "This repository holds packages for writing tools that work directly
+with Go module mechanics. That is, it is for direct manipulation of Go modules
+themselves.
+It is NOT about supporting general development tools that need to do things
+like load packages in module mode. That use case, where modules are incidental
+rather than the focus, should remain in x/tools, specifically
+x/tools/go/packages.
+The specific case of loading packages should still be done by invoking the go
+command, which remains the single point of truth for package loading algorithms.")
+ (license license:bsd-3))))
+
(define-public go-github-com-burntsushi-toml
(package
(name "go-github-com-burntsushi-toml")
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 94b5536df7..a8f0956913 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -239,7 +239,7 @@ are already there.")
(define-public direnv
(package
(name "direnv")
- (version "2.15.2")
+ (version "2.28.0")
(source
(origin (method git-fetch)
(uri (git-reference
@@ -248,18 +248,13 @@ are already there.")
(file-name (git-file-name name version))
(sha256
(base32
- "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
+ "0yk53jn7wafklixclka17wyjjs2g5giigjr2bd0xzy10nrzwp7c9"))))
(build-system go-build-system)
(arguments
'(#:import-path "github.com/direnv/direnv"
+ #:tests? #f ;; TODO fix tests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'delete-vendor
- (lambda _
- ;; Using a snippet causes issues with the name of the directory,
- ;; so delete the extra source code here.
- (delete-file-recursively "src/github.com/direnv/direnv/vendor")
- #t))
(add-after 'install 'install-manpages
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -285,6 +280,8 @@ are already there.")
(native-inputs
`(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
+ ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
+ ("go-golang-org-x-mod" ,go-golang-org-x-mod)
("which" ,which)))
(home-page "https://direnv.net/")
(synopsis "Environment switcher for the shell")
--
2.33.0
L
L
Ludovic Courtès wrote on 13 Oct 2021 11:47
(name . Artem Chernyak)(address . artemchernyak@gmail.com)(address . 51022@debbugs.gnu.org)
87ee8pqmru.fsf@gnu.org
Hi Artem,

Artem Chernyak <artemchernyak@gmail.com> skribis:

Toggle quote (23 lines)
> This patch includes an update to direnv. As part of the updated a few
> From ced4b50ad1dda92e7ba58bebbe702b9dd7a3dae9 Mon Sep 17 00:00:00 2001
> From: hackeryarn <artemchernyak@gmail.com>
> Date: Mon, 4 Oct 2021 21:08:46 -0500
> Subject: [PATCH] Update direnv to 2.28.0
>
> ---
> gnu/packages/golang.scm | 37 +++++++++++++++++++++++++++++++++++++
> gnu/packages/shellutils.scm | 13 +++++--------
> 2 files changed, 42 insertions(+), 8 deletions(-)
>
> diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
> index a96f743f68..3e4e691631 100644
> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm
> @@ -2669,6 +2669,43 @@ time.")
> (home-page "https://godoc.org/golang.org/x/xerrors")
> (license license:bsd-3))))
>
> +(define-public go-golang-org-x-mod
> + (let ((commit "0f08993efd8a8ec67e75bcccf86b0e1569b0ab0a")
> + (revision "0"))

I’ve added this as a separate commit and tweaked the description and the
commit log according to our conventions:


I noticed that source code has disappeared upstream and is instead being
fetched from Software Heritage:

Toggle snippet (30 lines)
$ ./pre-inst-env guix build go-golang-org-x-mod -S --check
The following derivation will be built:
/gnu/store/9rb03xwbdkkvi1zjivilpl011pxw5hwv-go-golang-org-x-mod-0.5.0-0.0f08993-checkout.drv
building /gnu/store/9rb03xwbdkkvi1zjivilpl011pxw5hwv-go-golang-org-x-mod-0.5.0-0.0f08993-checkout.drv...
guile: warning: failed to install locale
environment variable `PATH' set to `/gnu/store/378zjf2kgajcfd7mfr98jn5xyc5wa3qv-gzip-1.10/bin:/gnu/store/sf3rbvb6iqcphgm1afbplcs72hsywg25-tar-1.32/bin'
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /gnu/store/yyy7l1i2g769fsbwb97a9m8i4as549nd-go-golang-org-x-mod-0.5.0-0.0f08993-checkout/.git/
fatal: remote error: Git repository not found
Failed to do a shallow fetch; retrying a full fetch...
fatal: remote error: Git repository not found
git-fetch: '/gnu/store/5vai7bfrfkzv22dx13bxpszjrqyi78x6-git-minimal-2.33.0/bin/git fetch origin' failed with exit code 128
Trying content-addressed mirror at berlin.guix.gnu.org...
Trying content-addressed mirror at berlin.guix.gnu.org...
Trying to download from Software Heritage...
SWH: found revision 0f08993efd8a8ec67e75bcccf86b0e1569b0ab0a with directory at 'https://archive.softwareheritage.org/api/1/directory/0a72c9a9750b330483f510b8224732ecadc1547f/'
swh:1:dir:0a72c9a9750b330483f510b8224732ecadc1547f/
swh:1:dir:0a72c9a9750b330483f510b8224732ecadc1547f/LICENSE
[…]

Is there another URL we should use? (No big deal since it’s archived on
Software Heritage anyway.)

Toggle quote (21 lines)
> +++ b/gnu/packages/shellutils.scm
> @@ -239,7 +239,7 @@ are already there.")
> (define-public direnv
> (package
> (name "direnv")
> - (version "2.15.2")
> + (version "2.28.0")
> (source
> (origin (method git-fetch)
> (uri (git-reference
> @@ -248,18 +248,13 @@ are already there.")
> (file-name (git-file-name name version))
> (sha256
> (base32
> - "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
> + "0yk53jn7wafklixclka17wyjjs2g5giigjr2bd0xzy10nrzwp7c9"))))
> (build-system go-build-system)
> (arguments
> '(#:import-path "github.com/direnv/direnv"
> + #:tests? #f ;; TODO fix tests

Not confidence-inspiring. :-) Could you take a closer look to get an
understanding of why tests are failing?

Based on that we’ll either fix whatever problem leads to failures, or
selectively disable the offending test(s), and only as a last resort
disable tests altogether, with a comment explaining what the problem is.

TIA!

Ludo’.
A
A
Artem Chernyak wrote on 15 Oct 2021 01:39
[PATCH] gnu: Update direnv to 2.28.0
(address . 51022@debbugs.gnu.org)
CALP7HJsvtbh8_u6L7ANVbBOpUxaEqKEGUFkjSqow_Z1gAnGSHw@mail.gmail.com
Hi Ludovic,

Thanks for the feedback. I was able to figure out that the make test
process, used previously, tried to install Go modules. That seemed to
cause the error with the tests. The test ran fine when executed
directly with Go.

Also, thank you for the feedback on my patch formatting. Hope I got it
right this time. I would appreciate any additional feedback you may
have since it's my first contribution to guix and first time
contributing using patches (not using github or gitlab.)

--
Sincerely,
Artem Chernyak
From 5a3079f17a056c59c5fbc3cb5e4490170c8adabf Mon Sep 17 00:00:00 2001
From: Artem Chernyak <artemchernyak@gmail.com>
Date: Mon, 4 Oct 2021 21:08:46 -0500
Subject: [PATCH] gnu: Update direnv to 2.28.0

* gnu/packages/shellutils.scm (direnv): Update to 2.28.0
---
gnu/packages/shellutils.scm | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)

Toggle diff (55 lines)
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 9a364d0ade..70236d9e5c 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -292,7 +292,7 @@ are already there.")
(define-public direnv
(package
(name "direnv")
- (version "2.15.2")
+ (version "2.28.0")
(source
(origin (method git-fetch)
(uri (git-reference
@@ -301,18 +301,12 @@ are already there.")
(file-name (git-file-name name version))
(sha256
(base32
- "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
+ "0yk53jn7wafklixclka17wyjjs2g5giigjr2bd0xzy10nrzwp7c9"))))
(build-system go-build-system)
(arguments
'(#:import-path "github.com/direnv/direnv"
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'delete-vendor
- (lambda _
- ;; Using a snippet causes issues with the name of the directory,
- ;; so delete the extra source code here.
- (delete-file-recursively "src/github.com/direnv/direnv/vendor")
- #t))
(add-after 'install 'install-manpages
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -330,7 +324,9 @@ are already there.")
;; The following file needs to be writable so it can be
;; modified by the testsuite.
(make-file-writable "test/scenarios/base/.envrc")
- (invoke "make" "test")
+ ;; We need to manually run test because make test
+ ;; tries to use go modules
+ (invoke "go" "test" "./...")
;; Clean up from the tests, especially so that the extra
;; direnv executable that's generated is removed.
(invoke "make" "clean")))
@@ -338,6 +334,8 @@ are already there.")
(native-inputs
`(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
+ ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
+ ("go-golang-org-x-mod" ,go-golang-org-x-mod)
("which" ,which)))
(home-page "https://direnv.net/")
(synopsis "Environment switcher for the shell")
--
2.33.0
L
L
Ludovic Courtès wrote on 18 Oct 2021 10:36
Re: bug#51022: [PATCH] Update direnv to 2.28.0
(name . Artem Chernyak)(address . artemchernyak@gmail.com)(address . 51022-done@debbugs.gnu.org)
87wnmabuh3.fsf_-_@gnu.org
Hi Artem,

Artem Chernyak <artemchernyak@gmail.com> skribis:

Toggle quote (7 lines)
> From 5a3079f17a056c59c5fbc3cb5e4490170c8adabf Mon Sep 17 00:00:00 2001
> From: Artem Chernyak <artemchernyak@gmail.com>
> Date: Mon, 4 Oct 2021 21:08:46 -0500
> Subject: [PATCH] gnu: Update direnv to 2.28.0
>
> * gnu/packages/shellutils.scm (direnv): Update to 2.28.0

Closed
?