Skip to content

[Bug]: a virtual-workspace-root Cargo.toml is re-reported as "produced zero nodes" and re-extracted on every run #3910

Closed

Description

@vitichenko

Symptom

In a virtual Cargo workspace — root Cargo.toml declares [workspace] members and no [package] — every graphify update . prints this pair, verbatim, forever:

  AST extraction: 1/1 uncached files (100%)
  warning: 1 source file(s) produced zero nodes and are absent from the graph: Cargo.toml. A re-run will retry them (empties are no longer cached); if it persists, please report the file(s) (#1666).

A second run prints the same two lines. In a fresh corpus the file is not recorded in manifest.json at all, while the crate manifests are:

$ python3 -c "import json;m=json.load(open('graphify-out/manifest.json'));[print(repr(k),repr(v['ast_hash'])) for k,v in m.items()]"
'crates/a/Cargo.toml' 'e5669eadddf158022994cfc50f79ec52'
'crates/a/src/lib.rs' 'ba96bc9d26fd26c2697e47c67e3d3c65'

In a corpus that has been through older versions the entry survives as the one and only un-hashed entry — measured on a 12-crate workspace:

$ python3 -c "import json;m=json.load(open('graphify-out/manifest.json'));print([k for k,v in m.items() if not v.get('ast_hash')])"
['Cargo.toml']

The empty result is intentional

manifest_ingest.py::_parse_cargo emits nothing for a virtual workspace root, on purpose:

A virtual workspace root ([workspace], no [package]) declares no package of its own — emit nothing rather than a fabricated node.

So the ingest is right and the reporting is what collides:

  1. A file that is empty-by-design is indistinguishable from a file whose extraction silently failed, so the Ruby: stable subset of files yields zero nodes in full-repo runs (0.9.6) — each extracts fine in isolation #1666 bucket can never be empty. That bucket is the only place a genuinely dropped file would surface — a permanent, unsolvable entry in it teaches the reader to skip the line, which is the opposite of what it is for.
  2. "empties are no longer cached" (post-Incremental manifest never retries files whose extractor failed on a missing extra #2543/#2879 symptom returns in 0.9.64 via the #2543 heal: data JSON re-queued every run despite a populated ast_hash #3679) turns that into permanent work: the file is re-detected and re-extracted on every single run and never reaches a cached state, so AST extraction: N/N uncached files (100%) is the steady state in any workspace of this shape.

Minimal repro (0.9.67, Python 3.14, Linux)

$ mkdir -p m/crates/a/src && cd m
$ printf '[workspace]\nmembers = ["crates/a"]\nresolver = "2"\n'        > Cargo.toml
$ printf '[package]\nname = "a"\nversion = "0.1.0"\nedition = "2021"\n' > crates/a/Cargo.toml
$ printf 'pub fn f() -> u32 { 1 }\n'                                    > crates/a/src/lib.rs
$ graphify update .
  AST extraction: 1/1 uncached files (100%)
  warning: 1 source file(s) produced zero nodes and are absent from the graph: Cargo.toml. ...
[graphify watch] Rebuilt: 3 nodes, 1 edges, 2 communities

$ graphify update .   # and again, and again
  AST extraction: 1/1 uncached files (100%)
  warning: 1 source file(s) produced zero nodes and are absent from the graph: Cargo.toml. ...

Measured on a real repo

tessella (Rust, 12-crate workspace, 0.9.67): 3771 nodes / 9096 links (links, not edges).

  • No node in graph.json has source_file == "Cargo.toml". The 12 crates/*/Cargo.toml files each contribute exactly 1 package node, and all 28 depends_on links come from them. Net value of the root manifest in the graph: 0 nodes, 0 links.
  • The single un-hashed manifest.json entry in the whole corpus is that file (see above), in this workspace and in a second workspace of the same shape (musivum).

Workaround we are shipping

A .graphifyignore entry /Cargo.toml, which removes the permanent warning and the permanent re-extraction at a measured cost of 0 nodes / 0 links (verified by diffing graph.json before/after — the only change is that the warning disappears). We would rather delete that line when this is fixed.

Ask

  • Suppress the zero-node warning for paths that is_package_manifest_path() recognises and that the ingest deliberately leaves empty — manifest_ingest knows the difference; the warning path does not.
  • Or split the bucket into "no extractable content (by design)" vs "extraction produced nothing (suspect)" and cache the former so it is not re-extracted every run.
  • Either way, AST extraction: N/N uncached files (100%) should not be the permanent steady state for a repo that is fully extracted.

Activity

  1. github-actions commented on Sep 28, 2026

    @github-actions

    Thanks for opening this issue, @vitichenko. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions