mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 13:06:01 +01:00
Merge pull request #131 from DeterminateSystems/path-fingerprint
Fix eval caching for path flakes
This commit is contained in:
commit
842b8846c5
3 changed files with 4 additions and 2 deletions
|
|
@ -354,6 +354,8 @@ std::pair<ref<SourceAccessor>, Input> Input::getAccessorUnchecked(ref<Store> sto
|
||||||
|
|
||||||
if (!accessor->fingerprint)
|
if (!accessor->fingerprint)
|
||||||
accessor->fingerprint = result.getFingerprint(store);
|
accessor->fingerprint = result.getFingerprint(store);
|
||||||
|
else
|
||||||
|
result.cachedFingerprint = accessor->fingerprint;
|
||||||
|
|
||||||
return {accessor, std::move(result)};
|
return {accessor, std::move(result)};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,6 @@ struct PathInputScheme : InputScheme
|
||||||
|
|
||||||
auto absPath = getAbsPath(input);
|
auto absPath = getAbsPath(input);
|
||||||
|
|
||||||
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying %s to the store", absPath));
|
|
||||||
|
|
||||||
// FIXME: check whether access to 'path' is allowed.
|
// FIXME: check whether access to 'path' is allowed.
|
||||||
auto storePath = store->maybeParseStorePath(absPath.string());
|
auto storePath = store->maybeParseStorePath(absPath.string());
|
||||||
|
|
||||||
|
|
@ -137,6 +135,7 @@ struct PathInputScheme : InputScheme
|
||||||
|
|
||||||
time_t mtime = 0;
|
time_t mtime = 0;
|
||||||
if (!storePath || storePath->name() != "source" || !store->isValidPath(*storePath)) {
|
if (!storePath || storePath->name() != "source" || !store->isValidPath(*storePath)) {
|
||||||
|
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying %s to the store", absPath));
|
||||||
// FIXME: try to substitute storePath.
|
// FIXME: try to substitute storePath.
|
||||||
auto src = sinkToSource([&](Sink & sink) {
|
auto src = sinkToSource([&](Sink & sink) {
|
||||||
mtime = dumpPathAndGetMtime(absPath.string(), sink, defaultPathFilter);
|
mtime = dumpPathAndGetMtime(absPath.string(), sink, defaultPathFilter);
|
||||||
|
|
|
||||||
|
|
@ -374,6 +374,7 @@ nix build -o $TEST_ROOT/result git+file://$flakeGitBare
|
||||||
mkdir -p $flake5Dir
|
mkdir -p $flake5Dir
|
||||||
writeDependentFlake $flake5Dir
|
writeDependentFlake $flake5Dir
|
||||||
nix flake lock path://$flake5Dir
|
nix flake lock path://$flake5Dir
|
||||||
|
[[ "$(nix flake metadata path://$flake5Dir --json | jq -r .fingerprint)" != null ]]
|
||||||
|
|
||||||
# Test tarball flakes.
|
# Test tarball flakes.
|
||||||
tar cfz $TEST_ROOT/flake.tar.gz -C $TEST_ROOT flake5
|
tar cfz $TEST_ROOT/flake.tar.gz -C $TEST_ROOT flake5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue