-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues exposed in previous commit
Signed-off-by: Jeremie Dimino <[email protected]>
- Loading branch information
1 parent
cb51656
commit d718b27
Showing
3 changed files
with
31 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
32 changes: 8 additions & 24 deletions
32
test/blackbox-tests/test-cases/digest-cache/stats-used-in-db.t
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,16 @@ | ||
This test expose the following problem: inside the digest cache, we | ||
store parts of the file stats to detect when it changes and should be | ||
re-hashed. However, for targets we use the stats before removing the | ||
write permissions, which means that during the second run, dune always | ||
re-hash all the targets. | ||
Reproduction case for a bug we discovered in the past; Dune was | ||
storing the wrong stats for generated files in the digest cache and as | ||
a result was always re-hashing all files in the build directory on the | ||
second run. | ||
|
||
More precisely, we were using the stats of the file before making it | ||
read-only. | ||
|
||
|
||
$ echo '(lang dune 3.0)' > dune-project | ||
$ touch x y z | ||
$ dune build x y z --wait-for-filesystem-clock | ||
|
||
The following shouldn't rehash anything: | ||
Check that the next build rehashes nothing: | ||
|
||
$ dune build x y z --wait-for-filesystem-clock --debug-digests 2>&1 | sed 's/stats = { .*\( perm = [0-9]*\).*}/stats = {\1; ... }/' | ||
Re-digested file _build/default/x because its stats changed: | ||
{ old_digest = digest "b83631c134a9649ec383d0eb9c356803" | ||
; new_digest = digest "b83631c134a9649ec383d0eb9c356803" | ||
; old_stats = { perm = 436; ... } | ||
; new_stats = { perm = 292; ... } | ||
} | ||
Re-digested file _build/default/y because its stats changed: | ||
{ old_digest = digest "b83631c134a9649ec383d0eb9c356803" | ||
; new_digest = digest "b83631c134a9649ec383d0eb9c356803" | ||
; old_stats = { perm = 436; ... } | ||
; new_stats = { perm = 292; ... } | ||
} | ||
Re-digested file _build/default/z because its stats changed: | ||
{ old_digest = digest "b83631c134a9649ec383d0eb9c356803" | ||
; new_digest = digest "b83631c134a9649ec383d0eb9c356803" | ||
; old_stats = { perm = 436; ... } | ||
; new_stats = { perm = 292; ... } | ||
} |