Skip to content

Build already materializes the unscanned-compile list, then discards it — offer it under -v #364

Description

@typeless

Observed while pricing whether the per-rule list could move off parse (#359). Small, additive, and free.

The situation

src/cli/cmd_build.cpp calls check_unscanned_compiles, which materializes the complete Vec<Diagnostic> — every per-rule message formatted and interned — and then reads .size() to print one summary line:

[build-gcc] 5 rules produce an object file with no dependency scan; run 'putup parse' for the list.

The list the message points at already exists, in memory, one scope from the line that declines to print it.

Why it is not printed

Deliberate, and it should stay the default: per-rule warnings firing on every build train users to scroll past warnings. On the binutils BSP that would be five lines on every green build; the design puts the detail in parse for exactly that reason.

The proposal

Print the per-rule findings on the build when --verbose is set. --verbose is already parsed globally and already consulted throughout cmd_build, so this needs no new flag, no new surface, and no computation — the diagnostics are already built.

It is purely additive: parse keeps the check, so run 'putup parse' for the list stays true.

Measured cost of the list on the build path

Removing the check_unscanned_compiles call from the build entirely:

I refs
dry-run with the check 2,764,252,747
dry-run with the call removed 2,761,891,373
cost of the whole list 2,361,374 — 0.085%

Note that 0.085% is a property of this corpus: it is cheap because most rules already have a scan node and are skipped before the expensive path. On a corpus whose compiles carry -MD no scan nodes are created, and the check falls through to expand_instruction + reports_own_deps for every compile — still far cheaper than a full recompute, but not 0.085%.

Scope

Not urgent and deliberately not bundled into #359. Worth having if anyone wants the list without a second invocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions