Skip to content

diff action directive isn't working as expected with a non-existant file #13638

@shym

Description

@shym

Expected Behavior

The documentation of the diff action directive states that (promotion.rst):

  • If <file1> doesn't exist, it will compare with the empty file.

A message about a missing file could make sense (but it would be less convenient).

Actual Behavior

I actually get the following error message:

Error: Unable to resolve symlink _build/default/file1

When trying to reproduce it inside a cram test in Dune’s source, I get a different error message, though.

Reproduction

cat > dune-project << EOF
(lang dune 3.0)
EOF

cat > dune << EOF
(rule
 (alias runtest)
 (action
  (diff a b)))

(rule
 (write-file b b))
EOF

I get:

$ dune runtest
File "dune", lines 1-4, characters 0-46:
1 | (rule
2 |  (alias runtest)
3 |  (action
4 |   (diff a b)))
Error: Unable to resolve symlink _build/default/a
[1]

Specifications

$ dune --version
3.21.0-748-g98b7042

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions