Dune 3 cannot delete files named `NUL` on Windows
Open
Nobody has claimed this yet.
windows
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
When there's a cycle in dependencies (I guess) or for some other reason a NUL file can be produced in the _build directory. Dune fails to remove it. It can be tricky to remove them: https://stackoverflow.com/questions/17883481/delete-a-file-named-nul-on-windows.
Error: Conflict between the following libraries:
- "lwt.unix" in _build/default/src/unix
- "lwt.unix" in
"C:\\Users\\antonin\\.opam\\ocaml-variants.4.13.1+mingw64c\\lib\\lwt\\unix"
-> required by library "lwttester" in _build/default/test
-> required by executable main in test/ppx/dune:2
-> required by _build/default/test/ppx/main.exe
-> required by %{exe:main.exe} at test/ppx/dune:10
-> required by alias test/ppx/runtest in test/ppx/dune:7
$ dune clean
Error: rmdir(_build\default\src\unix): Directory not empty
$ ls _build/default/src/unix
NUL
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue on Windows with the dependency-cycle scenario and dune clean, focusing on _build/default/src/unix/NUL. The issue names no source file or test; done means cleanup removes the NUL entry and completes without the directory-not-empty error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100