Subject: [PATCH v4 rust-team 00/22] Cargo.lock importer and build system changes.

From: Hilton Chain <[email-masked]>
Date: Tue, 29 Apr 2025 00:22:57 +0800

Main changes since v3:
* ‘define-cargo-inputs’ macro suggested by Ludovic.
* ‘cargo-inputs-from-lockfile’ suggested by Zheng Junjie, which can be used in
  the guix.scm of a Rust project.
* Rephrase docstring.

Some changes have been made on rust-team since v3, this revision also sends
all of them out for review.

I'll change the terms Rust program & dependency to application & library, btw.

Since there're too many patches in this issue, I think it would be better to
open a new one for documentation.

Thanks

Efraim Flashner (1):
  build/cargo: Don't try to unpack sanity-check.py.

Hilton Chain (21):
  scripts: import: Correct behavior for ‘--insert’ option.
  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/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.
  build/cargo: Don't vendor self.
  build/cargo: Use system libsqlite3.
  build/cargo: Use sytsem oniguruma.
  build/cargo: Unconditionally use system gettext.
  build-system: cargo: Add ‘cargo-inputs’.
  build-system: cargo: Export ‘cargo-triplet’.
  build/cargo: Accept rust-sysroot from native-inputs.
  import: crate: Add Cargo.lock parser.
  import: crate: Add ‘--lockfile’ option.

 Makefile.am                         |   1 +
 doc/guix.texi                       |  15 +++
 etc/teams.scm                       |   1 +
 etc/teams/rust/audit-rust-crates    |  70 +++++++++++
 etc/teams/rust/cleanup-crates.sh    |  37 ++++++
 etc/teams/rust/rust-crates.tmpl     |  44 +++++++
 etc/teams/rust/unpack-new-crates.sh |  45 +++++++
 gnu/local.mk                        |   2 +
 gnu/packages/antivirus.scm          |   5 +-
 gnu/packages/gnome.scm              |   5 -
 gnu/packages/python-crypto.scm      |   5 -
 gnu/packages/python-xyz.scm         |   5 -
 gnu/packages/rust-crates.scm        |  44 +++++++
 gnu/packages/rust-sources.scm       |  29 +++++
 gnu/packages/syndication.scm        |   5 -
 guix/build-system/cargo.scm         |  66 +++++++++-
 guix/build/cargo-build-system.scm   | 179 ++++++++++++++++++++--------
 guix/import/crate.scm               | 128 +++++++++++++++++++-
 guix/import/crate/cargo-lock.scm    | 105 ++++++++++++++++
 guix/scripts/import.scm             |  67 ++++++++---
 guix/scripts/import/crate.scm       |  57 +++++++--
 guix/utils.scm                      |  29 +++--
 tests/crate.scm                     |  87 ++++++++++++++
 23 files changed, 914 insertions(+), 117 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 100755 etc/teams/rust/unpack-new-crates.sh
 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

base-commit: 8f57b1dd2a544b882d365c5be17ebcf51d9594f6
--
2.49.0