CARGO-MODULE(5)
π NAME π
okay so bestie, welcome to CARGO-MODULE(5) from the File Formats Manual β this is the page for cargo-module, aka the devel/cargo port module. Periodt. π
β¨ DESCRIPTION β¨
This page is literally the behavior guide for setting MODULES=devel/cargo in the ports(7) tree. No cap.
It automates downloading and compiling the dependencies of a Rust project using cargo(1). Obsessed.
Hereβs the timeline, bestie:
- During
fetch, static dependencies ("crates") listed inMODCARGO_CRATESare downloaded usingMODCARGO_DIST_SUBDIRasDIST_SUBDIR. π«Ά - During
post-extract, crates defined inMODCARGO_CRATESare moved to theMODCARGO_VENDOR_DIRdirectory. - During
post-patch, crate-metadata are generated usingdevel/cargo-generate-vendor. β¨ - With
CONFIGURE_STYLEset tocargo, cargo is configured to useMODCARGO_VENDOR_DIRinstead of the standardcrates-ionetwork source. Finally, any crates listed inMODCARGO_CRATES_UPDATEare updated. π₯
MODCARGO_RUSTFLAGS can be used to pass custom flags to all rustc(1) invocations. Slay.
Also: lang/rust is added to MODULES, and devel/cargo-generate-vendor is added to BUILD_DEPENDS. π
Vibe check, bestie β this module defines:
MODCARGO_CARGOTOMLβ path to the cargo manifest. Defaults to${WRKSRC}/Cargo.toml. πMODCARGO_CARGOLOCKβ path toCargo.lock, which is used only by themodcargo-gen-cratestarget. Defaults to${MODCARGO_CARGOTOML:toml=lock}. π¦MODCARGO_CRATESβ crates that will be downloaded by the module. πMODCARGO_CRATES_UPDATEβ list of crates to update, overriding the version listed inCargo.lock. βMODCARGO_FEATURESβ list of features to be used when building. πΈMODCARGO_INSTALL_TARGET_PATHSβ list of paths to pass tocargo installinstead of.. Needs to be set for some virtual manifests. πMODCARGO_VENDOR_DIRβ name of the local directory for vendoring crates. Defaults to${WRKSRC}/modcargo-crates. πMODCARGO_WANTLIBβ architecture-specificWANTLIBentries required by all Rust code. It is a copy ofMODRUST_WANTLIBprovided for simplicity. π§
This module adds three make(1) targets:
modcargo-metadataβ rerun the generation of crates' metadata. π«modcargo-gen-cratesβ generate theMODCARGO_CRATESlist fromCargo.lock(a preliminary crates list is not required). πmodcargo-gen-crates-licensesβ generate theMODCARGO_CRATESlist with license information from crates present in theMODCARGO_VENDOR_DIRdirectory. π
π SEE ALSO π
Later bestie β this oneβs from the Debian edition, dated January 13, 2025. πβ¨
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2008 Marc Espie
- Copyright (c) 2017 Daniel Jakots
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms