-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Implement runBackgroundInherit
/ runMainBackgroundInherit
#2755
Conversation
b568f6a
to
3ad2efc
Compare
@swaldman thanks for the PR! I think the suggestion of making it a flag on the |
…nd subprocess outputs.
…, define runBackgroundInherit variations.
…ks set destination for runBackground tasks.
…d for type annotations to os.FilePath in order to serialize.
3ad2efc
to
c0b0e7c
Compare
@lihaoyi I agree that sounds better! Proliferating a menagerie of I've pushed a new attempt, which...
The reason for that last change was an annoyance defining paths within A common intention might be to log these streams to files in e.g. So the current implementation
So if This implementation does everything one might want, I think, but it's a judgment call whether it's worth its complexity. Will users understand this well enough to use it, or will it just not be a big deal to return Implementing this required adding to Nevertheless it's maybe more uncertainty than my very niche concern over We could certainly fallback to returning Alternatively, perhaps most parsimoniously, we could forget about the overridable configuration methods entirely, choose whatever as the default behavior for Sorry to go on for so long! As always, the intent is to contribute back, not create headaches. I'm not offended if this is all not worth the cognitive load. Thanks again for everything! |
This PR has grown IMHO too complicated and unwieldy. Replaced by #2792 |
For what it's worth, here's a sketch of one possible way to address where
runBackground
process output should go.I'm not at all wedded to it! Mostly, since I'm coming at you with asks, I want to do my part to help. For example, @lolgab's suggestion of overridable
strikes me as perhaps more elegant and flexible than duplicating
runBackground
commands, which I've done here.In general, this pull request
factors out the common implementations of
JavaModule.runBackground
andJavaModule.runMainBackground
into a helper method.creates variants of
Jvm.spawnSubprocess
andJvm.runSubprocess
that permit specifyingout
anderr
via an optionalTuple2
ofProcessOutput
(and reimplements the existing methods, which offer aBoolean
flagbackground
, in terms of these methods)modifies the common
doRunBackground
implementation to accept that optional tuple ofProcessOutput
modifies
JavaModule.runBackground
andJavaModule.runMainBackground
to call the new methods, usingT.dest/stdout.log
andT.dest/stderr.log
as outputsadds two new commands
JavaModule.runBackgroundInherit
andJavaModule.runMainBackgroundInherit
which sets bothout
anderr
toos.Inherit
Please note the bit in bold. In general, everything old is preserved. No method signatures are removed or changed, there are only additions and reimplementations in terms of those additions. But, following the discussion on discord, I did make one change to the current behavior, dropping the default logs in
runBackground.dest
/runMainBackground.dest
rather than in the project root directory.I've had to bring in #2752 so that I could give this a try. It seems like it works!
I apologize for the amateurishness. I feel like I'm groping my way around in
mill
. It was very helpful to learn from @lihaoyi on the discord that./mill -i installLocal
generates a binary one can play with intarget/
Thank you all for your work. I love this tool.