Skip to content
Draft
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
44 changes: 44 additions & 0 deletions test/blackbox-tests/test-cases/sandbox/copy-dir-deps.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
A copy action on a directory dependency should produce regular files in every
sandbox mode. This case has no overlapping dependencies.

$ make_dune_project 3.25
$ cat > dune <<'EOF'
> (rule
> (target (dir tree))
> (action (system "mkdir tree && echo contents > tree/file")))
> (rule
> (target (dir copied))
> (deps tree (sandbox always))
> (action (no-infer (copy tree copied))))
> EOF

First check that the directory dependency contains a regular file.

$ dune build tree/file
$ dune_cmd stat kind _build/default/tree/file
regular file

Symlink mode: the copy action follows the directory link and copies its files.

$ dune build copied --sandbox symlink
$ cat _build/default/copied/file
contents
$ dune_cmd stat kind _build/default/copied/file
regular file

Copy mode also produces a regular file with the expected contents.

$ dune build copied --sandbox copy
$ cat _build/default/copied/file
contents
$ dune_cmd stat kind _build/default/copied/file
regular file

Hardlink mode currently fails while populating the directory dependency,
before the copy action runs.

$ dune build copied --sandbox hardlink 2>&1 | censor
Error:
link(_build/.sandbox/$DIGEST/default/tree): Operation not permitted
-> required by _build/default/copied
[1]
Loading