Skip to content

Import from derivation: Better queries, better errors - #31

Closed
shlevy wants to merge 12 commits into
NixOS:masterfrom
shlevy:get-drvs-getters-everywhere
Closed

shlevy wants to merge 12 commits into
NixOS:masterfrom
shlevy:get-drvs-getters-everywhere

Conversation

@shlevy

@shlevy shlevy commented Jun 23, 2012

Copy link
Copy Markdown
Member

This is a new attempt at getting queries to work well with imports from derivations, taking the approach I suggested in the comments on the other PR. Note that currently the case where 'name' or 'system' require importing from an unrealized derivation (A silly case IMO) is not handled, though that can be easily added.

@shlevy

shlevy commented Jun 23, 2012

Copy link
Copy Markdown
Member Author

cc @edolstra

@shlevy

shlevy commented Jun 26, 2012

Copy link
Copy Markdown
Member Author

Oh, "the other PR" is #22 for those who haven't been following this work.

@shlevy

shlevy commented Jul 2, 2012

Copy link
Copy Markdown
Member Author

@edolstra ping

@shlevy

shlevy commented Jul 18, 2012

Copy link
Copy Markdown
Member Author

Any chance of this making it into 1.1?

@shlevy

shlevy commented Aug 26, 2012

Copy link
Copy Markdown
Member Author

@edolstra ping :)

@shlevy

shlevy commented Aug 29, 2012

Copy link
Copy Markdown
Member Author

@edolstra I've rebased onto latest master. I'll be doing more work on top of this branch, so future pull requests may assume this was merged.

@shlevy

shlevy commented Aug 29, 2012

Copy link
Copy Markdown
Member Author

Rebased, and I'll keep that up if more changes are pushed to master.

Comment thread src/libexpr/get-drvs.cc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the reason for queryName() and querySystem()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So getDerivation() doesn't need to evaluate any of the derivations attributes, and to allow graceful handling of the case where name or system depend on an import from derivation in the future

@shlevy

shlevy commented Jul 2, 2013

Copy link
Copy Markdown
Member Author

Giving up on this getting merged

@shlevy shlevy closed this Jul 2, 2013
@copumpkin

Copy link
Copy Markdown
Member

@edolstra can we reopen this?

@copumpkin

Copy link
Copy Markdown
Member

@shlevy thanks for doing this! Could you describe what this is doing to make it easier for someone to pick up and revive it? For example, how would I test that it's behaving as expected?

tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
We're not going to use it.

Fixes: NixOS#31
Change-Id: Ib17a2eb6cae1ecbbf9ad1062e576ba6107a3c13b
edolstra referenced this pull request in DeterminateSystems/nix-src Mar 5, 2025
ConnorBaker pushed a commit to ConnorBaker/nix that referenced this pull request Jul 25, 2025
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 29, 2026
Adds a verified comparison section answering: how does our approach
compare to DetSys lazy-trees, what are the perf characteristics of each,
and have we obviated the tecnix builtins?

Findings (all checked against ~/ext-sources/nix-src @ main and
~/ext-sources/tecnix @ tecnix-gcs, file:line cited):

- Lineage: ours is upstream NixOS/nix 2.35.0 with the storeFS/mountInput
  mount infra ported but NO lazy-trees setting and NO StorePath::random;
  DetSys is upstream + a lazy-trees flag (default false); tecnix is the
  DetSys fork with lazy-trees=true + 11 __unsafeTectonixInternal* builtins
  in a new tectonix.cc (absent from DetSys).
- The two choices we rejected: random store paths (user-hostile,
  non-deterministic) and string-coercion forcing a copy. Ours uses
  content-determined SourcePlaceholders that thread through coerceToString
  losslessly (eval.cc:2544-2546), so interpolation never devirtualizes.
- Smoking gun: tecnix PR NixOS#31 added ZonePath alongside ZoneSrc *purely*
  because DetSys path-coercion devirtualizes ("would tank eval perf in
  large zones"). Our design removes that duplication by construction.
- Obviation scorecard: ZoneSrc/ZonePath/Tree/TreeSha fully obviated;
  Manifest/ManifestInverted relocate to user-space Nix; the dirty-workdir
  family is half-obviated (our Overlay combinator covers the mechanism,
  monorepo policy stays out of scope); GCS transport + pname orthogonal.
- Perf head-to-head table + honest gaps: DetSys still wins zero-walk
  pure-eval of a flake input (our Item 2 mountInput forces synchronously,
  closed by §6.8 Item 5); filtered builtins.path re-walks structure every
  eval in all forks; our Git tree-synthesis win is still dormant.

Also refreshes the §5 "What we learned" DetSys/tecnix bullet to point at
§8 and the ZonePath data point.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.

3 participants