help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crates versions and their replacement


From: phodina
Subject: Crates versions and their replacement
Date: Sun, 03 Oct 2021 07:02:38 +0000

Hi Guix,

I got questions regarding packaging Rust crates in Guix and
unfotunately I haven't found an answer in the documentation nor
in the help archive.

1. Sometimes the crate described in the Cargo.toml of a new package
  is not available but there is another with different higher minor
  or patch version. It is understandable that the repo will not have
  all the Rust packages that are on the crates.io. It also applies
  when the author specifies exact commit.

  In the gnu/packages/crates-io.scm there is a special phase usually
  called fix-version-requirements. Here's the excerpt:

         (add-after 'unpack 'fix-version-requirements
           (lambda _
             (substitute* "Cargo.toml"
               (("0.7.7") ,(package-version rust-mio-0.7)))
             #t)))))

  Now comes the question. How often should it be use and what are the
  pros and cons?

  I understand that it's better than the patch as this replaces the
  version with the correct one on the fly.

2. How do I do multiline replace as with large crate dependency list
   there are sometimes crates with the same version?

   Based on the substitute description it replaces only a line but
   the definition of the crate and the version are on separate lines
   in the Cargo.toml.

Petr





reply via email to

[Prev in Thread] Current Thread [Next in Thread]