pkgcore / pkgcheck

pkgcore-based QA utility for ebuild repos
https://pkgcore.github.io/pkgcheck
BSD 3-Clause "New" or "Revised" License
34 stars 29 forks source link

[New Check]: Check for `CARGO_OPTIONAL` with no `virtual/rust` or `RUST_DEPEND` in *DEPEND #615

Closed thesamesam closed 10 months ago

thesamesam commented 10 months ago

Is there an existing such new check request for this?

Explain

cargo.eclass has CARGO_OPTIONAL which requires consumers to handle dependencies themselves, it also disables exporting phases.

With CARGO_OPTIONAL set, it's wrong to not have virtual/rust (or RUST_DEPEND - see below) in any *DEPEND because surely Rust is being used somewhere.

Note: I'm not sure if we should check for RUST_DEPEND or virtual/rust. RUST_DEPEND doesn't seem to be a documented eclass variable right now.

This will work similarly to PythonMissingDeps (https://github.com/pkgcore/pkgcheck/commit/966f4d1cf254ce2610d0697d65c434056328a798).

Examples

https://github.com/gentoo/gentoo/commit/df6ef35299d01e4e8805b2f2964700db279bab8e

Output message

RustMissingDeps: Package sets CARGO_OPTIONAL but does not depend on virtual/rust.

Documentation

No response

Result level

warning

thesamesam commented 10 months ago

Maybe we should do it for these too: