diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-01-06 15:37:31 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-01-06 15:45:34 -0500 |
commit | 81727f85cb567c4d5282c330d63a74ed84d12783 (patch) | |
tree | 5808cba3e02ff55657355562007ddd3a20892dfb /src/libexpr | |
parent | 7e1cfa97c6b410ed25ae0d3c3f10274aae9f6758 (diff) | |
parent | 46e942ff9e65755689ee72f93846d7118e1b8d45 (diff) |
Merge branch 'path-info' into ca-drv-exotic
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 0398a5b66..1d11b29de 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1532,7 +1532,8 @@ static void prim_readFile(EvalState & state, const PosIdx pos, Value * * args, V StorePathSet refs; if (state.store->isInStore(path)) { try { - refs = state.store->queryPathInfo(state.store->toStorePath(path).first)->references; + // FIXME: Are self references becoming non-self references OK? + refs = state.store->queryPathInfo(state.store->toStorePath(path).first)->referencesPossiblyToSelf(); } catch (Error &) { // FIXME: should be InvalidPathError } // Re-scan references to filter down to just the ones that actually occur in the file. @@ -1968,7 +1969,7 @@ static void addPath( try { auto [storePath, subPath] = state.store->toStorePath(path); // FIXME: we should scanForReferences on the path before adding it - refs = state.store->queryPathInfo(storePath)->references; + refs = state.store->queryPathInfo(storePath)->referencesPossiblyToSelf(); path = state.store->toRealPath(storePath) + subPath; } catch (Error &) { // FIXME: should be InvalidPathError } @@ -2007,7 +2008,7 @@ static void addPath( .method = method, .hash = *expectedHash, }, - {}, + .references = {}, }); if (!expectedHash || !state.store->isValidPath(*expectedStorePath)) { |