[bug#53995,31/31] gnu: update rbw to 1.4.3.

Message ID 20220216012409.25220-1-ngraves@ngraves.fr
State New
Headers
Series [bug#53995] gnu: rbw: Update to 1.4.3 |

Commit Message

Nicolas Graves Feb. 16, 2022, 1:24 a.m. UTC
  ---
 gnu/packages/rust-apps.scm | 107 ++++++++++++++++++-------------------
 1 file changed, 51 insertions(+), 56 deletions(-)
  

Comments

Maxime Devos Feb. 16, 2022, 11:16 a.m. UTC | #1
Nicolas Graves schreef op wo 16-02-2022 om 02:24 [+0100]:
> +          (add-after 'configure 'relax-requirements
> +            (lambda _
> +              (substitute*
> +                  "guix-vendor/rust-rsa-0.5.0.tar.gz/Cargo.toml"
> +                (("version = \">=1, <1.5\"") "version = \"^1\""))
> +              )))

Wouldn't this be a problem of the 'rust-rsa' package?  I would move
this version relaxing to the 'rust-rsa' package, such that all
dependents of rust-rsa can benefit.

Greetings,
Maxime.
  
Nicolas Graves March 15, 2022, 1:26 p.m. UTC | #2
Sorry for the late answer.

I don't think that necessarily applies to every package dependent on
rust-rsa, I would rather keep it this way. But I'm not confident
to defend it, still junior in guix usage.

Is everything OK with the new batch of patches ?

Cheers,

Nicolas


Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> Nicolas Graves schreef op wo 16-02-2022 om 02:24 [+0100]:
>> +          (add-after 'configure 'relax-requirements
>> +            (lambda _
>> +              (substitute*
>> +                  "guix-vendor/rust-rsa-0.5.0.tar.gz/Cargo.toml"
>> +                (("version = \">=1, <1.5\"") "version = \"^1\""))
>> +              )))
>
> Wouldn't this be a problem of the 'rust-rsa' package?  I would move
> this version relaxing to the 'rust-rsa' package, such that all
> dependents of rust-rsa can benefit.
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]
  
Maxime Devos March 15, 2022, 4:25 p.m. UTC | #3
Nicolas Graves schreef op di 15-03-2022 om 14:26 [+0100]:
> > Wouldn't this be a problem of the 'rust-rsa' package?  I would move
> > this version relaxing to the 'rust-rsa' package, such that all
> > dependents of rust-rsa can benefit.
> 
> I don't think that necessarily applies to every package dependent on
> rust-rsa, I would rather keep it this way.

Some remarks:

  * while cargo-build-system creates a "guix-vendor" directory,
    this seems an implementation detail to me, maybe one day it will
    switch to a {CROSS_,}LIBRARY_PATH system like gcc uses.

  * IIUC it does necessarily apply to every package dependent on
    rust-rsa, at least those using #:cargo-inputs
    / #:cargo-development-inputs.

    Empirically: I searched for "rust-rsa" in the source code of Guix.
    Its only user 'rbw' apparently copies the 'substitute*'.

    Theoretically: suppose a package rust-foo depends on rust-rsa (and
    for simplicity, assume that rust-rsa is its only dependency), via
    #:cargo-inputs / #:cargo-development-inputs.

    Then currently, rust-rsa builds because of its 'relax-requirements'
    phase, but IIUC, this is forgotten when 'rust-foo' is being built,
    because 'expand-crate-sources' in (guix build-system cargo) just
    looks at the 'source' field of 'rust-rsa' and not the build result,
    so the build of rust-foo would fail (unverified).

  * even if it's not necessary for all dependents, but only for, say,
    20%, it seems more convenient to me to only have to do the
    substitute* in a single location (i.e., rust-rsa).  An additional
    benefit is that, if the version requirements change at some point
    in the future, then the 'substitute*' only has to be adjusted in a
    single place.

Greetings,
Maxime.
  
Nicolas Graves Sept. 29, 2022, 1:03 p.m. UTC | #4
done trick error
  

