Allow rpc-triggered builds in eager watch mode#11622
Conversation
d8f4b55 to
24dc317
Compare
| let ivar = Fiber.Ivar.create () in | ||
| let targets = List.map targets ~f:server.parse_build in | ||
| let* () = Job_queue.write server.pending_build_jobs (targets, ivar) in | ||
| Fiber.Ivar.read ivar |
There was a problem hiding this comment.
To make sure I understand: you delete this part because either in passive or eager mode, we want to handle the request. Am I correct?
There was a problem hiding this comment.
That's correct. The only purpose of the watch_mode_config field was to prevent build requests from being handled by eager watch mode, so if we're allowing eager watch mode to handle build requests now then there's no need for the field or for this match statement (it now just always does what was formerly the Yes Passive case).
24dc317 to
94fcfb8
Compare
|
You'll need to update the documentation I tested |
94fcfb8 to
660297e
Compare
|
Thanks for testing this out @Alizter. I've update the rpc docs. |
When dune is started in eager watch mode (e.g. by running `dune build --watch`) it starts an RPC server, but prior to this change it would reject RPC requests to build targets. This is a step towards being able to run dune commands that trigger build (e.g. `build`, `exec`, `test`) while watch mode is running. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
660297e to
2a7d875
Compare
When dune is started in eager watch mode (e.g. by running `dune build --watch`) it starts an RPC server, but prior to this change it would reject RPC requests to build targets. This is a step towards being able to run dune commands that trigger build (e.g. `build`, `exec`, `test`) while watch mode is running. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
CHANGES: ### Fixed - Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple times. (ocaml/dune#11547, @Alizter) - Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality flag would result in pkgconf not finding libraries in some contexts. (ocaml/dune#11619, @MisterDA) - Fix: Evaluate `enabled_if` when computing the stubs for stanzas such as `foreign_library` (ocaml/dune#11707, @Alizter, @rgrinberg) - Fix $ dune describe pp for libraries in the presence of `(include_subdirs unqualified)` (ocaml/dune#11729, fixes ocaml/dune#10999, @rgrinberg) - Fix `$ dune subst` in sub directories of a git repository (ocaml/dune#11760, fixes ocaml/dune#11045, @Richard-Degenne) - Fix a crash involving `Path.drop_prefix` when using Melange on Windows (ocaml/dune#11767, @nojb) ### Added - Added detection and warning for common typos in package dependency constraints (ocaml/dune#11600, fixes ocaml/dune#11575, @kemsguy7) - Added `(extra_objects)` field to `(foreign_library)` stanza with `(:include)` support. (ocaml/dune#11683, @Alizter) ### Changed - Allow build RPC messages to be handled by dune's RPC server in eager watch mode (ocaml/dune#11622, @gridbugs) - Allow concurrent build with RPC server (ocaml/dune#11712, @gridbugs)
CHANGES: ### Fixed - Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple times. (ocaml/dune#11547, @Alizter) - Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality flag would result in pkgconf not finding libraries in some contexts. (ocaml/dune#11619, @MisterDA) - Fix: Evaluate `enabled_if` when computing the stubs for stanzas such as `foreign_library` (ocaml/dune#11707, @Alizter, @rgrinberg) - Fix $ dune describe pp for libraries in the presence of `(include_subdirs unqualified)` (ocaml/dune#11729, fixes ocaml/dune#10999, @rgrinberg) - Fix `$ dune subst` in sub directories of a git repository (ocaml/dune#11760, fixes ocaml/dune#11045, @Richard-Degenne) - Fix a crash involving `Path.drop_prefix` when using Melange on Windows (ocaml/dune#11767, @nojb) ### Added - Added detection and warning for common typos in package dependency constraints (ocaml/dune#11600, fixes ocaml/dune#11575, @kemsguy7) - Added `(extra_objects)` field to `(foreign_library)` stanza with `(:include)` support. (ocaml/dune#11683, @Alizter) ### Changed - Allow build RPC messages to be handled by dune's RPC server in eager watch mode (ocaml/dune#11622, @gridbugs) - Allow concurrent build with RPC server (ocaml/dune#11712, @gridbugs)
When dune is started in eager watch mode (e.g. by running `dune build --watch`) it starts an RPC server, but prior to this change it would reject RPC requests to build targets. This is a step towards being able to run dune commands that trigger build (e.g. `build`, `exec`, `test`) while watch mode is running. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
When dune is started in eager watch mode (e.g. by running
dune build --watch) it starts an RPC server, but prior to this change it would reject RPC requests to build targets. This is a step towards being able to run dune commands that trigger build (e.g.build,exec,test) while watch mode is running.Kind of testing the waters with this change as there may be consequences I'm unaware of of running the entire build system concurrently in two different fibers. Conceptually I think it makes sense, as the task of rebuilding targets named on the command line in response to file changes is unrelated to the task of rebuilding targets in response to RPC messages. Do we need to take extra care to prevent the two fibers from interfering with each other?