dune
                                
                                 dune copied to clipboard
                                
                                    dune copied to clipboard
                            
                            
                            
                        Fix locating program in exec watch mode
This fixes a bug where running an executable from the current project
with dune exec --watch would be unable to find the executable unless
the command was run from the project's root directory.
The problem was introduced when we started setting the cwd of processes spawned by exec in watch mode to the user's current directory (https://github.com/ocaml/dune/pull/10262). If the program argument to exec refers to a file to be built in the current project (such as an executable implemented in the current project) then the path to the executable to spawn will be a path inside the _build directory relative to the project root. Since the cwd of the new process was set to the user's current directory, this relative path was being resolved within the current directory, whereas it should have been resolved relative to the project root.
The fix was to convert relative paths into absolute paths relative to the project root (this was already being done for exec when not in watch mode).
what happens with
cd path && dune exec -- echo hello?IIUC,
echowould pass theFilename.is_relativecheck and get a prefix when it shouldn't?
dune exec converts paths with no slashes into absolute paths by looking them up in PATH, so any program names will be represented by their absolute path here.
Just making sure that we don't forget to merge this. Are any other changes necessary?
Fixed in another PR