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

From: Liliana Marie Prikler <[email-masked]>
Date: Sat, 26 Aug 2023 21:31:04 +0200

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