Skip to content

Commit 009a1ff

Browse files
committed
Without wait the behaviour is correct, the error message is missing though
Signed-off-by: Ambre Austen Suhamy <[email protected]>
1 parent f20ddb3 commit 009a1ff

File tree

8 files changed

+26
-24
lines changed

8 files changed

+26
-24
lines changed

bin/build.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ let build =
203203
perform the RPC call.
204204
*)
205205
Rpc_common.run_via_rpc
206-
~builder
207-
~common
208-
~config
206+
builder
209207
lock_held_by
208+
common
209+
config
210210
(Rpc.Build.build ~wait:true)
211211
targets
212212
| Ok () ->

bin/fmt.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let run_fmt_command ~common ~config ~preview =
4949
Scheduler.go_without_rpc_server ~common ~config (fun () ->
5050
Rpc_common.fire_request
5151
~name:"format"
52-
~wait:true
52+
~wait:false
5353
Dune_rpc.Procedures.Public.format
5454
())
5555
in

bin/promotion.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ module Apply = struct
6363
Diff_promotion.promote_files_registered_in_last_run files_to_promote)
6464
| Error lock_held_by ->
6565
Rpc_common.run_via_rpc
66-
~builder
67-
~common
68-
~config
66+
builder
6967
lock_held_by
68+
common
69+
config
7070
(Rpc_common.fire_request
7171
~name:"promote_many"
72-
~wait:true
72+
~wait:false
7373
Dune_rpc_private.Procedures.Public.promote_many)
7474
files_to_promote
7575
;;

bin/rpc/rpc_common.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ let fire_request ~name ~wait request arg =
8484
~f:(fun client -> request_exn client request arg)
8585
;;
8686

87-
let wrap_build_outcome_exn ~print_on_success f args () =
87+
let wrap_build_outcome_exn ~print_on_success f arg () =
8888
let open Fiber.O in
89-
let+ response = f args in
89+
let+ response = f arg in
9090
match response with
9191
| Error (error : Rpc_error.t) -> raise_rpc_error error
9292
| Ok Dune_rpc.Build_outcome_with_diagnostics.Success ->
@@ -118,11 +118,11 @@ let warn_ignore_arguments lock_held_by =
118118
]
119119
;;
120120

121-
let run_via_rpc ~builder ~common ~config lock_held_by f args =
121+
let run_via_rpc builder lock_held_by common config request arg =
122122
if not (Common.Builder.equal builder Common.Builder.default)
123123
then warn_ignore_arguments lock_held_by;
124124
Scheduler.go_without_rpc_server
125125
~common
126126
~config
127-
(wrap_build_outcome_exn ~print_on_success:true f args)
127+
(wrap_build_outcome_exn ~print_on_success:true request arg)
128128
;;

bin/rpc/rpc_common.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ val warn_ignore_arguments : Dune_util.Global_lock.Lock_held_by.t -> unit
4444

4545
(** Schedule a fiber to run via RPC, wrapping any errors. *)
4646
val run_via_rpc
47-
: builder:Common.Builder.t
48-
-> common:Common.t
49-
-> config:Dune_config_file.Dune_config.t
47+
: Common.Builder.t
5048
-> Dune_util.Global_lock.Lock_held_by.t
49+
-> Common.t
50+
-> Dune_config_file.Dune_config.t
5151
-> ('a
5252
-> (Dune_rpc.Build_outcome_with_diagnostics.t, Dune_rpc.Response.Error.t) result
5353
Fiber.t)

bin/runtest.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ let runtest_term =
4949
~to_cwd:(Common.root common).to_cwd)
5050
| Error lock_held_by ->
5151
Rpc_common.run_via_rpc
52-
~builder
53-
~common
54-
~config
52+
builder
5553
lock_held_by
54+
common
55+
config
5656
(Rpc_common.fire_request
5757
~name:"runtest"
58-
~wait:true
58+
~wait:false
5959
Dune_rpc.Procedures.Public.runtest)
6060
dir_or_cram_test_paths
6161
;;

test/blackbox-tests/test-cases/cram/custom-build-dir.t

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ path
1010
> $ dune runtest
1111
> EOF
1212

13-
$ dune rpc ping --wait
14-
1513
$ DUNE_BUILD_DIR=$PWD/tmp dune runtest --auto-promote
1614
File "foo.t", line 1, characters 0-0:
1715
Error: Files
@@ -23,7 +21,11 @@ path
2321
$TESTCASE_ROOT/tmp/default/foo.t.corrected
2422
to foo.t.
2523
[1]
26-
$ sed -E '/\(pid: [0-9]+\)/{s//(pid: ###)/; s/instance.*/.../g; q;}' foo.t
24+
$ sed -E 's/[0-9]+\)/###)/g' foo.t
2725
$ echo " $ echo bar" >bar.t
2826
$ dune runtest
29-
Error: A running dune (pid: ###) ...
27+
Warning:
28+
Your build request is being forwarded to a running Dune instance (pid:
29+
###). Note that certain command line arguments may be ignored.
30+
Error: RPC server not running.
31+
[1]

test/blackbox-tests/test-cases/watching/watching-eager-concurrent-runtest-command.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ starts immediately.
2020

2121
Test that we can run a test while another instance of dune is running in watch
2222
mode:
23-
$ dune runtest 2>&1 | sed 's/pid: [0-9]*/pid: PID/g'
23+
$ dune runtest 2>&1
2424
Success
2525

2626
Test that passing extra arguments to `dune runtest` prints a warning when

0 commit comments

Comments
 (0)