Patch

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 5b27bf3647..f8d6dcc1ce 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -1297,70 +1297,65 @@  (define-public watchexec
 (define-public rbw
   (package
     (name "rbw")
-    (version "1.4.1")
+    (version "1.4.3")
     (source
      (origin
        (method url-fetch)
        (uri (crate-uri "rbw" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "0zszp9hvilpikbd66b5zbvspks0spv8dh0yry0sxnc5yqvl2ixnf"))))
+          (base32 "1177jjf3rksbi3rjw9215fkg1am3i6ph1wssf8svkd3in0sxqrhf"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'configure 'relax-requirements
-           (lambda _
-             (substitute*
-                 "guix-vendor/rust-password-hash-0.3.2.tar.gz/Cargo.toml"
-               (("version = \">=1, <1.1.0\"") "version = \">=1\""))
-             (substitute*
-                 "guix-vendor/rust-rsa-0.5.0.tar.gz/Cargo.toml"
-               (("version = \">=1, <1.5\"") "version = \"^1\""))
-             (substitute*
-                 "Cargo.toml"
-               (("version = \"1.4\"") "version = \"^1\"")))))
-       #:cargo-inputs
-       (("rust-aes" ,rust-aes-0.7)
-        ("rust-anyhow" ,rust-anyhow-1)
-        ("rust-arrayvec" ,rust-arrayvec-0.7)
-        ("rust-async-trait" ,rust-async-trait-0.1)
-        ("rust-base32" ,rust-base32-0.4)
-        ("rust-base64" ,rust-base64-0.13)
-        ("rust-block-modes" ,rust-block-modes-0.8)
-        ("rust-block-padding" ,rust-block-padding-0.2)
-        ("rust-daemonize" ,rust-daemonize-0.4)
-        ("rust-directories" ,rust-directories-4)
-        ("rust-env-logger" ,rust-env-logger-0.9)
-        ("rust-hkdf" ,rust-hkdf-0.11)
-        ("rust-hmac" ,rust-hmac-0.11)
-        ("rust-humantime" ,rust-humantime-2)
-        ("rust-libc" ,rust-libc-0.2)
-        ("rust-log" ,rust-log-0.4)
-        ("rust-nix" ,rust-nix-0.23)
-        ("rust-paw" ,rust-paw-1)
-        ("rust-pbkdf2" ,rust-pbkdf2-0.9)
-        ("rust-percent-encoding" ,rust-percent-encoding-2)
-        ("rust-rand" ,rust-rand-0.8)
-        ("rust-region" ,rust-region-3)
-        ("rust-reqwest" ,rust-reqwest-0.11)
-        ("rust-rsa" ,rust-rsa-0.5)
-        ("rust-serde" ,rust-serde-1)
-        ("rust-serde-json" ,rust-serde-json-1)
-        ("rust-serde-path-to-error" ,rust-serde-path-to-error-0.1)
-        ("rust-serde-repr" ,rust-serde-repr-0.1)
-        ("rust-sha-1" ,rust-sha-1-0.9)
-        ("rust-sha2" ,rust-sha2-0.9)
-        ("rust-structopt" ,rust-structopt-0.3)
-        ("rust-tempfile" ,rust-tempfile-3)
-        ("rust-term-size" ,rust-term-size-0.3)
-        ("rust-textwrap" ,rust-textwrap-0.11)
-        ("rust-thiserror" ,rust-thiserror-1)
-        ("rust-tokio" ,rust-tokio-1)
-        ("rust-totp-lite" ,rust-totp-lite-1)
-        ("rust-url" ,rust-url-2)
-        ("rust-uuid" ,rust-uuid-0.8)
-        ("rust-zeroize" ,rust-zeroize-1))))
+      `(#:phases
+        (modify-phases %standard-phases
+          (add-after 'configure 'relax-requirements
+            (lambda _
+              (substitute*
+                  "guix-vendor/rust-rsa-0.5.0.tar.gz/Cargo.toml"
+                (("version = \">=1, <1.5\"") "version = \"^1\""))
+              )))
+        #:cargo-inputs
+        (("rust-aes" ,rust-aes-0.7)
+         ("rust-anyhow" ,rust-anyhow-1)
+         ("rust-arrayvec" ,rust-arrayvec-0.7)
+         ("rust-async-trait" ,rust-async-trait-0.1)
+         ("rust-base32" ,rust-base32-0.4)
+         ("rust-base64" ,rust-base64-0.13)
+         ("rust-block-modes" ,rust-block-modes-0.8)
+         ("rust-block-padding" ,rust-block-padding-0.2)
+         ("rust-daemonize" ,rust-daemonize-0.4)
+         ("rust-directories" ,rust-directories-4)
+         ("rust-env-logger" ,rust-env-logger-0.9)
+         ("rust-hkdf" ,rust-hkdf-0.11)
+         ("rust-hmac" ,rust-hmac-0.11)
+         ("rust-humantime" ,rust-humantime-2)
+         ("rust-libc" ,rust-libc-0.2)
+         ("rust-log" ,rust-log-0.4)
+         ("rust-nix" ,rust-nix-0.23)
+         ("rust-paw" ,rust-paw-1)
+         ("rust-pbkdf2" ,rust-pbkdf2-0.9)
+         ("rust-percent-encoding" ,rust-percent-encoding-2)
+         ("rust-rand" ,rust-rand-0.8)
+         ("rust-region" ,rust-region-3)
+         ("rust-reqwest" ,rust-reqwest-0.11)
+         ("rust-rsa" ,rust-rsa-0.5)
+         ("rust-serde" ,rust-serde-1)
+         ("rust-serde-json" ,rust-serde-json-1)
+         ("rust-serde-path-to-error" ,rust-serde-path-to-error-0.1)
+         ("rust-serde-repr" ,rust-serde-repr-0.1)
+         ("rust-sha-1" ,rust-sha-1-0.9)
+         ("rust-sha2" ,rust-sha2-0.9)
+         ("rust-structopt" ,rust-structopt-0.3)
+         ("rust-tempfile" ,rust-tempfile-3)
+         ("rust-term-size" ,rust-term-size-0.3)
+         ("rust-textwrap" ,rust-textwrap-0.11)
+         ("rust-thiserror" ,rust-thiserror-1)
+         ("rust-tokio" ,rust-tokio-1)
+         ("rust-totp-lite" ,rust-totp-lite-1)
+         ("rust-url" ,rust-url-2)
+         ("rust-uuid" ,rust-uuid-0.8)
+         ("rust-zeroize" ,rust-zeroize-1))))
     (home-page "https://git.tozt.net/rbw")
     (synopsis "Unofficial Bitwarden CLI")
     (description "This package is an unofficial command line client for