diff mbox series

[bug#69512] gnu: Add go-github-com-hashicorp-go-multierror.

Message ID 87msrgbck0.fsf@gmail.com
State New
Headers show
Series [bug#69512] gnu: Add go-github-com-hashicorp-go-multierror. | expand

Commit Message

Artyom V. Poptsov March 2, 2024, 8:31 p.m. UTC
Hello,

this patchset adds two packages: "go-github-com-hashicorp-errwrap"[1]
and "go-github-com-hashicorp-go-multierror"[2].
Those packages are required for the newer Kubo (IPFS) versions. [3]

References:
1. https://github.com/hashicorp/errwrap
2. https://github.com/hashicorp/go-multierror
3. https://github.com/ipfs/kubo/blob/a01cc58c8dc4388eaf067e194ef1ee39191f86b5/go.mod#L17C2-L17C36

Comments

Sharlatan Hellseher March 3, 2024, 5:51 p.m. UTC | #1
Hi,

Thank you for the patches!

There is a conflict to apply these patches, may you check please?

I would suggest to place go-github-com-hashicorp-go-multierror
in golang-check, It seams to me more suitable module.

--
Oleg
Artyom V. Poptsov March 3, 2024, 7:18 p.m. UTC | #2
Hi!

> Thank you for the patches!

Thank you for the patch review.  ;-)

> There is a conflict to apply these patches, may you check please?

Okay, I re-based my patchset onto the "master" branch; no conflicts
were found in the process.

> I would suggest to place go-github-com-hashicorp-go-multierror
> in golang-check, It seams to me more suitable module.

I see that the "golang-check" module is for testing-related Go packages,
but it seems to me that "go-multierror" has wider range of use cases
than mere testing purposes (judging by its description at least.)

Could you elaborate?

Thanks!

- avp
Sharlatan Hellseher March 5, 2024, 10:14 a.m. UTC | #3
Hi Aryom!

I've re-read description and made a review of the GitHub page of the
project, you are right about the purpose of this module so let's keep in
in golang-xyz.

I'm not sure if can access <https://qa.guix.gnu.org/issue/69512>. I
referred to this warning in QA:
--8<---------------cut here---------------start------------->8---
Unable to apply patches
Skipping: gnu: Add go-github-com-hashicorp-go-multierror.
Applying: gnu: Add go-github-com-hashicorp-go-multierror.
error: sha1 information is lacking or useless (gnu/packages/golang-xyz.scm).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 gnu: Add go-github-com-hashicorp-go-multierror.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
--8<---------------cut here---------------end--------------->8---
Perhaps it is no longer relevant, I'll check it locally.

Thanks,
Oleg
Sharlatan Hellseher March 7, 2024, 12:03 a.m. UTC | #4
Pushed as d7abe61507..b577550c00 to master.

--
Oleg
diff mbox series

Patch

From 7887e3d855da22c33306bbd5729d396b607d78ad Mon Sep 17 00:00:00 2001
Message-ID: <7887e3d855da22c33306bbd5729d396b607d78ad.1709411277.git.poptsov.artyom@gmail.com>
In-Reply-To: <8ac21911360fa825fc0b13bd58ef64c5c9151ec7.1709411277.git.poptsov.artyom@gmail.com>
References: <8ac21911360fa825fc0b13bd58ef64c5c9151ec7.1709411277.git.poptsov.artyom@gmail.com>
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 2 Mar 2024 23:26:40 +0300
Subject: [PATCH 2/2] gnu: Add go-github-com-hashicorp-go-multierror.

* gnu/packages/golang-xyz.scm (go-github-com-hashicorp-go-multierror): New
  variable.

Change-Id: I6b09a52dc314c4cc6903690738debf4b6c99393f
---
 gnu/packages/golang-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index b52753c9bb..3dcfd690a3 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -724,6 +724,39 @@  (define-public go-github-com-hashicorp-errwrap
 is wrapped, and extracting that error.")
     (license license:mpl2.0)))
 
+(define-public go-github-com-hashicorp-go-multierror
+  (package
+    (name "go-github-com-hashicorp-go-multierror")
+    (version "1.1.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hashicorp/go-multierror")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0l4s41skdpifndn9s8y6s9vzgghdzg4z8z0lld9qjr28888wzp00"))))
+    (build-system go-build-system)
+    (inputs (list go-github-com-hashicorp-errwrap))
+    (arguments
+     (list
+      #:import-path "github.com/hashicorp/go-multierror"))
+    (home-page "https://github.com/hashicorp/go-multierror")
+    (synopsis "Go package for representing a errors list as a single error")
+    (description
+     "@code{go-multierror} is a package for Go that provides a mechanism for
+representing a list of @code{error} values as a single @code{error}.
+
+This allows a function in Go to return an @code{error} that might actually be a list
+of errors.  If the caller knows this, they can unwrap the list and access the errors.
+If the caller doesn't know, the error formats to a nice human-readable format.
+
+@code{go-multierror} is fully compatible with the Go standard library @code{errors}
+package, including the functions @code{As}, @code{Is}, and @code{Unwrap}.  This
+provides a standardized approach for introspecting on error values.")
+    (license license:mpl2.0)))
+
 (define-public go-github-com-jinzhu-copier
   (package
     (name "go-github-com-jinzhu-copier")
-- 
2.41.0