tweag / nixpkgs-graph-explorer

Explore the nixpkgs dependency graph
MIT License
15 stars 0 forks source link

Recursively collect input derivations #80

Closed GuillaumeDesforges closed 1 year ago

GuillaumeDesforges commented 1 year ago

Why do we need this PR?

Before this PR, the attribute sets collected by collect were only attribute sets that were accessible as top-level derivations, so all derivations that were not accessible as top level packages were missed.

Indeed collect only returns in the output list objects that are recursively accessible in the input argument. However, given that, in the input argument of collect, we map input derivations (e.g. build inputs) to string in the recurse function, these were not collected.

How does this PR fix it?

This PR postpones mapping input derivations to a string (their output path) after collection, so that derivation inputs are part of the output.

GuillaumeDesforges commented 1 year ago

Note it still needs some work on the inputs (e.g. other inputs than buildInputs are missing)

GuillaumeDesforges commented 1 year ago

@zz1874 thanks for the review

This PR only tackles the issue of missing derivations, not the overall schema change, so it was made off main (https://github.com/tweag/nixpkgs-graph-explorer/blob/695d934922020e1f3ad02f5570eb603ff5fae249/core/extract_data/cli/nixpkgs-graph.nix)

Let's merge this and adapt the schema and ingestion from there.