unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Wilko Meyer <w@wmeyer.eu>
To: help-guix@gnu.org
Subject: proper way to resolve dependency version conflicts of rust crates?
Date: Sun, 07 Jan 2024 17:32:12 +0100	[thread overview]
Message-ID: <87v885axd0.fsf@wmeyer.eu> (raw)

Hi Guix,

What's the right way to resolve version dependency conflicts for rust
crates that (in semver notation) depend on the same dependency
MAJOR.MINOR version but want a different PATCH version (e.g. 0.13.1 and
0.13.2)?

As far as I'm aware for rust crates we keep:

- all 0.MINOR versions, e.g. rust-foo-0.1,rust-foo-0.42 etc.
- as soon as a crate hits v1 we keep one package per major version >1
- (e.g. rust-foo-1, rust-foo-2).

So building packages that depend on a different PATCH-Version may under
some circumstances fail with a error similar to:

#+BEGIN_SRC
error: failed to select a version for the requirement `hashbrown = "=0.13.1"`
candidate versions found which didn't match: 0.14.3, 0.13.2, 0.12.3, ...
...
perhaps a crate was updated and forgotten to be re-vendored?
#+END_SRC

Right now I see three possible solutions to this:

1. Sent a patch to the upstream of the crate as well as to guix updating
  all crate dependencies to most-recent.
2. Define a package variant of said dependency, let's say foo-0.13-1 for
  v0.13.1 of foo.
3. Substitute the required version in Cargo.toml of a affected crate to
  match the package-version of said dependency we've packaged in Guix.

If I had to guess 3. would be the most appropriate way forward on this?

-- 
Kind regards,

Wilko Meyer
w@wmeyer.eu


             reply	other threads:[~2024-01-07 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-07 16:32 Wilko Meyer [this message]
2024-01-08 10:02 ` proper way to resolve dependency version conflicts of rust crates? Ignas Lapėnas
2024-01-14  1:33   ` Wilko Meyer

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=87v885axd0.fsf@wmeyer.eu \
    --to=w@wmeyer.eu \
    --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).