unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Crates versions and their replacement
@ 2021-10-03  7:02 phodina
  2021-10-05 18:19 ` Hartmut Goebel
  0 siblings, 1 reply; 3+ messages in thread
From: phodina @ 2021-10-03  7:02 UTC (permalink / raw)
  To: help-guix

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-10  7:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03  7:02 Crates versions and their replacement phodina
2021-10-05 18:19 ` Hartmut Goebel
2021-10-10  7:11   ` phodina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).