Skip to content

Commit

Permalink
fix(engine): include expand aliases in digest
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: ac86e5a8-fd65-4280-85fc-3531704c90f9 -->
  • Loading branch information
rgrinberg committed Oct 26, 2023
1 parent 3689853 commit e0d3408
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions doc/changes/8990.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Re-run actions whenever `(expand_aliases_in_sandbox)` changes (#8990,
@rgrinberg)
4 changes: 2 additions & 2 deletions src/dune_engine/build_system.ml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,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 = 17
let rule_digest_version = 18

let compute_rule_digest
(rule : Rule.t)
Expand Down Expand Up @@ -270,7 +270,7 @@ end = struct
, Execution_parameters.action_stdout_on_success execution_parameters
, Execution_parameters.action_stderr_on_success execution_parameters
, Execution_parameters.workspace_root_to_build_path_prefix_map execution_parameters
)
, Execution_parameters.expand_aliases_in_sandbox execution_parameters )
in
Digest.generic trace
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ Now we set (expand_aliases_in_sandbox), and re-run the action.
> (expand_aliases_in_sandbox)
> EOF
$ dune build @foo
.
./alias-dep

The above output should include the files that we depend on via the alias
expansion.
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/dune-cache/mode-copy.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,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 [d008bb41344a7d0d53972220079cbb8c] (_build/default/source): not found in cache
Shared cache miss [43284c58c2079faf9e5421c4d82a28c2] (_build/default/source): not found in cache
Workspace-local cache miss: _build/default/target1: never seen this target before
Shared cache miss [b13d2ba64fcb9361d4fe1b3b094f2f82] (_build/default/target1): not found in cache
Shared cache miss [d92cafbd0f0c19a3a6c99407b959dc72] (_build/default/target1): not found in cache

$ dune_cmd stat hardlinks _build/default/source
1
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/dune-cache/mode-hardlink.t
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 [26bdf30e58f853b22578ed89686d983f] (_build/default/source): not found in cache
Shared cache miss [afae5cd4afe24e40e88a52ffd372da14] (_build/default/source): not found in cache
Workspace-local cache miss: _build/default/target1: never seen this target before
Shared cache miss [b12a77bbe2d67c323ef28eaaebdcfb34] (_build/default/target1): not found in cache
Shared cache miss [8dd10495c1458bf12c3c55807797879c] (_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
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 [ea838ee96c7527baca974c6516345e68]: ((in_cache
Warning: cache store error [f533fad74b151f0d6cbf8c3f5a91fa30]: ((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 [ea838ee96c7527baca974c6516345e68]: ((in_cache
Warning: cache store error [f533fad74b151f0d6cbf8c3f5a91fa30]: ((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 [ea838ee96c7527baca974c6516345e68]: ((in_cache
Warning: cache store error [f533fad74b151f0d6cbf8c3f5a91fa30]: ((in_cache
((non-reproducible 1c8fc4744d4cef1bd2b8f5e915b36be9))) (computed
((non-reproducible 6cfaa7a90747882bcf4ffe7252c1cf89)))) after executing
(echo 'build non-reproducible';cp dep non-reproducible)
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/dune-cache/trim.t
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ entries uniformly.

$ (cd "$PWD/.xdg-cache/dune/db/meta/v5"; grep -rws . -e 'metadata' | sort ) > out
$ cat out
./c7/c7dd3e91adf65ae3cd721eef06904b93:((8:metadata)(5:files(8:target_b32:8a53bfae3829b48866079fa7f2d97781)))
./d7/d74e8e6eb3d6cf509b6d3b7cbfeee223:((8:metadata)(5:files(8:target_a32:5637dd9730e430c7477f52d46de3909c)))
./8c/8c4aba72abad331531e3af2fb9f9cfaa:((8:metadata)(5:files(8:target_b32:8a53bfae3829b48866079fa7f2d97781)))
./df/df307ded076980fa7dc2f5dbd563dbc1:((8:metadata)(5:files(8:target_a32:5637dd9730e430c7477f52d46de3909c)))

$ digest="$(awk -F: '/target_b/ { digest=$1 } END { print digest }' < out)"

Expand Down

0 comments on commit e0d3408

Please sign in to comment.