Skip to content

Proposal: better tooling to inspect import/analysis graphs #25427

@mitchellh

Description

@mitchellh

We've been working on improving build times in the Ghostty project for both the build binary as well as final artifacts. At the scale of the Ghostty project with hundreds of Zig files importing across each other, it's very difficult to determine where imports are triggering downstream recompilations.

This applies to both build binaries and runtime artifacts.

A real example from our [work-in-progress] migration to Zig 0.15: something changed in Zig 0.15 so that imports became a bit more eager, causing an "import outside of build root" error that didn't happen on Zig 0.14 (because the import is never reached). This was the fix: ghostty-org/ghostty@d7cfc51

To determine that, I manually grepped for imports and traced them myself and made the guess that this was happening. Thankfully I was right. This has been a repeat occurrence.

This also applies to decls as well. It'd be nice to get the -freference-trace output for all instances of all decls and be able to do general graph traversal and search on that. But the primary culprit for me is imports.

I think with incremental compilation this sort of debug tooling will be even more important, since minimizing this will likely be the key to faster and faster compilation.

I'm sorry, this issue lacks a formal proposal and is instead more of a problem statement. If this should go elsewhere to discuss further I'm happy to move it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    use caseDescribes a real use case that is difficult or impossible, but does not propose a solution.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions