Summary: | Porter's Handbook: Using cargo: Use Makefile.crates instead of Makefile's CARGO_CRATES | ||
---|---|---|---|
Product: | Documentation | Reporter: | Nuno Teixeira <eduardo> |
Component: | Books & Articles | Assignee: | freebsd-doc (Nobody) <doc> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | diizzy, felix |
Priority: | --- | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Nuno Teixeira
2022-09-23 19:44:41 UTC
First step would be adding instructions to Porters Handbook otherwise we'll just create an endless loop of fixing added ports. I'd suggest that you use Phabricator (reviews.freebsd.org) and loop in Rust as well as portmgr and docs ppl. 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. (In reply to Tobias Kortkamp from comment #2) FWIW, branch with cargo.mk that seeds CARGO_CRATES from distinfo: https://codeberg.org/tobik/freebsd-ports/commits/branch/no-CARGO_CRATES Hello all, Just noticed that Makefile.crates was added to Porter's Handbook: https://docs.freebsd.org/en/books/porters-handbook/book/#using-cargo Thanks |