Skip to content
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

add reproduction for regression with exec + watch #10380

Closed
wants to merge 4 commits into from

Conversation

tatchi
Copy link
Contributor

@tatchi tatchi commented Apr 3, 2024

This demonstrates a regression when calling the `exec' command in watch mode from a child folder of the root folder.

So in short the following works fine

dune exec --watch /path/to/bin/main.exe

But not:

cd path && dune exec --watch ./to/bin/main.exe

In this case I get this error on Linux:

execve(_build/default/path/to/bin/main.exe): : No such file or directory

On MacOS, and according to the regression test, the error is different:

Error: posix_spawn(): No such file or directory

Signed-off-by: Corentin Leruth <[email protected]>
@tatchi tatchi force-pushed the repro-exec-watch-issue branch from 35bd27b to 3c45c0e Compare April 3, 2024 17:34
@@ -18,7 +18,7 @@ between each change to its code.
1 | let () = print_endline "baz
^
Error: String literal not terminated
Had errors, waiting for filesystem changes...
Had 1 error, waiting for filesystem changes...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to do with this PR, this is just a change that was never promoted

Entering directory '..'
Error: posix_spawn(): No such file or directory
Leaving directory '..'
$ sleep 0.5;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably come up with something better than sleep, but my point was to show the problem

@tatchi
Copy link
Contributor Author

tatchi commented Apr 4, 2024

@tatchi
Copy link
Contributor Author

tatchi commented Apr 4, 2024

Reverting #10262 seems to fix the issue cc @gridbugs

@gridbugs
Copy link
Collaborator

gridbugs commented Apr 4, 2024

Investigating...

@gridbugs
Copy link
Collaborator

gridbugs commented Apr 4, 2024

Fixed in #10386. The problem was caused by relative paths to executables in the _build directory being resolved relative to the user's cwd rather than the project root. See the the commit message of 5038bbc for more info.

I've squashed your commits into a single commit with your signature attached and included it in my PR, mostly to add the tests you wrote.

Thanks for the report!

@tatchi
Copy link
Contributor Author

tatchi commented Apr 4, 2024

Thanks for the quick fix @gridbugs 🤗

@tatchi tatchi closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants