dune icon indicating copy to clipboard operation
dune copied to clipboard

opam files from template generated with carriage return on windows

Open Alizter opened this issue 2 years ago • 5 comments

Reproduction case in https://github.com/ocaml/dune/pull/9481

When generating opam file on windows from templates, carriage returns get added to the output of the opam file. This will later be stripped by git but causes necessary diffs (and promotions) for windows users.

Alizter avatar Dec 12 '23 21:12 Alizter

What's worse, when I revert the spurious diff, dune build -w results in errors like these for me:

Error: rename(.#printbox-ext-plot.opam.dune-temp): Permission denied
-> required by _build/default/printbox-ext-plot.opam
-> required by alias all
-> required by alias default
Had 1 error, waiting for filesystem changes... 

Re-running dune build re-creates the spurious diffs.

lukstafi avatar Feb 26 '25 23:02 lukstafi

See https://github.com/ocaml/dune/issues/8358#issuecomment-2585856282

yawaramin avatar Feb 27 '25 00:02 yawaramin

@lukstafi That's interesting. Are you first promoting and then reverting whilst watch mode is running?

Alizter avatar Jun 11 '25 22:06 Alizter

Apologies for delay, I'll reply when I'm back on my Windows machine.

lukstafi avatar Jun 12 '25 08:06 lukstafi

@Alizter However, the quick answer is that yes, I'm reverting while dune build -w (watch mode) is running, that's causing the error above, and I'm not explicitly promoting since I have generate_opam_files: yes.

lukstafi avatar Jun 12 '25 08:06 lukstafi