Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eclass: Updates for Rust checks #718

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/pkgcheck/checks/eclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ class RubyMissingDeps(results.VersionResult, results.Warning):


class RustMissingDeps(results.VersionResult, results.Warning):
"""Package sets ``CARGO_OPTIONAL`` but does not depend on ``virtual/rust``."""
"""Package sets ``RUST_OPTIONAL`` but does not use ``${RUST_DEPEND}``."""

desc = "sets CARGO_OPTIONAL but does not depend on virtual/rust"
desc = "sets RUST_OPTIONAL (or CARGO_OPTIONAL) but does not use ${RUST_DEPEND}"


class TmpfilesMissingDeps(results.VersionResult, results.Warning):
Expand All @@ -542,7 +542,8 @@ class EclassManualDepsCheck(Check):

dependencies = (
# eclass, variable, one of deps, class
("cargo", "CARGO_OPTIONAL", {"virtual/rust"}, RustMissingDeps),
("cargo", "CARGO_OPTIONAL", {"dev-lang/rust", "dev-lang/rust-bin"}, RustMissingDeps),
("rust", "RUST_OPTIONAL", {"dev-lang/rust", "dev-lang/rust-bin"}, RustMissingDeps),
("go-module", "GO_OPTIONAL", {"dev-lang/go"}, GoMissingDeps),
(
"ruby-ng",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"__class__": "RustMissingDeps", "category": "EclassManualDepsCheck", "package": "RustMissingDeps", "version": "1"}
{"__class__": "RustMissingDeps", "category": "EclassManualDepsCheck", "package": "RustMissingDeps", "version": "3"}
{"__class__": "RustMissingDeps", "category": "EclassManualDepsCheck", "package": "RustMissingDeps", "version": "4"}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,22 @@ diff -Naur standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.eb
LICENSE="BSD"
SLOT="0"
+
+BDEPEND="virtual/rust"
+BDEPEND="${RUST_DEPEND}"
diff -Naur standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-3.ebuild fixed/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-3.ebuild
--- standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-3.ebuild
+++ fixed/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-3.ebuild
@@ -8,3 +8,5 @@ DESCRIPTION="Optional inherit without deps"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="0"
+
+BDEPEND="${RUST_DEPEND}"
diff -Naur standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-4.ebuild fixed/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-4.ebuild
--- standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-4.ebuild
+++ fixed/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-4.ebuild
@@ -8,3 +8,5 @@ DESCRIPTION="Optional inherit without deps"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="0"
+
+BDEPEND="${RUST_DEPEND}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
inherit rust

DESCRIPTION="Normal non-optional inherit"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EAPI=7

RUST_OPTIONAL=1

inherit rust

DESCRIPTION="Optional inherit without deps"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EAPI=7

RUST_OPTIONAL=1

inherit cargo

DESCRIPTION="Optional inherit without deps"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DESCRIPTION="Stub ebuild"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="${PV}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DESCRIPTION="Stub ebuild"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="${PV}"
4 changes: 4 additions & 0 deletions testdata/repos/standalone/dev-lang/rust/rust-1.81.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DESCRIPTION="Stub ebuild"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="${PV}"
4 changes: 4 additions & 0 deletions testdata/repos/standalone/dev-lang/rust/rust-1.82.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DESCRIPTION="Stub ebuild"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="${PV}"
6 changes: 6 additions & 0 deletions testdata/repos/standalone/eclass/cargo.eclass
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# cargo eclass

if [[ -n ${CARGO_OPTIONAL} ]]; then
RUST_OPTIONAL=1
fi

inherit rust

CARGO_CRATE_URIS=${CRATES}

cargo_crate_uris() { :; }
10 changes: 10 additions & 0 deletions testdata/repos/standalone/eclass/rust.eclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# rust eclass

RUST_DEPEND="
|| (
dev-lang/rust-bin:1.82.0
dev-lang/rust:1.82.0
dev-lang/rust-bin:1.81.0
dev-lang/rust:1.81.0
)
"
2 changes: 0 additions & 2 deletions testdata/repos/standalone/virtual/rust/rust-0.ebuild

This file was deleted.

Loading