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

error message on failing copy action is unclear #11506

Open
Khady opened this issue Feb 27, 2025 · 0 comments
Open

error message on failing copy action is unclear #11506

Khady opened this issue Feb 27, 2025 · 0 comments
Labels
cli Command line related open-to-contribution External contributors are welcomed to do a PR to solve the issue

Comments

@Khady
Copy link
Contributor

Khady commented Feb 27, 2025

To be fair this issue is visible because the rule wasn't written properly. There was no need for a with-stdout-to. But I suppose it can happen in other condition and the lack of details in the error message is really confusing.

Expected Behavior

dune should report exactly which action/command is creating an error.

~/Code/github/dune-demo/dune-empty-stdout-error$ cat dune
(rule (target f.json) (action (with-stdout-to %{target} (copy sub/file.json f.json))))
~/Code/github/dune-demo/dune-empty-stdout-error$ dune build
Error: open(_build/default/f.json): Permission denied
(rule (target f.json) (action (with-stdout-to %{target} (copy sub/file.json f.json))))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-> required by _build/default/f.json
-> required by alias all
-> required by alias default

Actual Behavior

The error message makes it hard to pinpoint exactly what rule and part of a rule is creating an error.

~/Code/github/dune-demo/dune-empty-stdout-error$ cat dune
(rule (target f.json) (action (with-stdout-to %{target} (copy sub/file.json f.json))))
~/Code/github/dune-demo/dune-empty-stdout-error$ dune build
Error: open(_build/default/f.json): Permission denied
-> required by _build/default/f.json
-> required by alias all
-> required by alias default

Here it's not clear if it's with-stdout-to or copy which fails (I'm guessing on copy but 🤷)

Reproduction

https://github.com/Khady/dune-demo/tree/master/dune-empty-stdout-error

Specifications

  • Version of dune (output of dune --version): 3.17
  • Version of ocaml (output of ocamlc --version): 5.2
  • Operating system (distribution and version): debian
@maiste maiste added cli Command line related open-to-contribution External contributors are welcomed to do a PR to solve the issue labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line related open-to-contribution External contributors are welcomed to do a PR to solve the issue
Projects
None yet
Development

No branches or pull requests

2 participants