On Mon, 14 Apr 2025 21:20:40 +0800,
Gabriel Santos wrote:
>
> Em 14 de abril de 2025 08:59:04 BRT, Gabriel Santos 
> <gabrielsantosdeso...@disroot.org> escreveu:
> >>> 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'll try it again.
> >
>
> I still couldn't get these packages imported, but I still
> managed to add them manually to rust-crates.scm.



> Here is a step-by-step process of what I'm doing:
>
> 1. Spawn a shell with the necessary dependencies:
>
> > branch based on origin/rust-team
> > /path/to/guix $ ./pre-inst-env guix shell rust rust:cargo cargo-audit 
> > cargo-license
>
> 2. Import the package definition with guix import:
>
> > branch based on origin/rust-team
> > /path/to/guix $ ./pre-inst-env guix import crate pay-respects
> > /path/to/guix $ guix shell -D guix -CPW -- make
>
> I then replace the old "(arguments #:cargo-inputs)"
> with the new "(inputs (cargo-inputs 'pay-respects))".
>
> 3. Getting the package source:
>
> > /path/to/guix $ cd /tmp
> > /tmp $ git clone https://codeberg.org/iff/pay-respects

The git repository is different from the one published to crates.io.  crates.io
only hosts individual crates.

This git repository is a Cargo Workspaces which contains multiple crates.
Workspace members are local so no enough information is available in Cargo.lock.

You need to either package the git repository and enable Cargo Workspace support
in cargo-build-system, or use lockfile from the crates.io source.

--8<---------------cut here---------------start------------->8---
tar xf $(guix build --source pay-respects) -C /tmp
--8<---------------cut here---------------end--------------->8---

> 4. Executing the necessary commands:
>
> > /tmp $ cd pay-respects
> > main branch
> > /tmp/pay-respects $ cargo generate-lockfile
> > /tmp/pay-respects $ cargo audit
> > /tmp/pay-respects $ cargo license
>
> 5. Importing dependencies from the lockfile:
>
> > /tmp/pay-respects $ cd /path/to/guix
> > branch based on origin/rust-team
> > /path/to/guix $ ./pre-inst-env guix import -i gnu/packages/rust-crates.scm 
> > crate -f /tmp/pay-respects/Cargo.lock pay-respects
> > /path/to/guix $ guix shell -D guix -CPW -- make
>
> At this point, I already notice that both dependencies weren't
> imported, as looking for them in alphabetical order in
> "pay-respects-cargo-inputs" only shows "rust-parking-lot"
> under "rust-pa".
>
> There's also no sign of these packages in the rest of the
> rust-crates.scm diff.
>
> After that, I still try to build pay-respects:
>
> > branch based on origin/rust-team
> > ./pre-inst-env guix build pay-respects
>
> The build then expectedly fails, because "pay-respects-parser"
> could not be found.
>
> But, since I got it to build, I'll check the package licenses
> with cargo license again just to be sure, and then submit a patch.
>
> --
> Gabriel Santos

Reply via email to