Draft
Conversation
…paths Previously, fetchToStore2 skipped the fingerprint cache entirely when a PathFilter was present, and had no caching for on-disk store paths that lacked an accessor-level fingerprint. Two changes: 1. Always call getFingerprint() regardless of filter. When a filter is present, prefix the cache key with "filtered:" to separate filtered and unfiltered results. This allows filtered paths with stable fingerprints (e.g., git-backed zones) to cache across evaluations. 2. For paths without an accessor fingerprint, check if the physical path is an immutable store path. If so, use "storePath:<physPath>" as a stable fingerprint for the SQLite cache. This avoids re-hashing on-disk nixpkgs store subpaths on every evaluation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a virtual getGitTreeHash() method to SourceAccessor that returns the git tree/blob SHA1 for a path, if available. Implement it in: - GitSourceAccessor: returns the OID from the git tree entry - GitExportIgnoreSourceAccessor: returns a synthetic hash incorporating "exportIgnore:" prefix to distinguish from raw trees - FilteringSourceAccessor: returns nullopt (arbitrary filters invalidate the tree hash) - MountedSourceAccessor: propagates through mounts - UnionSourceAccessor: returns first non-null result Use this in fetchToStore2 as a third cache tier: when the fingerprint cache misses (e.g., first run after cache clear), look up the git tree hash in the treeHashToNarHash SQLite cache. This maps git SHA1 tree OIDs to NAR SHA256 hashes, avoiding expensive NAR serialization when the mapping is already known from a previous evaluation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DirtyOverlaySourceAccessor (used for tectonix zones with uncommitted changes) had no getFingerprint() override, so it always returned nullopt. Combined with StorePath::random() generating a different virtual path each evaluation, the fetchToStore cache could never identify the same dirty zone across runs, causing expensive NAR serialization every time. Add a getFingerprint() that combines the base git accessor's fingerprint with the actual content of dirty files. Since dirty files are few and small, reading them is much cheaper than NAR-serializing the entire zone. The fingerprint changes when any dirty file is modified, ensuring cache correctness. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 3edf54f.
Three changes to the dirty overlay accessor: 1. readFile/readLink now route clean files through the git ODB (base accessor) instead of always reading from disk. Only dirty files are read from disk. This is important because we can't always trust on-disk content for clean files (e.g. sparse checkouts). 2. Removed getPhysicalPath override — clean files should not expose disk paths since they're served from the git ODB. 3. Fingerprint computation now uses a HashSink and caches the result. The fingerprint is the base accessor's fingerprint (git tree SHA) plus a hash of dirty file paths and content, avoiding redundant re-computation across multiple fetchToStore calls in the same eval. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This wires in tracking into our source accessor and allows us to see exactly what files affect a given target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.