Skip to content

feat(libstore): add scanForReferencesDeep and use it for why-depends#14360

Merged
Ericson2314 merged 2 commits into
NixOS:masterfrom
lovesegfault:scan-for-references-detailed
Oct 27, 2025
Merged

feat(libstore): add scanForReferencesDeep and use it for why-depends#14360
Ericson2314 merged 2 commits into
NixOS:masterfrom
lovesegfault:scan-for-references-detailed

Conversation

@lovesegfault
Copy link
Copy Markdown
Member

Motivation

  • feat(libstore): add scanForReferencesDeep for per-file reference tracking
    Introduces scanForReferencesDeep to provide per-file granularity when scanning for store path references, enabling better diagnostics for cycle detection and nix why-depends --precise.

  • refactor(nix/why-depends): use scanForReferencesDeep for --precise mode
    Replaces manual tree-walking and reference scanning with the new scanForReferencesDeep function

Context

This is an attempt to carve out part of the work in #14218


Add 👍 to pull requests you find important.

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

@github-actions github-actions Bot added the new-cli Relating to the "nix" command label Oct 25, 2025
Comment thread src/libstore/path-references.cc Outdated
@lovesegfault lovesegfault force-pushed the scan-for-references-detailed branch 2 times, most recently from f33a7ba to 42b0fd5 Compare October 26, 2025 00:22
Comment thread src/libstore/path-references.cc Outdated
Comment thread src/nix/why-depends.cc
Comment on lines -194 to +195
StringSet hashes;
StorePathSet refPaths;
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.

This is nice to see :)

@lovesegfault lovesegfault force-pushed the scan-for-references-detailed branch from 42b0fd5 to a362c14 Compare October 27, 2025 14:48
@lovesegfault lovesegfault marked this pull request as ready for review October 27, 2025 14:57
Comment thread src/libstore-tests/references.cc Outdated
Comment thread src/libstore-tests/references.cc Outdated
Comment thread src/libstore-tests/references.cc Outdated
@lovesegfault lovesegfault force-pushed the scan-for-references-detailed branch from a362c14 to 7201e5b Compare October 27, 2025 15:29
Comment thread src/libstore-tests/references.cc Outdated
Comment thread src/libstore/include/nix/store/path-references.hh
@lovesegfault lovesegfault force-pushed the scan-for-references-detailed branch from 7201e5b to 9fb2d4c Compare October 27, 2025 19:11
…king

Introduces `scanForReferencesDeep` to provide per-file granularity when
scanning for store path references, enabling better diagnostics for
cycle detection and `nix why-depends --precise`.
Replaces manual tree-walking and reference scanning with the new
scanForReferencesDeep function.
@lovesegfault lovesegfault force-pushed the scan-for-references-detailed branch from 9fb2d4c to 6129aee Compare October 27, 2025 19:14
@Ericson2314 Ericson2314 added this pull request to the merge queue Oct 27, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Oct 27, 2025
feat(libstore): add scanForReferencesDeep and use it for why-depends
Merged via the queue into NixOS:master with commit aa4106f Oct 27, 2025
16 checks passed
@lovesegfault lovesegfault deleted the scan-for-references-detailed branch October 27, 2025 23:59
Ericson2314 added a commit to obsidiansystems/nix that referenced this pull request Oct 28, 2025
…detailed

feat(libstore): add scanForReferencesDeep and use it for why-depends
@edolstra edolstra mentioned this pull request Dec 9, 2025
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