Skip to content

Handle structured attrs, "export references graph" outside of DerivationBuilder#13769

Merged
Ericson2314 merged 4 commits intoNixOS:masterfrom
obsidiansystems:simplify-derivation-building-goal
Aug 20, 2025
Merged

Handle structured attrs, "export references graph" outside of DerivationBuilder#13769
Ericson2314 merged 4 commits intoNixOS:masterfrom
obsidiansystems:simplify-derivation-building-goal

Conversation

@Ericson2314
Copy link
Copy Markdown
Member

@Ericson2314 Ericson2314 commented Aug 16, 2025

Motivation

See each commit for details.

Especially see my regrets in the last commit. I am a bit sad that I wasn't able to make this go "all the way" in fully making the store requests/response happen before DerivationBuilder is invoked. I am quite open to other ideas/strategies on this.

This new approach I like much better, just need to fix bugs.

Context


Add 👍 to pull requests you find important.

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

@Ericson2314 Ericson2314 marked this pull request as ready for review August 16, 2025 05:17
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner August 16, 2025 05:17
@github-actions github-actions bot added the new-cli Relating to the "nix" command label Aug 16, 2025
@Ericson2314 Ericson2314 marked this pull request as draft August 16, 2025 15:47
@Ericson2314
Copy link
Copy Markdown
Member Author

Ericson2314 commented Aug 16, 2025

Ah, I do have a better idea for this.

@Ericson2314 Ericson2314 force-pushed the simplify-derivation-building-goal branch from da8e7b3 to 5ab4f8b Compare August 18, 2025 20:53
@Ericson2314 Ericson2314 changed the title Rework how "export references graph" is implemented Handle structured attrs, "export references graph" outside of DerivationBuilder Aug 18, 2025
@Ericson2314 Ericson2314 force-pushed the simplify-derivation-building-goal branch from 5ab4f8b to 94c8677 Compare August 18, 2025 22:10
@Ericson2314 Ericson2314 marked this pull request as ready for review August 18, 2025 22:11
@Ericson2314 Ericson2314 force-pushed the simplify-derivation-building-goal branch from 94c8677 to 3163ead Compare August 19, 2025 22:14
The first part on `drvOptions.exportReferencesGraph` is the same in both
cases. It is just how the information is finally rendered that is
different.
As much as I prefer rewriting the parsed rather than unparsed JSON for
elegance, this gets in the way of the separation of concerns that I am
trying to do.

As a practical matter, any rewriting that this did will also be done by
the second round of rewriting that remains below, so removing this code
should have no effect.
…nBuilder`

I think this is a better separation of concerns. `DerivationBuilder`
doesn't need to to the final, query-heavy details about how these things
are constructed. It just operates on the level of "simple, stupid" files
and environment variables.
…onBuilder`

Now, `DerivationBuilder` only concerns itself with `finalEnv` and
`extraFiles`, in straightforward unconditional code. All the fancy
desugaring logic is consolidated in `DerivationBuildingGoal`.

We should better share the pulled-out logic with `nix-shell`/`nix
develop`, which would fill in some missing features, arguably fixing
bugs.
Copy link
Copy Markdown
Contributor

@xokdvium xokdvium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ericson2314 Ericson2314 force-pushed the simplify-derivation-building-goal branch from 3163ead to 1d3ddb2 Compare August 20, 2025 21:31
@Ericson2314 Ericson2314 merged commit 08e42e2 into NixOS:master Aug 20, 2025
14 checks passed
@Ericson2314 Ericson2314 deleted the simplify-derivation-building-goal branch August 20, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-cli Relating to the "nix" command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants