On Mon, 14 Apr 2025 18:36:03 +0800,
Gabriel Santos wrote:
>
> Some comments and issues I had with the new workflow when
> updating my pay-respects[1] patch.
>
> I followed the instructions from the Cookbook[1].
>
> >Since @code{cargo-audit} is available on crates.io, We can
> >generate a draft definition via the crates.io importer
> >(@pxref{Invoking guix import,,, guix, GNU Guix Reference Manual}).
> >In the end we'll have the following definition:
> >
> >[Definition of cargo-audit using the new input system]
>
> When running "guix import crate" from the rust-team branch
> by using pre-inst-env, I got a resulting package with the
> classic "arguments #:cargo-inputs" input. Is an update to
> the guix import command still pending?

New importer is added as an option, the old one hasn't been touched.

It may be changed, but I need a deprecation plan first.

> >Unpack package source and navugate to the unpacked directory,
> >then execute the following commands:
> >
> >@example
> >$ cargo generate-lockfile
> >$ cargo audit
> >$ cargo license
>
> I think this step should be placed after we spawn the new shell.
>
> Also, a bit unrelated, but the output of cargo audit isn't
> that helpfull:
>
> >Fetching advisory database from `https://github.ckm/RustSec/advisory-db.git`
> >Loaded 752 security advisories (from /home/gabriel/.cargo/advisory-db)
> >Updating crates.io index
> >Scanning Cargo.lock for vulnerabilities (250 crate dependencies)
>
> ...And the result of the scan was? I would assume no issues since
> there's nothing after this message, but this is Rust-specific,
> not Guix, so let's continue.

No news is good news :)
It only outputs issues.

> >Import dependencies from previously generated lockfile:
> >
> >@example
> >$ guix import --insert=gnu/packages/rust-crates.scm \
> >[import of cargo-audit]
>
> Then I try to do this with pre-inst-env:
>
> >$ ./pre-inst-env guix import --insert=gnu/packages/rust-crates.scm \
> >crate --lockfile=/tmp/pay-respects/Cargo.lock pay-respects
>
> The error I got was:
>
> >guix import: error: --insert=gnu/packages/rust-crates.scm

hmmm, I was using ‘-i’ and not noticed it at all.  ‘--insert’ option is handled
differently, you need ‘--insert FILE’, I'll correct the documentation.

> I managed to solve thhis by just piping the output to a file:
>
> >./pre-inst-env guix import crate --lockfile=/tmp/pay-respects/Cargo.lock \
> >pay-respects > bla.scm
>
> But, doing this, I got a bunch of packages that already were part
> of rust-crates.scm, so I had to check and remove a lot of
> duplicates.
>
> And that was it for me in the Cookbook, I didn't have to deal with
> potentially bundled sources.
>
> The last issue I faced was that the pay-respects parser[3]
> and utilities[4] weren't imported.

I can't reproduce this.  They are imported on my side.

> I solved this by just adding them to the list anyway:
>
> >(inputs (cons* rust-pay-respects-parser-0.3
> >rust-pay-respects-utils-0.1
> >(cargo-inputs 'pay-respects)))
>
> (Indentation isn't like this, just too lazy to accurately
> represent)
>
> They are regular packages that were added to crates-shell.scm.
> Was that the right approach?

No, all crates-* modules will be deleted some day.

Source packages should go into rust-sources.scm.

> Overall, I think this new system is a way better approach.
> Thanks for working on this!
>
> And, on rust-apps.scm:
>
> ><gabriel.santos.s...@gmail.com>
>
> That's the e-mail I use to just send patches, my actual
> e-mail is this one (<gabrielsantosdeso...@disroot.org>)
>
> Looking at the git log, it seems that I changed my identification
> to that e-mail (the stmp@gmail one), so sorry for that.
> In the newer commits I'm using this e-mail for the author.
> With that said, can I fix this line in my patch?

No problem, just add it in your patch.

Reply via email to