-
Notifications
You must be signed in to change notification settings - Fork 401
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
test: reproduce dune exec -w
crash with pkg management
#10960
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Repro `dune exec --watch` crash with pkg management | ||
|
||
$ . ./helpers.sh | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.13) | ||
> (pin | ||
> (url file://$PWD/_multiple) | ||
> (package (name foo)) | ||
> (package (name bar))) | ||
> (package | ||
> (name main) | ||
> (depends foo bar)) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> (executable | ||
> (name x)) | ||
> EOF | ||
$ cat >x.ml <<EOF | ||
> let () = print_endline "hello" | ||
> EOF | ||
|
||
$ mkdir dune.lock | ||
$ cat >dune.lock/lock.dune <<EOF | ||
> (lang package 0.1) | ||
> (repositories | ||
> (complete true)) | ||
> EOF | ||
|
||
$ cat >dune.lock/test.pkg <<EOF | ||
> (version 0.0.1) | ||
> (build | ||
> (system "echo building test")) | ||
> EOF | ||
|
||
$ dune exec -w ./x.exe > output.log 2>&1 & | ||
$ PID=$! | ||
$ sleep 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The watching/ tests use some better helpers. Up to you if you want to improve things. Also I would move this from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you point me to a relevant example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They have these The logic in the script handles stopping the watch mode build and the output. Presumably something like that could be adapted for |
||
$ cat output.log | sort | ||
Success, waiting for filesystem changes... | ||
building test | ||
hello | ||
$ kill $PID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps call this
get_env_and_build_if_necessary
.