GNU bug report logs - #61946
[PATCH 0/6] gnu: golang: Add minify

Previous Next

Package: guix-patches;

Reported by: Thomas Ieong <th.ieong <at> free.fr>

Date: Fri, 3 Mar 2023 22:58:02 UTC

Severity: normal

Tags: patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61946 in the body.
You can then email your comments to 61946 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 22:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Ieong <th.ieong <at> free.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 03 Mar 2023 22:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: guix-patches <at> gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 0/6] gnu: golang: Add minify
Date: Fri,  3 Mar 2023 23:55:27 +0100
Hello there!

This is a patch series to add the golang minify package, a golang
dependency needed for sourcehut.

Thomas Ieong (6):
  gnu: Add go-github-com-djherbis-atime.
  gnu: Add go-github-com-matryer-try.
  gnu: Add go-github-com-tdewolff-parse-v2.
  gnu: Add go-github-com-tdewolff-test.
  gnu: Add go-github-com-tdewolff-minify-v2.
  gnu: Add minify.

 gnu/packages/golang.scm | 143 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)


base-commit: 73cb232442a50aa00104ad739db93f44df9de073
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 23:04:02 GMT) Full text and rfc822 format available.

Message #8 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 1/6] gnu: Add go-github-com-djherbis-atime.
Date: Sat,  4 Mar 2023 00:01:54 +0100
* gnu/packages/golang.scm (go-github-com-djherbis-atime): New variable.
---
 gnu/packages/golang.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 465e0fd4c7..e213ce6cb6 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -40,6 +40,7 @@
 ;;; Copyright © 2022 ( <paren <at> disroot.org>
 ;;; Copyright © 2023 Hilton Chain <hako <at> ultrarare.space>
 ;;; Copyright © 2023 Timo Wilken <guix <at> twilken.net>
+;;; Copyright © 2023 Thomas Ieong <th.ieong <at> free.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -9614,6 +9615,28 @@ (define-public go-github-com-bep-golibsass
      "This package provides SCSS compiler support for Go applications.")
     (license license:expat)))
 
+(define-public go-github-com-djherbis-atime
+  (package
+    (name "go-github-com-djherbis-atime")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/djherbis/atime")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0xsz55zpihd9wyrj6qvm3miqzb6x3mnp5apzs0dx1byndhb8adpq"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/djherbis/atime"))
+    (home-page "https://github.com/djherbis/atime")
+    (synopsis "Access Times for files")
+    (description
+     "Package atime provides a platform-independent way to get atimes for files.")
+    (license license:expat)))
+
 (define-public go-github-com-hashicorp-go-syslog
   (package
     (name "go-github-com-hashicorp-go-syslog")
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 23:04:02 GMT) Full text and rfc822 format available.

Message #11 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 2/6] gnu: Add go-github-com-matryer-try.
Date: Sat,  4 Mar 2023 00:01:55 +0100
* gnu/packages/golang.scm (go-github-com-matryer-try): New variable.
---
 gnu/packages/golang.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e213ce6cb6..1bd2a51d8d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9637,6 +9637,37 @@ (define-public go-github-com-djherbis-atime
      "Package atime provides a platform-independent way to get atimes for files.")
     (license license:expat)))
 
+(define-public go-github-com-matryer-try
+  (package
+    (name "go-github-com-matryer-try")
+    (version "1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/matryer/try")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "15f0m5ywihivnvwzcw0mh0sg27aky9rkywvxqszxka9q051qvsmy"))))
+    (build-system go-build-system)
+    (native-inputs (list go-github-com-cheekybits-is))
+    (arguments
+     (list #:import-path "github.com/matryer/try"
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'fix-tests
+                          (lambda* (#:key import-path #:allow-other-keys)
+                            (substitute* (string-append "src/" import-path
+                                                        "/try_test.go")
+                              (("var value string")
+                               "")
+                              (("value, err = SomeFunction\\(\\)")
+                               "_, err = SomeFunction()")))))))
+    (home-page "https://github.com/matryer/try")
+    (synopsis "Simple idiomatic retry package for Go")
+    (description "Package try provides retry functionality.")
+    (license license:expat)))
+
 (define-public go-github-com-hashicorp-go-syslog
   (package
     (name "go-github-com-hashicorp-go-syslog")
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 23:04:02 GMT) Full text and rfc822 format available.

Message #14 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 3/6] gnu: Add go-github-com-tdewolff-parse-v2.
Date: Sat,  4 Mar 2023 00:01:56 +0100
* gnu/packages/golang.scm (go-github-com-tdewolff-parse-v2): New variable.
---
 gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1bd2a51d8d..a331331546 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9668,6 +9668,30 @@ (define-public go-github-com-matryer-try
     (description "Package try provides retry functionality.")
     (license license:expat)))
 
