GNU bug report logs -
#76581
[PATCH 0/2] Age: Fix interaction with age.el, add manpages.
Previous Next
To reply to this bug, email your comments to 76581 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Wed, 26 Feb 2025 09:58:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Nicolas Graves <ngraves <at> ngraves.fr>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Wed, 26 Feb 2025 09:58:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The new age.el package in Guix is unable to work because it relies on an
underlying call to --version, which was broken in Guix.
For the reference:
https://github.com/anticomputer/age.el/issues/15
Nicolas Graves (2):
gnu: age, age-keygen: Fix --version.
gnu: age, age-keygen: Install manpages.
gnu/packages/golang-crypto.scm | 46 +++++++++++++++++++++++++++++-----
1 file changed, 40 insertions(+), 6 deletions(-)
--
2.48.1
--
Best regards,
Nicolas Graves
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Wed, 26 Feb 2025 10:47:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 76581 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/golang-crypto.scm (go-filippo-io-age)[source]: Add
snippet to hardcode the version.
---
gnu/packages/golang-crypto.scm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index b1a114dd80..3ff3c39698 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2021 Vagrant Cascadian <vagrant <at> debian.org>
;;; Copyright © 2022 (unmatched-parenthesis <paren <at> disroot.org>
;;; Copyright © 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
-;;; Copyright © 2022, 2023 Nicolas Graves <ngraves <at> ngraves.fr>
+;;; Copyright © 2022, 2023, 2025 Nicolas Graves <ngraves <at> ngraves.fr>
;;; Copyright © 2023 Benjamin <benjamin <at> uvy.fr>
;;; Copyright © 2023 Clément Lassieur <clement <at> lassieur.org>
;;; Copyright © 2023 Felix Lechner <felix.lechner <at> lease-up.com>
@@ -135,7 +135,22 @@ (define-public go-filippo-io-age
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "183iqzmdwk4b35vxrdg2gdzd4277yr5bgbgl9brqv3w1dap5v4pm"))))
+ (base32 "183iqzmdwk4b35vxrdg2gdzd4277yr5bgbgl9brqv3w1dap5v4pm"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (substitute* '("cmd/age/age.go"
+ "cmd/age-keygen/keygen.go")
+ (("var Version string")
+ (format #f "var Version = ~s" #$version))
+ ;; We can as well not require runtime/debug now,
+ ;; since it's only used to get the version.
+ (("\"runtime/debug\"")
+ "")
+ (("buildInfo, ok := debug\\.ReadBuildInfo\\(\\); ok")
+ "false")
+ (("buildInfo\\.Main\\.Version")
+ ""))))))
(build-system go-build-system)
(arguments
(list
--
2.48.1
--
Best regards,
Nicolas Graves
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Wed, 26 Feb 2025 10:48:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 76581 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/golang-crypto.scm (age, age-keygen)[arguments]{phases}:
Add phase 'install-doc.
(go-filippo-io-age): Remove other doc files.
---
gnu/packages/golang-crypto.scm | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index 3ff3c39698..74df6b8e99 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -139,6 +139,13 @@ (define-public go-filippo-io-age
(modules '((guix build utils)))
(snippet
#~(begin
+ ;; Age source bundles manpages already. Seems OK not to rebuild
+ ;; them with ronn, they are pretty auditable.
+ (with-directory-excursion "doc"
+ (for-each delete-file '("age.1.html"
+ "age.1.ronn"
+ "age-keygen.1.html"
+ "age-keygen.1.ronn")))
(substitute* '("cmd/age/age.go"
"cmd/age-keygen/keygen.go")
(("var Version string")
@@ -2598,16 +2605,28 @@ (define-public age
(list "testdata/scrypt.txt"
"testdata/output_file.txt"
"testdata/encrypted_keys.txt"
- "testdata/terminal.txt"))))))))))
+ "testdata/terminal.txt")))))
+ (add-after 'install 'install-doc
+ (lambda _
+ (let ((man (string-append #$output "/man/man1/")))
+ (install-file "src/filippo.io/age/doc/age.1" man)))))))))
(define-public age-keygen
(package
(inherit go-filippo-io-age)
(name "age-keygen")
(arguments
- `(#:import-path "filippo.io/age/cmd/age-keygen"
- #:unpack-path "filippo.io/age"
- #:install-source? #f))))
+ (list
+ #:import-path "filippo.io/age/cmd/age-keygen"
+ #:unpack-path "filippo.io/age"
+ #:install-source? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-doc
+ (lambda _
+ (let ((man (string-append #$output "/man/man1/")))
+ (install-file
+ "src/filippo.io/age/doc/age-keygen.1" man)))))))))
(define-public go-jwker
(package/inherit go-github-com-jphastings-jwker
--
2.48.1
--
Best regards,
Nicolas Graves
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Wed, 26 Feb 2025 17:09:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 76581 <at> debbugs.gnu.org (full text, mbox):
Hi Nicolas,
Thanks for the patches!
--8<---------------cut here---------------start------------->8---
+ (base32 "183iqzmdwk4b35vxrdg2gdzd4277yr5bgbgl9brqv3w1dap5v4pm"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (substitute* '("cmd/age/age.go"
+ "cmd/age-keygen/keygen.go")
+ (("var Version string")
+ (format #f "var Version = ~s" #$version))
+ ;; We can as well not require runtime/debug now,
+ ;; since it's only used to get the version.
+ (("\"runtime/debug\"")
+ "")
+ (("buildInfo, ok := debug\\.ReadBuildInfo\\(\\); ok")
+ "false")
+ (("buildInfo\\.Main\\.Version")
+ ""))))))
--8<---------------cut here---------------end--------------->8---
This may be simplified with #:build-flags, see examples in golang-*
> <...> "-ldflags=-X main.Version=" #$version <...>
When you update the "library" package, you may keep all fields from
[arguments] with something like this:
--8<---------------cut here---------------start------------->8---
(define-public gops
(package
(inherit go-github-com-google-gops)
(name "gops")
(arguments
(substitute-keyword-arguments
(package-arguments go-github-com-google-gops)
((#:tests? _ #t) #f)
((#:install-source? _ #t) #f)
((#:skip-build? _ #t) #f)))
(native-inputs (package-propagated-inputs go-github-com-google-gops))
(propagated-inputs '())
(inputs '())))
--8<---------------cut here---------------end--------------->8---
So the idea is to run tests and apply modifications on the "library"
side and just adjust #:import-path on final command(s)
I'm happy to review v2!
---
Oleg
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Thu, 27 Feb 2025 08:07:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 76581 <at> debbugs.gnu.org (full text, mbox):
Hi Oleg,
For some reason, it doesn't seem to work with the following changes. Am
I missing something ?
Nicolas
* gnu/packages/golang-crypto.scm (go-filippo-io-age)[source]: Add
snippet to hardcode the version.
---
gnu/packages/golang-crypto.scm | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index b1a114dd80..32bf4e401d 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2021 Vagrant Cascadian <vagrant <at> debian.org>
;;; Copyright © 2022 (unmatched-parenthesis <paren <at> disroot.org>
;;; Copyright © 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
-;;; Copyright © 2022, 2023 Nicolas Graves <ngraves <at> ngraves.fr>
+;;; Copyright © 2022, 2023, 2025 Nicolas Graves <ngraves <at> ngraves.fr>
;;; Copyright © 2023 Benjamin <benjamin <at> uvy.fr>
;;; Copyright © 2023 Clément Lassieur <clement <at> lassieur.org>
;;; Copyright © 2023 Felix Lechner <felix.lechner <at> lease-up.com>
@@ -139,6 +139,9 @@ (define-public go-filippo-io-age
(build-system go-build-system)
(arguments
(list
+ #:build-flags
+ #~(list (string-append "-ldflags=-X main.version="
+ #$(package-version this-package)))
#:embed-files #~(list "armor.*" "header_crlf" "hmac_.*" "scrypt.*"
"stanza_.*" "stream_.*" "version_unsupported"
"x25519.*" "x25519_.*")
@@ -2567,6 +2570,9 @@ (define-public age
(name "age")
(arguments
(list
+ #:build-flags
+ #~(list (string-append "-ldflags=-X main.version="
+ #$(package-version this-package)))
#:install-source? #f
#:import-path "filippo.io/age/cmd/age"
#:unpack-path "filippo.io/age"
@@ -2590,9 +2596,13 @@ (define-public age-keygen
(inherit go-filippo-io-age)
(name "age-keygen")
(arguments
- `(#:import-path "filippo.io/age/cmd/age-keygen"
- #:unpack-path "filippo.io/age"
- #:install-source? #f))))
+ (list
+ #:build-flags
+ #~(list (string-append "-ldflags=-X main.version="
+ #$(package-version this-package)))
+ #:import-path "filippo.io/age/cmd/age-keygen"
+ #:unpack-path "filippo.io/age"
+ #:install-source? #f))))
(define-public go-jwker
(package/inherit go-github-com-jphastings-jwker
--
2.48.1
--
Best regards,
Nicolas Graves
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Thu, 27 Feb 2025 10:34:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 76581 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Nicolas,
I've tackled it and made it work with some sort of simplification,
please see v3 following this email.
CLI tools are merged into one package:
--8<---------------cut here---------------start------------->8---
> tree $(./pre-inst-env guix build age)
/gnu/store/wpaqwb40l2bzzbgjyqkn177mwc7f0v3l-age-1.2.1
├── bin
│ ├── age
│ └── age-keygen
├── etc
│ └── ld.so.cache
└── share
├── doc
│ └── age-1.2.1
│ └── LICENSE
└── man
└── man1
├── age.1.zst
└── age-keygen.1.zst
8 directories, 6 files
--8<---------------cut here---------------end--------------->8---
And versions:
--8<---------------cut here---------------start------------->8---
> $(./pre-inst-env guix build age)/bin/age --version
1.2.1
[env: /gnu/store/gpahyx6mjm17ydpxyxvry2pqiwm7kdj5-profile]
> $(./pre-inst-env guix build age)/bin/age-keygen --version
1.2.1
[env: /gnu/store/gpahyx6mjm17ydpxyxvry2pqiwm7kdj5-profile]
--8<---------------cut here---------------end--------------->8---
Please check if it works with Emacs' package now.
---
Oleg
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Thu, 27 Feb 2025 10:35:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 76581 <at> debbugs.gnu.org (full text, mbox):
Reported in #76581: Age: Fix interaction with age.el, add manpages.
* gnu/packages/golang-crypto.scm (go-filippo-io-age) [arguments]
<build-flags>: Set version.
[description]: Fix it.
(age): Swap to PACKAGE/INHERIT, simplify package definition and build
all commands.
[arguments] <phases>: Remove 'remove-failing-test-data-files. Use custom
'build.
(age-keygen): Delete variable.
Co-authored-by: Nicolas Graves <ngraves <at> ngraves.fr>
Change-Id: I8f4892dfceef34c47f945efce8ddfa9787102d4a
---
gnu/packages/golang-crypto.scm | 60 ++++++++++++++++------------------
1 file changed, 28 insertions(+), 32 deletions(-)
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index b1a114dd807..b79fa01dbb2 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -139,6 +139,8 @@ (define-public go-filippo-io-age
(build-system go-build-system)
(arguments
(list
+ #:build-flags #~(list (string-append "-ldflags=-X main.Version="
+ #$version))
#:embed-files #~(list "armor.*" "header_crlf" "hmac_.*" "scrypt.*"
"stanza_.*" "stream_.*" "version_unsupported"
"x25519.*" "x25519_.*")
@@ -155,9 +157,8 @@ (define-public go-filippo-io-age
(synopsis "Secure file encryption tool, format, and Go library")
(description
"This package implements file encryption according to the
-@{age-encryption.org/v1, https://age-encryption.org/v1} specification.
-It features small explicit keys, no configuration options, and Unix-style
-composability.")
+@url{https://age-encryption.org/v1} specification. It features small explicit
+keys, no configuration options, and Unix-style composability.")
(license license:bsd-3)))
(define-public go-filippo-io-edwards25519
@@ -2562,37 +2563,32 @@ (define-public go-torproject-org-pluggable-transports-goptlib
;;;
(define-public age
- (package
- (inherit go-filippo-io-age)
+ (package/inherit go-filippo-io-age
(name "age")
(arguments
- (list
- #:install-source? #f
- #:import-path "filippo.io/age/cmd/age"
- #:unpack-path "filippo.io/age"
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'unpack 'remove-failing-test-data-files
- ;; FIXME: testdata/output_file.txt:49: unknown command "ttyin"
- ;; age: error: input and output file are the same: "inputcopy"
- ;; age: error: input and output file are the same: "./inputcopy"
- ;; age: error: input and output file are the same: "keycopy"
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (for-each delete-file
- (list "testdata/scrypt.txt"
- "testdata/output_file.txt"
- "testdata/encrypted_keys.txt"
- "testdata/terminal.txt"))))))))))
-
-(define-public age-keygen
- (package
- (inherit go-filippo-io-age)
- (name "age-keygen")
- (arguments
- `(#:import-path "filippo.io/age/cmd/age-keygen"
- #:unpack-path "filippo.io/age"
- #:install-source? #f))))
+ (substitute-keyword-arguments
+ (package-arguments go-filippo-io-age)
+ ((#:tests? _ #t) #f)
+ ((#:install-source? _ #t) #f)
+ ((#:unpack-path _ "") "filippo.io/age")
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (replace 'build
+ (lambda* (#:key import-path #:allow-other-keys #:rest arguments)
+ (for-each
+ (lambda (cmd)
+ (apply (assoc-ref #$phases 'build)
+ `(,@arguments
+ #:import-path ,(string-append import-path cmd))))
+ (list "/cmd/age"
+ "/cmd/age-keygen"))))))))
+ (native-inputs (package-propagated-inputs go-filippo-io-age))
+ (propagated-inputs '())
+ (inputs '())
+ (description
+ (string-append (package-description go-filippo-io-age)
+ "\nThis package provides a command line interface (CLI)
+tools."))))
(define-public go-jwker
(package/inherit go-github-com-jphastings-jwker
base-commit: 4270c484ca174ad97d1add91fa5fc69041a6af9d
--
2.48.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Thu, 27 Feb 2025 10:35:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 76581 <at> debbugs.gnu.org (full text, mbox):
From: Nicolas Graves <ngraves <at> ngraves.fr>
* gnu/packages/golang-crypto.scm (go-filippo-io-age): Remove other doc
files.
(age): [arguments] <phases>: Add 'install-man-pages.
Change-Id: I58e10755c907af5a67083fb22682efdd4c4b7c92
---
gnu/packages/golang-crypto.scm | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index b79fa01dbb2..b0420f2a043 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2021 Vagrant Cascadian <vagrant <at> debian.org>
;;; Copyright © 2022 (unmatched-parenthesis <paren <at> disroot.org>
;;; Copyright © 2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
-;;; Copyright © 2022, 2023 Nicolas Graves <ngraves <at> ngraves.fr>
+;;; Copyright © 2022, 2023, 2025 Nicolas Graves <ngraves <at> ngraves.fr>
;;; Copyright © 2023 Benjamin <benjamin <at> uvy.fr>
;;; Copyright © 2023 Clément Lassieur <clement <at> lassieur.org>
;;; Copyright © 2023 Felix Lechner <felix.lechner <at> lease-up.com>
@@ -135,7 +135,17 @@ (define-public go-filippo-io-age
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "183iqzmdwk4b35vxrdg2gdzd4277yr5bgbgl9brqv3w1dap5v4pm"))))
+ (base32 "183iqzmdwk4b35vxrdg2gdzd4277yr5bgbgl9brqv3w1dap5v4pm"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ ;; Age source bundles manpages already. Seems OK not to rebuild
+ ;; them with ronn, they are pretty auditable.
+ (with-directory-excursion "doc"
+ (for-each delete-file '("age.1.html"
+ "age.1.ronn"
+ "age-keygen.1.html"
+ "age-keygen.1.ronn")))))))
(build-system go-build-system)
(arguments
(list
@@ -2581,7 +2591,12 @@ (define-public age
`(,@arguments
#:import-path ,(string-append import-path cmd))))
(list "/cmd/age"
- "/cmd/age-keygen"))))))))
+ "/cmd/age-keygen"))))
+ (add-after 'install 'install-man-pages
+ (lambda _
+ (let ((man (string-append #$output "/man/man1/")))
+ (install-file "src/filippo.io/age/doc/age.1" man)
+ (install-file "src/filippo.io/age/doc/age-keygen.1" man))))))))
(native-inputs (package-propagated-inputs go-filippo-io-age))
(propagated-inputs '())
(inputs '())
--
2.48.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#76581
; Package
guix-patches
.
(Thu, 27 Feb 2025 11:07:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 76581 <at> debbugs.gnu.org (full text, mbox):
On 2025-02-27 10:33, Sharlatan Hellseher wrote:
> Hi Nicolas,
>
> I've tackled it and made it work with some sort of simplification,
> please see v3 following this email.
Read, looks fine to me.
> Please check if it works with Emacs' package now.
I have other issues to fix in passage.el to be able to properly use it
the way I want[1], but my v1 is tested: as soon as --version is fixed, it
will be OK.
You should go ahead and push them :)
TY!
[1] https://github.com/anticomputer/passage.el/issues/2
--
Best regards,
Nicolas Graves
Reply sent
to
Sharlatan Hellseher <sharlatanus <at> gmail.com>
:
You have taken responsibility.
(Thu, 27 Feb 2025 11:52:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Nicolas Graves <ngraves <at> ngraves.fr>
:
bug acknowledged by developer.
(Thu, 27 Feb 2025 11:52:03 GMT)
Full text and
rfc822 format available.
Message #34 received at 76581-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Pushed to master:
3f6eefdcf28 * master origin/master gnu: age: Install manpages.
05e0793479e * gnu: age: Merge packages with executibles into single one.
--
Oleg
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 4 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.