[Bug 266571] Porter's Handbook: Using cargo: Use Makefile.crates instead of Makefile's CARGO_CRATES

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 27 Sep 2022 12:20:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266571

--- Comment #2 from Tobias Kortkamp <tobik@freebsd.org> ---
My 2 cents:

- Document Makefile.crates as a possible location but leave it up to
  the maintainer where to put CARGO_CRATES

- It should be documented explicitly that CARGO_CRATES in Makefile is fine
  too. Don't make this a review issue plz.

- Independent of where CARGO_CRATES is stored, updating it can be
  done automatically with cargo-crates-merge if portfmt is installed

I feel like you don't gain anything by declaring that CARGO_CRATES
must be in Makefile.crates instead of Makefile. What's needed is a
technical USES=cargo change along the lines of either

- keep current approach but seed most of CARGO_CRATES from distinfo
  (since we currently have duplication of the same information for
  normal crates). Then most ports won't need to set CARGO_CRATES
  explicitly anywhere.

- properly hook crates to the dependency graph as build inputs (as
  ports that do not create packages to allow reuse of their WRKSRC in
  USES=cargo via something like
  BUILD_DEPENDS=rust-crates.io-libc>0:devel/rust-crates.io-libc:patch).
  Basically adopt a similar approach like GNU Guix cargo-build-system
  with the extra bonus of removing most of the duplicated crate versions
  we currently have (how many libc crate version do we really need???) and
  will allow us to deal with the many vulnerable crates in the tree in a
  comprehensive way just like normal dependencies.

-- 
You are receiving this mail because:
You are the assignee for the bug.