Subject: [bug#77093] [PATCH rust-team v3 00/17] New Rust packaging workflow based on lockfile importer.

From: Hilton Chain <[email-masked]>
Date: Sat, 05 Apr 2025 10:53:33 +0800

On Sun, 23 Mar 2025 15:23:04 +0800,
Hilton Chain wrote:
>
> V2 -> V3:
> * Add Efraim's etc/teams/rust/audit-rust-crates script.
> * Add (guix import crate cargo-lock) to Rust team's scope.
> * ‘definer’ -> ‘define-prefix’
> * Adjust documentation and move examples to Guix Cookbook.
> * Document ‘cargo-inputs’ and remove mentioning of files under etc/teams/rust.
>
> Diff inserted at end.
>
> Efraim Flashner (1):
>   build/cargo: Don't try to unpack sanity-check.py.
>
> Hilton Chain (16):
>   build/cargo: Pass ‘--offline’ to cargo.
>   build/cargo: Print out all non-empty binary files.
>   build-system: cargo: Support packaging Cargo workspace.
>   build-system: cargo: Support installing Cargo workspace.
>   build/cargo: Set default value of arguments for build phases.
>   build/cargo: Support non-workspace directory source inputs.
>   scripts: import: Document argument for ‘--insert’ option in help
>     message.
>   scripts: import: Add two newlines for ‘--insert’ option.
>   scripts: import: Support expressions defined by 'define.
>   scripts: import: Pass "--insert" to importers.
>   scripts: import: Skip existing definition for ‘--insert’ option.
>   import: crate: crate-name->package-name: Move to (guix build-system
>     cargo).
>   build-system: cargo: Add ‘cargo-inputs’.
>   import: crate: Add Cargo.lock parser.
>   import: crate: Add ‘--lockfile’ option.
>   doc: Document lockfile importer based Rust packaging workflow.
>
>  Makefile.am                       |   1 +
>  doc/contributing.texi             |  91 +++++---
>  doc/guix-cookbook.texi            | 352 ++++++++++++++++++++++++++++++
>  doc/guix.texi                     |  24 ++
>  etc/teams.scm                     |   1 +
>  etc/teams/rust/audit-rust-crates  |  70 ++++++
>  etc/teams/rust/cleanup-crates.sh  |  37 ++++
>  etc/teams/rust/rust-crates.tmpl   |  42 ++++
>  gnu/local.mk                      |   2 +
>  gnu/packages/rust-crates.scm      |  42 ++++
>  gnu/packages/rust-sources.scm     |  29 +++
>  guix/build-system/cargo.scm       |  59 ++++-
>  guix/build/cargo-build-system.scm | 150 +++++++++----
>  guix/import/crate.scm             |  81 ++++++-
>  guix/import/crate/cargo-lock.scm  | 105 +++++++++
>  guix/scripts/import.scm           |  54 +++--
>  guix/scripts/import/crate.scm     |  58 ++++-
>  guix/utils.scm                    |  29 ++-
>  tests/crate.scm                   |  88 ++++++++
>  19 files changed, 1209 insertions(+), 106 deletions(-)
>  create mode 100755 etc/teams/rust/audit-rust-crates
>  create mode 100755 etc/teams/rust/cleanup-crates.sh
>  create mode 100644 etc/teams/rust/rust-crates.tmpl
>  create mode 100644 gnu/packages/rust-crates.scm
>  create mode 100644 gnu/packages/rust-sources.scm
>  create mode 100644 guix/import/crate/cargo-lock.scm

I'll apply this series (except the documentation change, which will be tracked
here separately) to rust-team when I have checked an initial set of packages.

In case it's useful, I'm using this script to get a list of unstaged crates to
look through:
--8<---------------cut here---------------start------------->8---
for i in $(git diff gnu/packages/rust-crates.scm | grep -E '^\+\(define rust-' | cut -f2 -d' ')
do
    guix build -e "(@@ (gnu packages rust-crates) $i)" -v0
done
--8<---------------cut here---------------end--------------->8---

Thanks