-
Notifications
You must be signed in to change notification settings - Fork 409
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
Enable running two builds in separate terminals (a.k.a. dune monitor
)
#7308
Comments
Currently we have no way of sending (error) messages via RPC. So if there is a Dune in watch mode, having another Dune connect by a user will mean they won't see the messages. Everything else should work however. |
Getting the output back is exactly what implementing
It's not possible to do it per directory because there's some global database files that aren't per directory. It would be possible for the lock to be released by watch mode when it's idle though. |
What I mean is that I'm not sure if exposing the complexity of a new subcommand to users is needed / worth it. Under the idea I'm suggesting,
For users, it would be transparent. For dune maintenance, it avoids extra subcommand (docs and maintenance costs). |
This only works if the first dune is run in watch mode. What happens when |
@jchavarri Personally, I would find the command to be useful on its own. It's often the case that I run dune in watch mode in the background, but would like to inspect the output from my editor. I would prefer not to run the build from the editor, because I want dune to stay running even if the editor is killed. For this reason, I'd like to see In any case, if you prefer not to add a |
My main concern or hesitation about
@rgrinberg could you expand on this a bit please? I think I am not getting how this part would work. |
Okay, I think we might be talking about different things. I think that running
And being smart about separating the commands that want to stream their outputs. Doing this is a much smaller task than
It would take these steps:
|
It seems something similar to this idea was already implemented in #4715? I can run
Some of the things missing are:
But maybe |
Another command that seems related to what this issue is about is
The missing parts are:
So it seems a combination of |
That's right.
|
#6360 disabled multiple build commands running concurrently.
However, as dune expands its scope and supports more tools, the case for running
dune build
with two or more apps in separate terminals gains strength.For the particular use case I can speak of, at Ahrefs we have a web server written in native OCaml, and a frontend built with Melange. It is desirable to track the build status of both apps on separate terminals to not mix errors, and also because each environment might have different binaries that are executed on a successful build (e.g. the web server binary is relaunched after every build succeeds, same for webpack or other JS bundlers on the Melange side).
@rgrinberg suggested to have a new subcommand
monitor
that would help mirror the output of a running dune process. Then, add todune build
the ability to delegate a job, and then attachdune monitor
until the job is finished.I wonder, would it be possible to solve this problem without adding a new subcommand? I.e. when
dune build
sees that another dune process is already running, it can request it to build some target, and get the output back. Essentially making the lock system transparent for users.Another idea to sidestep the new subcommand would be to make the lock system more granular, and instead of locking the whole tree, lock the specific folders that the current build is targeting. Not sure if this is possible though 🤔
The text was updated successfully, but these errors were encountered: