Skip to content

Conversation

@lovesegfault
Copy link
Member

Motivation

Build the output reference graph and inverse output map before running
topoSort, avoiding quadratic complexity when determining which outputs
reference each other. This fixes the FIXME comment about building the
inverted map up front.

The outputGraph (StorePath → StorePathSet) maps each output to its
references, and will be reused in future commits to generate detailed
cycle error messages showing which files contain problematic references.

Adapted from Lix commit 10c04ce84.

Change-Id: Ibdd46e7b2e895bfeeebc173046d1297b41998181
Co-Authored-By: Maximilian Bosch [email protected]

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

… complexity

Build the output reference graph and inverse output map before running
topoSort, avoiding quadratic complexity when determining which outputs
reference each other. This fixes the FIXME comment about building the
inverted map up front.

The outputGraph (StorePath → StorePathSet) maps each output to its
references, and will be reused in future commits to generate detailed
cycle error messages showing which files contain problematic references.

Adapted from Lix commit 10c04ce84.

Change-Id: Ibdd46e7b2e895bfeeebc173046d1297b41998181
Co-Authored-By: Maximilian Bosch <[email protected]>
@lovesegfault lovesegfault force-pushed the pre-compute-outputgraph branch from ebc1008 to 7b7e555 Compare November 10, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant