feat(#3245): gate rustdoc in nix flake check, and clear the workspace
Nothing in the gate read doc-comments: clippy doesn't check intra-doc links, cargo test doesn't, and no check built docs. So a [`Foo`] pointing at a renamed, moved or deleted item rendered as plain text and had no discoverer but a human happening to read the comment. That matters here more than in most repos, because the convention is to put a thing's authoritative description in one doc-comment and point at it from everywhere else -- the design leans on the pointers being real, and a dangling link is worse than no link since it names something and sends the reader looking. Adds `docs-rustdoc` to nix/checks.nix: craneLib.cargoDoc over --workspace --no-deps --document-private-items, denying six rustdoc lints. Listed explicitly rather than -D warnings so a new lint appearing upstream cannot red the build on a class nobody has triaged. --document-private-items is load-bearing rather than thoroughness for its own sake: most of this workspace's doc-comments live on private items and //! module headers, so without it rustdoc checks a small fraction of the links and the gate sits green while the rot continues. Then fixes every error it reports, 40 to 0 across nine crates. The classes differ and so do the fixes: - public item, wrong scope -> qualify. Node and Node::parent are both public; the link failed only because scheduler.rs does not import Node. Six sites become [`crate::Node::parent`]. - private item -> downgrade to backticks. Nothing was made public to satisfy a lint; changing API surface to appease a doc check would be the tail wagging the dog. - genuinely dead -> [`JobBuilder::insert_into`] names a method that does not exist. Insertion is Scheduler::insert_job. - prose that looks like markup -> argv[0] parsed as a link, and <args>/<hex>/<name> parsed as HTML tags. Note for future fixes: pub(crate) resolves in an intra-doc link, a plain private fn in a binary crate does not (wait_for_nodes resolved, connect_hint did not, same crate, same shape). The check does not ride the clippy/test artifact cache. It takes cargoArtifacts, but rustdoc needs its own flavour of dependency metadata, which cargo build does not produce, so a --no-deps docs build still compiles dependencies it never documents. Measured at 6m47s cold; that reasoning is recorded in the check's own comment so the next reader does not re-derive it. Verified by running the check's exact command against the pre-cleanup tree first: 40 errors, build failed. A gate that cannot fail is not evidence, and building it before the cleanup makes that proof free.
This commit is contained in:
parent
90cd602d4e
commit
be3411e180
20 changed files with 88 additions and 41 deletions
|
|
@ -38,7 +38,7 @@ use crate::builder::{BuildError, JobBuilder, NodeGuid};
|
|||
use crate::resources::ResourceTable;
|
||||
use crate::{Dep, Graph, GraphError, NodeId, State, TerminalState};
|
||||
|
||||
/// The result of a node's own execution, reported to [`Scheduler::complete`].
|
||||
/// The result of a node's own execution, reported to `Scheduler::complete`.
|
||||
///
|
||||
/// `Cancelled` is not an outcome a runner reports — it is scheduler-driven (an
|
||||
/// `AfterOk` dependency failed), so a runner only ever says `Done` or `Failed`.
|
||||
|
|
@ -60,7 +60,7 @@ pub struct Scheduler<N, R: Clone + Eq + Hash> {
|
|||
resources: ResourceTable<R>,
|
||||
/// Fresh units each owner node acquired: `owner → [(resource, count)]`.
|
||||
/// Recorded against the node that *acquired* the units (never a borrower);
|
||||
/// released back to the table once the owner and its whole [`Node::parent`]
|
||||
/// released back to the table once the owner and its whole [`crate::Node::parent`]
|
||||
/// subtree are terminal.
|
||||
owned: HashMap<NodeId, Vec<(R, u32)>>,
|
||||
/// Which branch currently borrows a given owner's grant: `(owner, resource)
|
||||
|
|
@ -89,7 +89,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
}
|
||||
|
||||
/// Append a node under `parent` — e.g. a running node growing more work into
|
||||
/// its own subtree. Delegates to [`Graph::insert`]; claim again afterwards
|
||||
/// its own subtree. Delegates to `Graph::insert`; claim again afterwards
|
||||
/// to start it once it is runnable.
|
||||
///
|
||||
/// # Errors
|
||||
|
|
@ -114,7 +114,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
/// being passed around as a spec.
|
||||
///
|
||||
/// The one insertion entry point for a job. Nodes go straight into
|
||||
/// [`Graph::insert_unchecked`]: [`crate::builder::check_job_shape`] has
|
||||
/// `Graph::insert_unchecked`: `check_job_shape` has
|
||||
/// already decided every rejection the graph could raise, so re-validating
|
||||
/// per node could only report a problem *after* the earlier nodes were
|
||||
/// inserted. Claim again afterwards to start whatever became runnable.
|
||||
|
|
@ -253,7 +253,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
true
|
||||
}
|
||||
|
||||
/// The nearest [`Node::parent`] ancestor of `id` that *owns* (holds real
|
||||
/// The nearest [`crate::Node::parent`] ancestor of `id` that *owns* (holds real
|
||||
/// units of) `name`, or `None` if none does (⇒ `id` must acquire it fresh).
|
||||
fn parent_ancestor_owning(&self, id: NodeId, name: &R) -> Option<NodeId> {
|
||||
let mut cur = self.graph.node(id).and_then(|n| n.parent);
|
||||
|
|
@ -266,7 +266,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
None
|
||||
}
|
||||
|
||||
/// Whether `ancestor` lies on `id`'s [`Node::parent`] chain (i.e. `id` is in
|
||||
/// Whether `ancestor` lies on `id`'s [`crate::Node::parent`] chain (i.e. `id` is in
|
||||
/// `ancestor`'s subtree). `id` itself does not count as its own ancestor.
|
||||
fn parent_chain_contains(&self, id: NodeId, ancestor: NodeId) -> bool {
|
||||
let mut cur = self.graph.node(id).and_then(|n| n.parent);
|
||||
|
|
@ -286,7 +286,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
.is_some_and(|units| units.iter().any(|(n, _)| n == name))
|
||||
}
|
||||
|
||||
/// Whether `root` and every node in its [`Node::parent`] subtree are
|
||||
/// Whether `root` and every node in its [`crate::Node::parent`] subtree are
|
||||
/// terminal — the condition for releasing `root`'s owned grants (and for
|
||||
/// giving back a borrow whose branch-root is `root`).
|
||||
fn subtree_terminal(&self, root: NodeId) -> bool {
|
||||
|
|
@ -298,7 +298,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
}
|
||||
|
||||
/// Report a running node's own logic result. On success the node is *not*
|
||||
/// terminal until its sub-nodes ([`Node::parent`] children) all finish — it
|
||||
/// terminal until its sub-nodes ([`crate::Node::parent`] children) all finish — it
|
||||
/// rests in [`State::Finishing`] until then, rolling up to [`State::Done`]
|
||||
/// (every child `Done`) or [`State::Failed`] (any child `Failed`/`Cancelled`).
|
||||
/// On failure it is `Failed` at once and its pending sub-nodes are cancelled
|
||||
|
|
@ -324,7 +324,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
self.release_ready();
|
||||
}
|
||||
|
||||
/// [`Scheduler::complete`], plus whatever the node declared into the builder
|
||||
/// `Scheduler::complete`, plus whatever the node declared into the builder
|
||||
/// it was handed while running.
|
||||
///
|
||||
/// `grown`'s nodes are inserted **under `id`** and *before* the completion,
|
||||
|
|
@ -440,7 +440,7 @@ impl<N, R: Clone + Eq + Hash> Scheduler<N, R> {
|
|||
/// After `start` became terminal, roll up every ancestor that was parked in
|
||||
/// `Finishing` awaiting its children: once all of an ancestor's children are
|
||||
/// terminal it transitions (Done / Failed), which may let *its* parent roll
|
||||
/// up too, and so on up the [`Node::parent`] chain.
|
||||
/// up too, and so on up the [`crate::Node::parent`] chain.
|
||||
fn roll_up_ancestors(&mut self, start: NodeId) {
|
||||
let mut cur = self.graph.node(start).and_then(|n| n.parent);
|
||||
while let Some(a) = cur {
|
||||
|
|
|
|||
Loading…
Reference in a new issue