Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add build path prefix map property to digest #5451

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Unreleased

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

3.0.2 (Unreleased)
------------------

- Fix digest computation bug introduced in 3.0.1 (#5451, @rgrinberg)

3.0.1 (17/02/2022)
------------------

Expand Down
5 changes: 3 additions & 2 deletions src/dune_engine/build_system.ml
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ end = struct

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

let compute_rule_digest (rule : Rule.t) ~deps ~action ~sandbox_mode
~execution_parameters =
Expand Down Expand Up @@ -389,7 +389,8 @@ end = struct
, List.map locks ~f:Path.to_string
, Execution_parameters.action_stdout_on_success execution_parameters
, Execution_parameters.action_stderr_on_success execution_parameters
, Execution_parameters.expand_aliases_in_sandbox execution_parameters )
, Execution_parameters.add_workspace_root_to_build_path_prefix_map
execution_parameters )
in
Digest.generic trace

Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/dune-cache/mode-copy.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ never built [target1] before.
$ dune build --config-file=config target1 --debug-cache=shared,workspace-local \
> 2>&1 | grep '_build/default/source\|_build/default/target'
Workspace-local cache miss: _build/default/source: never seen this target before
Shared cache miss [ef66d7d3ff4264a591dc96ff4eac1f3a] (_build/default/source): not found in cache
Shared cache miss [207accecc1d6cb4939bd10606ed06974] (_build/default/source): not found in cache
Workspace-local cache miss: _build/default/target1: never seen this target before
Shared cache miss [b7a99c68d779884507df259e4aa83ad3] (_build/default/target1): not found in cache
Shared cache miss [f72c5ad51539d71b2e7be7fbf7bed942] (_build/default/target1): not found in cache

$ dune_cmd stat hardlinks _build/default/source
1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ never built [target1] before.
$ dune build --config-file=config target1 --debug-cache=shared,workspace-local \
> 2>&1 | grep '_build/default/source\|_build/default/target'
Workspace-local cache miss: _build/default/source: never seen this target before
Shared cache miss [ef66d7d3ff4264a591dc96ff4eac1f3a] (_build/default/source): not found in cache
Shared cache miss [207accecc1d6cb4939bd10606ed06974] (_build/default/source): not found in cache
Workspace-local cache miss: _build/default/target1: never seen this target before
Shared cache miss [b7a99c68d779884507df259e4aa83ad3] (_build/default/target1): not found in cache
Shared cache miss [f72c5ad51539d71b2e7be7fbf7bed942] (_build/default/target1): not found in cache

$ dune_cmd stat hardlinks _build/default/source
3
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/dune-cache/repro-check.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Set 'cache-check-probability' to 1.0, which should trigger the check
> EOF
$ rm -rf _build
$ dune build --config-file config reproducible non-reproducible
Warning: cache store error [2522fd3dc29664b37f7c36af43b54479]: ((in_cache
Warning: cache store error [50ef03520a30e8325c18fdf2c0bdd1ea]: ((in_cache
((non-reproducible 1c8fc4744d4cef1bd2b8f5e915b36be9))) (computed
((non-reproducible 6cfaa7a90747882bcf4ffe7252c1cf89)))) after executing
(echo 'build non-reproducible';cp dep non-reproducible)
Expand Down Expand Up @@ -119,7 +119,7 @@ Test that the environment variable and the command line flag work too

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

$ rm -rf _build
$ dune build --cache=enabled --cache-check-probability=1.0 reproducible non-reproducible
Warning: cache store error [2522fd3dc29664b37f7c36af43b54479]: ((in_cache
Warning: cache store error [50ef03520a30e8325c18fdf2c0bdd1ea]: ((in_cache
((non-reproducible 1c8fc4744d4cef1bd2b8f5e915b36be9))) (computed
((non-reproducible 6cfaa7a90747882bcf4ffe7252c1cf89)))) after executing
(echo 'build non-reproducible';cp dep non-reproducible)
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/dune-cache/trim.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ You will also need to make sure that the cache trimmer treats new and old cache
entries uniformly.

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

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

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