CARGO-MODULE(5)

πŸ“¦ in nixpkgs unstable

πŸŽ€ 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 in MODCARGO_CRATES are downloaded using MODCARGO_DIST_SUBDIR as DIST_SUBDIR. 🫢
  • During post-extract, crates defined in MODCARGO_CRATES are moved to the MODCARGO_VENDOR_DIR directory.
  • During post-patch, crate-metadata are generated using devel/cargo-generate-vendor. ✨
  • With CONFIGURE_STYLE set to cargo, cargo is configured to use MODCARGO_VENDOR_DIR instead of the standard crates-io network source. Finally, any crates listed in MODCARGO_CRATES_UPDATE are 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 to Cargo.lock, which is used only by the modcargo-gen-crates target. 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 in Cargo.lock. ⭐
  • MODCARGO_FEATURES β€” list of features to be used when building. 🌸
  • MODCARGO_INSTALL_TARGET_PATHS β€” list of paths to pass to cargo install instead 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-specific WANTLIB entries required by all Rust code. It is a copy of MODRUST_WANTLIB provided for simplicity. 🧚

This module adds three make(1) targets:

  • modcargo-metadata β€” rerun the generation of crates' metadata. πŸ’«
  • modcargo-gen-crates β€” generate the MODCARGO_CRATES list from Cargo.lock (a preliminary crates list is not required). 🌈
  • modcargo-gen-crates-licenses β€” generate the MODCARGO_CRATES list with license information from crates present in the MODCARGO_VENDOR_DIR directory. πŸ’œ

πŸ‘€ SEE ALSO πŸ‘€

port-modules(5)


Later bestie β€” this one’s from the Debian edition, dated January 13, 2025. πŸ’–βœ¨

πŸ“¦ where this page comes from
  • nixpkgs unstable: cvs-export
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms