* 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
* Re: Crates versions and their replacement
2021-10-03 7:02 Crates versions and their replacement phodina
@ 2021-10-05 18:19 ` Hartmut Goebel
2021-10-10 7:11 ` phodina
0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Goebel @ 2021-10-05 18:19 UTC (permalink / raw)
To: phodina, help-guix
Am 03.10.21 um 09:02 schrieb phodina:
> Now comes the question. How often should it be use and what are the
> pros and cons?
I suggest to use this only if required, since versions are defined to
strict.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Crates versions and their replacement
2021-10-05 18:19 ` Hartmut Goebel
@ 2021-10-10 7:11 ` phodina
0 siblings, 0 replies; 3+ messages in thread
From: phodina @ 2021-10-10 7:11 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: help-guix
Hi Hartmut,
On Tuesday, October 5th, 2021 at 8:19 PM, Hartmut Goebel <h.goebel@crazy-compilers.com> wrote:
> Am 03.10.21 um 09:02 schrieb phodina:
>
> > Now comes the question. How often should it be use and what are the
> >
> > pros and cons?
>
> I suggest to use this only if required, since versions are defined to
>
> strict.
Thanks for the answer. So there are only two options.
1. Create a patch for the package - that means bump up the version in the Cargo.toml and fix all the stuff in the code so that it works. Then send this PR to the project and include the patch in patches directory.
2. Include the required package definition in the Guix cargo-*.scm file even if there is a version similar to the one that I package or if the version is an older one.
The substitution is possible only in rare cases.
This is also probably applicable to other languages, right?
>
> ---------------------------------------------------------------------------------
>
> Regards
>
> Hartmut Goebel
>
> | Hartmut Goebel | h.goebel@crazy-compilers.com |
>
> | www.crazy-compilers.com | compilers which you thought are impossible |
^ 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).