+(define-public go-github-com-tdewolff-parse-v2
+  (package
+    (name "go-github-com-tdewolff-parse-v2")
+    (version "2.6.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/tdewolff/parse")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0wmyylml2b1fy735qfpwavjnhfn2ihjgna2yab433mg1ikgl6wxl"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/tdewolff/parse/v2"))
+    (propagated-inputs `(("go-github-com-tdewolff-test" ,go-github-com-tdewolff-test)))
+    (home-page "https://github.com/tdewolff/parse")
+    (synopsis "Go parsers for web formats")
+    (description
+     "Package parse contains a collection of parsers for various formats in its
+subpackages.")
+    (license license:expat)))
+
 (define-public go-github-com-hashicorp-go-syslog
   (package
     (name "go-github-com-hashicorp-go-syslog")
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 23:04:03 GMT) Full text and rfc822 format available.

Message #17 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 4/6] gnu: Add go-github-com-tdewolff-test.
Date: Sat,  4 Mar 2023 00:01:57 +0100
* gnu/packages/golang.scm (go-github-com-tdewolff-test): New variable.
---
 gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a331331546..c4426d2a4f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9692,6 +9692,30 @@ (define-public go-github-com-tdewolff-parse-v2
 subpackages.")
     (license license:expat)))
 
+(define-public go-github-com-tdewolff-test
+  (package
+    (name "go-github-com-tdewolff-test")
+    (version "1.0.7")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/tdewolff/test")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0k1yk2y2mryps0klsbcdxvn7acaxqxkl9mdi2cm6zgl29n3l5gi0"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/tdewolff/test"))
+    (home-page "https://github.com/tdewolff/test")
+    (synopsis "Go test helper functions")
+    (description
+     "Test is a helper package written in @@url{http://golang.org/,Go}.  It implements
+a few functions that are useful for io testing, such as readers and writers that
+fail after N consecutive reads/writes.")
+    (license license:expat)))
+
 (define-public go-github-com-hashicorp-go-syslog
   (package
     (name "go-github-com-hashicorp-go-syslog")
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 23:04:03 GMT) Full text and rfc822 format available.

Message #20 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 5/6] gnu: Add go-github-com-tdewolff-minify-v2.
Date: Sat,  4 Mar 2023 00:01:58 +0100
* gnu/packages/golang.scm (go-github-com-tdewolff-minify-v2): New variable.
---
 gnu/packages/golang.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index c4426d2a4f..de5c0847f6 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9716,6 +9716,37 @@ (define-public go-github-com-tdewolff-test
 fail after N consecutive reads/writes.")
     (license license:expat)))
 
+(define-public go-github-com-tdewolff-minify-v2
+  (package
+    (name "go-github-com-tdewolff-minify-v2")
+    (version "2.12.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/tdewolff/minify")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1bbygm8x68xxgqgjzqfwak06212lalsz4aq4dg9z5yjq1c3hp3ji"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/tdewolff/minify/v2"))
+    (propagated-inputs (list go-github-com-tdewolff-test
+                             go-github-com-tdewolff-parse-v2
+                             go-github-com-spf13-pflag
+                             go-github-com-matryer-try
+                             go-github-com-fsnotify-fsnotify
+                             go-github-com-dustin-go-humanize
+                             go-github-com-djherbis-atime
+                             go-github-com-cheekybits-is))
+    (home-page "https://github.com/tdewolff/minify")
+    (synopsis "Go minifiers for web formats")
+    (description
+     "Package minify relates MIME type to minifiers.  Several minifiers are provided
+in the subpackages.")
+    (license license:expat)))
+
 (define-public go-github-com-hashicorp-go-syslog
   (package
     (name "go-github-com-hashicorp-go-syslog")
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Fri, 03 Mar 2023 23:04:03 GMT) Full text and rfc822 format available.

Message #23 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Cc: Thomas Ieong <th.ieong <at> free.fr>
Subject: [PATCH 6/6] gnu: Add minify.
Date: Sat,  4 Mar 2023 00:01:59 +0100
* gnu/packages/golang.scm (minify): New variable.
---
 gnu/packages/golang.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index de5c0847f6..85c3d4e893 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9747,6 +9747,16 @@ (define-public go-github-com-tdewolff-minify-v2
 in the subpackages.")
     (license license:expat)))
 
+(define-public minify
+  (package
+    (inherit go-github-com-tdewolff-minify-v2)
+    (name "minify")
+    (arguments
+     `(#:import-path "github.com/tdewolff/minify/cmd/minify"
+       #:unpack-path "github.com/tdewolff/minify"
+       #:install-source? #f))))
+
+
 (define-public go-github-com-hashicorp-go-syslog
   (package
     (name "go-github-com-hashicorp-go-syslog")
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Sat, 04 Mar 2023 21:32:02 GMT) Full text and rfc822 format available.

Message #26 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Ieong <th.ieong <at> free.fr>
To: 61946 <at> debbugs.gnu.org
Subject: Go generated files
Date: Sat, 04 Mar 2023 22:30:19 +0100
Hi,

I forgot to check for generated files in the go packages.
I did just that and there is indeed one file hash.go that is generated
in the parse and minify package.

Taking care of this and resending later.
-- 
Thomas Ieong




Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Thu, 10 Aug 2023 12:13:02 GMT) Full text and rfc822 format available.

Message #29 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Thomas Ieong <th.ieong <at> free.fr>
Cc: 61946 <at> debbugs.gnu.org
Subject: Re: [bug#61946] Go generated files
Date: Thu, 10 Aug 2023 20:12:17 +0800
Hi Thomas,

> I forgot to check for generated files in the go packages.
> I did just that and there is indeed one file hash.go that is generated
> in the parse and minify package.
>
> Taking care of this and resending later.

go-github-com-tdewolff-minify-v2 has been available in Guix for a
while (but not the minify command and its dependency).  I have sent a
patchset [1] to generate hash.go at build time.  Can you update the
series to base on it and current Guix?

And I think dependencies not added to go-github-com-tdewolff-minify-v2
are only required by minify command, so there's no need to touch
definition of the former, inherit and modify is sufficient.  What do
you think?

Thanks

[1]: <https://issues.guix.gnu.org/65204>




Reply sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
You have taken responsibility. (Tue, 30 Jan 2024 23:18:01 GMT) Full text and rfc822 format available.

Notification sent to Thomas Ieong <th.ieong <at> free.fr>:
bug acknowledged by developer. (Tue, 30 Jan 2024 23:18:02 GMT) Full text and rfc822 format available.

Message #34 received at 61946-done <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 61946-done <at> debbugs.gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 0/6] gnu: golang: Add minify
Date: Tue, 30 Jan 2024 23:17:29 +0000
[Message part 1 (text/plain, inline)]
Hi Thomas and Hilton,

I've tried to resolved all highlights which Hilton pointed out and from
some investigation I've left with 3 pushed patches.

- present [3/3]
  - [X] go-github-com-tdewolff-parse-v2
  - [X] go-github-com-tdewolff-test
  - [X] go-github-com-tdewolff-minify-v2

- added to golang-xyz.scm [2/2]
  - [X] go-github-com-djherbis-atime
  - [X] go-github-com-matryer-try

And the minify looks like this with inherit and modification:

--8<---------------cut here---------------start------------->8---
(define-public minify
  (package
    (inherit go-github-com-tdewolff-minify-v2)
    (name "minify")
    (arguments
     (substitute-keyword-arguments
         (package-arguments go-github-com-tdewolff-minify-v2)
       ((#:install-source? _ #t) #f)
       ((#:import-path _ "github.com/tdewolff/minify/v2")
        "github.com/tdewolff/minify/cmd/minify")))
    (inputs
     (list go-github-com-djherbis-atime
           go-github-com-dustin-go-humanize
           go-github-com-fsnotify-fsnotify
           go-github-com-matryer-try
           go-github-com-spf13-pflag))))
--8<---------------cut here---------------end--------------->8---

Maxim or Ricardo, 

Pinging you here as following, I've built it few times locally and
everything passed just fine, for some reason CI feel bad.
https://ci.guix.gnu.org/eval/1086875

Thanks,
Oleg
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Thu, 01 Feb 2024 03:12:02 GMT) Full text and rfc822 format available.

Message #37 received at 61946 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Cc: 61946 <at> debbugs.gnu.org
Subject: Re: bug#61946: [PATCH 0/6] gnu: golang: Add minify
Date: Thu, 01 Feb 2024 11:10:39 +0800
Hi Sharlatan,

On Wed, 31 Jan 2024 07:17:29 +0800,
Sharlatan Hellseher wrote:
>
> [1  <text/plain (quoted-printable)>]
>
> Hi Thomas and Hilton,
>
> I've tried to resolved all highlights which Hilton pointed out and from
> some investigation I've left with 3 pushed patches.
>
> - present [3/3]
>   - [X] go-github-com-tdewolff-parse-v2
>   - [X] go-github-com-tdewolff-test
>   - [X] go-github-com-tdewolff-minify-v2
>
> - added to golang-xyz.scm [2/2]
>   - [X] go-github-com-djherbis-atime
>   - [X] go-github-com-matryer-try
>
> And the minify looks like this with inherit and modification:
>
> --8<---------------cut here---------------start------------->8---
> (define-public minify
>   (package
>     (inherit go-github-com-tdewolff-minify-v2)
>     (name "minify")
>     (arguments
>      (substitute-keyword-arguments
>          (package-arguments go-github-com-tdewolff-minify-v2)
>        ((#:install-source? _ #t) #f)
>        ((#:import-path _ "github.com/tdewolff/minify/v2")
>         "github.com/tdewolff/minify/cmd/minify")))

I think there's no need to supply a default value to #:import-path
since all Go packages should have it in their arguments list.

>     (inputs
>      (list go-github-com-djherbis-atime
>            go-github-com-dustin-go-humanize
>            go-github-com-fsnotify-fsnotify
>            go-github-com-matryer-try
>            go-github-com-spf13-pflag))))
> --8<---------------cut here---------------end--------------->8---

And we can avoid the inherited propagated-inputs.

I have adjusted the definition to the following, does this look good
to you?

--8<---------------cut here---------------start------------->8---
(define-public minify
  (let ((base go-github-com-tdewolff-minify-v2))
    (package
      (inherit base)
      (name "minify")
      (arguments
       (substitute-keyword-arguments (package-arguments base)
         ((#:install-source? _ #t) #f)
         ((#:import-path _) "github.com/tdewolff/minify/cmd/minify")))
      (inputs
       (modify-inputs (package-propagated-inputs base)
         (prepend go-github-com-djherbis-atime
                  go-github-com-dustin-go-humanize
                  go-github-com-fsnotify-fsnotify
                  go-github-com-matryer-try
                  go-github-com-spf13-pflag)))
      (propagated-inputs '()))))
--8<---------------cut here---------------end--------------->8---

Thanks




Information forwarded to guix-patches <at> gnu.org:
bug#61946; Package guix-patches. (Thu, 01 Feb 2024 20:56:02 GMT) Full text and rfc822 format available.

Message #40 received at 61946-done <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 61946-done <at> debbugs.gnu.org
Cc: hako <at> ultrarare.space
Subject: [PATCH 0/6] gnu: golang: Add minify
Date: Thu, 01 Feb 2024 20:54:52 +0000
[Message part 1 (text/plain, inline)]
Hi Hilton,

Base on suggestions from <https://issues.guix.gnu.org/68835> I've moved
minifry into golang-web and renamed the package with manner proposed in
<https://issues.guix.gnu.org/68763>.

I image there would be a large verity of packages with name 'minify' in
the future :-).

There is alsoy Python binding we may pack as well
<https://pypi.org/project/tdewolff-minify/>

Pushed to go-minify as df65af45b5f2cc76ce813ca91fab9054fd807bba to master.

Thanks,
Oleg
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Mar 2024 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.