diff mbox series

[bug#65037,6/7] gnu: trezor-agent: Fix build, update versioning, and the git tag.

Message ID ff882aba8ce58e3f1d2973f2728f382288e0bab7.1691068294.git.attila@lendvai.name
State New
Headers show
Series [bug#65037,1/7] gnu: python-daemon: Use the git repo as source instead of pypi. | expand

Commit Message

Attila Lendvai Aug. 3, 2023, 1:11 p.m. UTC
Fix it by adding missing native-inputs, so that the tests finish (and thus the
build succeeds).

Also clarify the versioning of the package in a comment, so that later updates
will not pick the wrong version number.

* gnu/packages/finance.scm (trezor-agent): Update version from 0.14.4 to
0.12.0 (!). Move the git tag from v0.14.4 to v0.14.6.
---
 gnu/packages/finance.scm | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

Comments

Liliana Marie Prikler Aug. 26, 2023, 7:31 p.m. UTC | #1
Am Donnerstag, dem 03.08.2023 um 15:11 +0200 schrieb Attila Lendvai:
> Fix it by adding missing native-inputs, so that the tests finish (and
> thus the
> build succeeds).
> 
> Also clarify the versioning of the package in a comment, so that
> later updates
> will not pick the wrong version number.
> 
> * gnu/packages/finance.scm (trezor-agent): Update version from 0.14.4
> to 0.12.0 (!). Move the git tag from v0.14.4 to v0.14.6.
何?
> ---
>  gnu/packages/finance.scm | 27 +++++++++++++++++++--------
>  1 file changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
> index 0656d72e64..807241ab8c 100644
> --- a/gnu/packages/finance.scm
> +++ b/gnu/packages/finance.scm
> @@ -1212,7 +1212,9 @@ (define-public ledger-agent
>  (define-public trezor-agent
>    (package
>      (name "trezor-agent")
> -    (version "0.14.4")
> +    ;; The version of trezor-agent can be found in
> ./agents/trezor/setup.py.
> +    ;; See next comment for details.
> +    (version "0.12.0")
>      (source
>       (origin
>         (method git-fetch)
> @@ -1221,12 +1223,16 @@ (define-public trezor-agent
>               ;; The version mismatch is not a mistake.  Multiple
> Python
>               ;; apps/packages are in the same git repo, and they
> have
>               ;; different versions.  The git tag seems to track
> libagent,
> -             ;; i.e. python-trezor-agent in the Guix namespace.  See
> -             ;; e.g. ./agents/trezor/setup.py.
> -             (commit "v0.14.4")))
> +             ;; which is python-trezor-agent in the Guix namespace. 
> See
> +             ;; ./agents/trezor/setup.py for the version of trezor-
> agent.
> +             ;;
> +             ;; Here we pick the latest tag in the git repo that
> bumps the
> +             ;; version of trezor-agent in ./agents/trezor/setup.py
> to the
> +             ;; version we specified above.
> +             (commit "v0.14.6")))
はい、いみわかんない。

First things first, if it's one source for two packages, why don't we
simply inherit that package (or at least its source) instead of doing
things this roundabout way?

Second, I'd do this as a multi-stage thing.  First, "upgrade" trezor-
agent to 0.14.6, then "downgrade" it without changing the source.  This
way, folks who use the builtin downgrade prevention will have a commit
to point to get a newer version from.


Cheers
Attila Lendvai Aug. 30, 2023, 6:55 p.m. UTC | #2
note: some of your mail displays as kanji characters for me.


> First things first, if it's one source for two packages, why don't we
> simply inherit that package (or at least its source) instead of doing
> things this roundabout way?


i asked for clarification in https://github.com/romanz/trezor-agent/issues/369 and updated the commit accordingly.


> Second, I'd do this as a multi-stage thing. First, "upgrade" trezor-
> agent to 0.14.6, then "downgrade" it without changing the source. This
> way, folks who use the builtin downgrade prevention will have a commit
> to point to get a newer version from.

in the new commit there's no downgrade.
diff mbox series

Patch

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 0656d72e64..807241ab8c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -1212,7 +1212,9 @@  (define-public ledger-agent
 (define-public trezor-agent
   (package
     (name "trezor-agent")
-    (version "0.14.4")
+    ;; The version of trezor-agent can be found in ./agents/trezor/setup.py.
+    ;; See next comment for details.
+    (version "0.12.0")
     (source
      (origin
        (method git-fetch)
@@ -1221,12 +1223,16 @@  (define-public trezor-agent
              ;; The version mismatch is not a mistake.  Multiple Python
              ;; apps/packages are in the same git repo, and they have
              ;; different versions.  The git tag seems to track libagent,
-             ;; i.e. python-trezor-agent in the Guix namespace.  See
-             ;; e.g. ./agents/trezor/setup.py.
-             (commit "v0.14.4")))
+             ;; which is python-trezor-agent in the Guix namespace.  See
+             ;; ./agents/trezor/setup.py for the version of trezor-agent.
+             ;;
+             ;; Here we pick the latest tag in the git repo that bumps the
+             ;; version of trezor-agent in ./agents/trezor/setup.py to the
+             ;; version we specified above.
+             (commit "v0.14.6")))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1ksv494xpga27ifrjyn1bkqaya5h769lqb9rx1ng0n4kvmnrqr3l"))
+        (base32 "0pjlsig2gd4m10xkfpa01fr9jswqn0s3qa7l7wgfv5714x33dimm"))
        (modules
         '((guix build utils)
           (ice-9 ftw)
@@ -1245,7 +1251,10 @@  (define-public trezor-agent
                                     (string-append "./" file-name)))
                      (scandir "./agents/trezor/"
                               (negate (cut member <> '("." "..") string=))))
-           (delete-file-recursively "./agents")))))
+           (delete-file-recursively "./agents")
+           ;; Without deleting libagent setuptools complains as follows:
+           ;; "error: Multiple top-level packages discovered in a flat-layout: ['contrib', 'libagent']."
+           (delete-file-recursively "./libagent")))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -1274,8 +1283,10 @@  (define-public trezor-agent
     (build-system python-build-system)
     (inputs
      (list python-trezor python-trezor-agent))
-    (native-inputs
-     (list python-attrs))
+    (native-inputs ; Only needed for running the tests
+     (list python-attrs
+           python-bech32
+           python-simple-rlp))
     (home-page "https://github.com/romanz/trezor-agent")
     (synopsis "Using Trezor as hardware SSH/GPG agent")
     (description "This package allows using Trezor as a hardware SSH/GPG