Subject: [bug#77093] [PATCH rust-team v3 16/17] import: crate: Add ‘--lockfile’ option.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 22 Apr 2025 23:28:17 +0200

Hilton Chain <[email-masked]> writes:

> * guix/scripts/import/crate.scm (%options): Add ‘--lockfile’ option.
> * guix/scripts/import/crate.scm (show-help): Add it.
> (guix-import-crate): Use it.
> * doc/guix.texi (Invoking guix import): Document it.
> * tests/crate.scm (temp-file): New variable.
> ("crate-lockfile-import"): New test.
>
> Change-Id: I291478e04adf9f2df0bf216425a5e8aeba0bedd9

[...]

> +        (match crates-definitions
> +          (((define 'rust-adler2-2.0.0
> +              (crate-source
> +               "adler2" "2.0.0"
> +               "09r6drylvgy8vv8k20lnbvwq8gp09h7smfn6h1rxsy15pgh629si"))

Note that this doesn’t actually testwhat you’d like.  For instance, it
would match:

  ((whatever rust-adler2-2.0.0
             (nonsense "adler2" "2.0.0"
                       "09r6drylvgy8vv8k20lnbvwq8gp09h7smfn6h1rxsy15pgh629si"))
   …)             

But the bug is already here in ‘master’, uh.

So you need to quote every symbol that is meant to be matched literally,
or wrap the pattern in quasiquote, as is done in ‘tests/gem.scm’:

  (match …
    ((`(define rust-adler2-2.0.0 (crate-source …))) #t))

Ludo’.