unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: phodina <phodina@protonmail.com>
To: help-guix <help-guix@gnu.org>
Subject: Crates versions and their replacement
Date: Sun, 03 Oct 2021 07:02:38 +0000	[thread overview]
Message-ID: <_iKORBL8YRhY5YAb01lAkiuJHc2Tyt1WToJJfaKjmuoyYI-Ch4Rt_pJ4EM-5OOTHvPHQwTpKzZ1flPHjrrlPfoxp1_lAEpbohni8fknQXJs=@protonmail.com> (raw)

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	other threads:[~2021-10-03  7:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03  7:02 phodina [this message]
2021-10-05 18:19 ` Crates versions and their replacement Hartmut Goebel
2021-10-10  7:11   ` phodina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='_iKORBL8YRhY5YAb01lAkiuJHc2Tyt1WToJJfaKjmuoyYI-Ch4Rt_pJ4EM-5OOTHvPHQwTpKzZ1flPHjrrlPfoxp1_lAEpbohni8fknQXJs=@protonmail.com' \
    --to=phodina@protonmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).