-
Notifications
You must be signed in to change notification settings - Fork 81
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
Run in background #738
base: main
Are you sure you want to change the base?
Run in background #738
Conversation
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.
Thanks for the contribution! Testing it locally I can't seem to make it work, it never starts watching:
sbt:default-ce2872> docs/mdocBgStart
[info] running mdoc.SbtMain --watch --background
[success] Total time: 3 s, completed Jan 12, 2023, 5:24:39 PM
sbt:default-ce2872>
I was testing it on scalameta/metals
.
Also why would you need to run it in the background? Is it an issue with the fact that watch doesn't work well if you need to recompile some sources?
error.append(err) | ||
} | ||
|
||
// TODO: Do we need the -Xmx setting and any other future options? |
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.
// TODO: Do we need the -Xmx setting and any other future options? |
I don't think we need any other options for the test, should we remove the comment?
Hmm that's odd. I'll look into it.
It's convenient to return the sbt shell so that other commands can be issued, especially if mdoc is only one of many tools in the pipeline that each have their own watch mode. I want to run mdoc in watch mode and then another tool which watches for the output of mdoc, and run that via a single sbt command that calls both of those tasks. |
We have this exact usecase as well, we currently run the other tool in the background. It's a bit tricky, see: |
@tgodzik I ran
I'm assuming in your test setup, running It's weird how undertow isn't even starting. My change should only change the behaviour after Does
|
@olafurpg could you take a quick look if this makes sense? @steinybot sorry for no response, I will try it out later this week. Could you take a look at the scripted tests? |
Resolves #737
This does a couple of things.
The first is to add a
--background
setting which stops mdoc from reading from standard input and waiting for the enter key and instead it blocks until being interrupted. See the first two commits for this.The last commit wraps this up in a useful sbt tasks for starting and stopping which takes care of some non-trivial stuff like tracking the job handle.