-
Notifications
You must be signed in to change notification settings - Fork 409
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
pkg: fix dev-tool bug where dune fmt
would revert file
#10990
Conversation
Fixes #10991 |
Would you like add the test from #10993 ? |
Fix looks good, but I think we need to improve things further to avoid mistakes like this. I would suggest the following steps:
It might be easier to do 2. followed by 1. EDIT: I see that the test has been created already. Let's take the opportunity to add sandboxing to demonstrate that this dependency is indeed missing. |
How would sandboxing the formatting action prevent mistakes like this? |
If sandboxing was an enabled for the rule, the action would always fail with some error saying that it was unable to find the input file. Without sandboxing, the rule sometimes succeeds b/c the input was already in _build due to being needed for some other rule. |
Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
The rule for running ocamlformat on source files when dev-tools are in use did not depend on the input file, so changes to the input file wouldn't cause ocamlformat to be re-run on the updated file. The consequence of this is that `dune fmt` would promote stale versions of files. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
1761879
to
40720f4
Compare
Ok I added sandboxing and confirmed that without the fix the formatting action can't find its input file. |
The rule for running ocamlformat on source files when dev-tools are in use did not depend on the input file, so changes to the input file wouldn't cause ocamlformat to be re-run on the updated file. The consequence of this is that
dune fmt
would promote stale versions of files.