Skip to content

Commit 32ef2d5

Browse files
committed
fix: add build path prefix map property to digest
Signed-off-by: Rudi Grinberg <me@rgrinberg.com> ps-id: CDA112A2-8112-4EFE-8043-E17DD9479DA9
1 parent 3a2efb7 commit 32ef2d5

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Unreleased
66

77
- Add direct dependencies to $ dune describe output (#5412, @esope)
88

9+
3.0.2 (Unreleased)
10+
------------------
11+
12+
- Fix digest computation bug introduced in 3.0.1 (#5451, @rgrinberg)
13+
914
3.0.1 (17/02/2022)
1015
------------------
1116

src/dune_engine/build_system.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ end = struct
360360

361361
(* The current version of the rule digest scheme. We should increment it when
362362
making any changes to the scheme, to avoid collisions. *)
363-
let rule_digest_version = 11
363+
let rule_digest_version = 12
364364

365365
let compute_rule_digest (rule : Rule.t) ~deps ~action ~sandbox_mode
366366
~execution_parameters =
@@ -389,7 +389,8 @@ end = struct
389389
, List.map locks ~f:Path.to_string
390390
, Execution_parameters.action_stdout_on_success execution_parameters
391391
, Execution_parameters.action_stderr_on_success execution_parameters
392-
, Execution_parameters.expand_aliases_in_sandbox execution_parameters )
392+
, Execution_parameters.add_workspace_root_to_build_path_prefix_map
393+
execution_parameters )
393394
in
394395
Digest.generic trace
395396

test/blackbox-tests/test-cases/dune-cache/mode-copy.t/run.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ never built [target1] before.
3636
$ dune build --config-file=config target1 --debug-cache=shared,workspace-local \
3737
> 2>&1 | grep '_build/default/source\|_build/default/target'
3838
Workspace-local cache miss: _build/default/source: never seen this target before
39-
Shared cache miss [ef66d7d3ff4264a591dc96ff4eac1f3a] (_build/default/source): not found in cache
39+
Shared cache miss [207accecc1d6cb4939bd10606ed06974] (_build/default/source): not found in cache
4040
Workspace-local cache miss: _build/default/target1: never seen this target before
41-
Shared cache miss [b7a99c68d779884507df259e4aa83ad3] (_build/default/target1): not found in cache
41+
Shared cache miss [f72c5ad51539d71b2e7be7fbf7bed942] (_build/default/target1): not found in cache
4242

4343
$ dune_cmd stat hardlinks _build/default/source
4444
1

test/blackbox-tests/test-cases/dune-cache/mode-hardlink.t/run.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ never built [target1] before.
3535
$ dune build --config-file=config target1 --debug-cache=shared,workspace-local \
3636
> 2>&1 | grep '_build/default/source\|_build/default/target'
3737
Workspace-local cache miss: _build/default/source: never seen this target before
38-
Shared cache miss [ef66d7d3ff4264a591dc96ff4eac1f3a] (_build/default/source): not found in cache
38+
Shared cache miss [207accecc1d6cb4939bd10606ed06974] (_build/default/source): not found in cache
3939
Workspace-local cache miss: _build/default/target1: never seen this target before
40-
Shared cache miss [b7a99c68d779884507df259e4aa83ad3] (_build/default/target1): not found in cache
40+
Shared cache miss [f72c5ad51539d71b2e7be7fbf7bed942] (_build/default/target1): not found in cache
4141

4242
$ dune_cmd stat hardlinks _build/default/source
4343
3

test/blackbox-tests/test-cases/dune-cache/repro-check.t/run.t

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Set 'cache-check-probability' to 1.0, which should trigger the check
6767
> EOF
6868
$ rm -rf _build
6969
$ dune build --config-file config reproducible non-reproducible
70-
Warning: cache store error [2522fd3dc29664b37f7c36af43b54479]: ((in_cache
70+
Warning: cache store error [50ef03520a30e8325c18fdf2c0bdd1ea]: ((in_cache
7171
((non-reproducible 1c8fc4744d4cef1bd2b8f5e915b36be9))) (computed
7272
((non-reproducible 6cfaa7a90747882bcf4ffe7252c1cf89)))) after executing
7373
(echo 'build non-reproducible';cp dep non-reproducible)
@@ -119,7 +119,7 @@ Test that the environment variable and the command line flag work too
119119

120120
$ rm -rf _build
121121
$ DUNE_CACHE_CHECK_PROBABILITY=1.0 dune build --cache=enabled reproducible non-reproducible
122-
Warning: cache store error [2522fd3dc29664b37f7c36af43b54479]: ((in_cache
122+
Warning: cache store error [50ef03520a30e8325c18fdf2c0bdd1ea]: ((in_cache
123123
((non-reproducible 1c8fc4744d4cef1bd2b8f5e915b36be9))) (computed
124124
((non-reproducible 6cfaa7a90747882bcf4ffe7252c1cf89)))) after executing
125125
(echo 'build non-reproducible';cp dep non-reproducible)
@@ -131,7 +131,7 @@ Test that the environment variable and the command line flag work too
131131

132132
$ rm -rf _build
133133
$ dune build --cache=enabled --cache-check-probability=1.0 reproducible non-reproducible
134-
Warning: cache store error [2522fd3dc29664b37f7c36af43b54479]: ((in_cache
134+
Warning: cache store error [50ef03520a30e8325c18fdf2c0bdd1ea]: ((in_cache
135135
((non-reproducible 1c8fc4744d4cef1bd2b8f5e915b36be9))) (computed
136136
((non-reproducible 6cfaa7a90747882bcf4ffe7252c1cf89)))) after executing
137137
(echo 'build non-reproducible';cp dep non-reproducible)

test/blackbox-tests/test-cases/dune-cache/trim.t/run.t

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ You will also need to make sure that the cache trimmer treats new and old cache
7777
entries uniformly.
7878

7979
$ (cd "$PWD/.xdg-cache/dune/db/meta/v5"; grep -rws . -e 'metadata' | sort)
80-
./7f/7fa490191ab9b44e14146673ef811ece:((8:metadata)(5:files(8:target_b32:8a53bfae3829b48866079fa7f2d97781)))
81-
./90/90ed6e6f2741da06a6643d77ad1126a2:((8:metadata)(5:files(8:target_a32:5637dd9730e430c7477f52d46de3909c)))
80+
./79/794d5128a9d2983d22ac1af3a408c1bb:((8:metadata)(5:files(8:target_a32:5637dd9730e430c7477f52d46de3909c)))
81+
./b5/b5ed9d55c072f2e7f31973a528aa16ff:((8:metadata)(5:files(8:target_b32:8a53bfae3829b48866079fa7f2d97781)))
8282

83-
$ dune_cmd stat size "$PWD/.xdg-cache/dune/db/meta/v5/90/90ed6e6f2741da06a6643d77ad1126a2"
83+
$ dune_cmd stat size "$PWD/.xdg-cache/dune/db/meta/v5/b5/b5ed9d55c072f2e7f31973a528aa16ff"
8484
70
8585

8686
Trimming the cache at this point should not remove any file entries because all

0 commit comments

Comments
 (0)