ocaml / ocaml/dune

dune exec needs to add .exe on Windows

Open
#3,322 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

windows
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 17m
Merged PRs (30d)
287

Description

dune exec -- foo on Windows needs to consider dune exec -- foo.exe when working out if there is a program to (re)compile. At the moment, the behaviour is mixed:

  • if _build/install/default/bin/foo.exe has previously been built, then you get a potentially stale execution of foo if its sources have changed
  • if _build/install/default/bin/foo.exe hasn't previously been built, then you get an error.

Specifying dune exec -- foo.exe works consistently, but this has two problems:

  • It's surprising on Windows (unless the user has done something really weird with the PATHEXT environment variable)
  • It's not good for a cross-platform set-up since dune exec -- foo.exe will fail on a (Unix) system which installs foo.exe as foo with the executable bit set.

(Dune 2.4.0; Windows mingw32; OCaml 4.08.1)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dune exec command path and reproduce the reported Windows behavior with foo and foo.exe. Trace how the executable is located and how source changes trigger rebuilding; it is done when dune exec -- foo consistently handles the Windows .exe name without breaking the corresponding Unix setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.