reenable precompilation progress output even in non-interactive mode#61064
reenable precompilation progress output even in non-interactive mode#61064KristofferC wants to merge 9 commits intomasterfrom
Conversation
|
This introduces a regression into our tests output, which needs to be corrected before merging. We can change the noisiness heuristics here, but it needs to be done in a way that avoids printing output from the background to avoid fighting for the terminal, like from a script or other usages like that, including Pkg.precompile after #60943: |
That sounds sensible, but how do we distinguish distinguish "background" non-interactive executions vs. "foreground" (e.g. CLI tools / Pkg app wrappers)? Do we need to go by the |
|
Maybe we should track the controlling terminal in the ScopedValue, just like unix? |
How does an (in-process) ScopedValue help with sharing the terminal across processes? Where does "control" transfer? |
|
After a talk with @vtjnash , I think we clarified the request / idea: @vtjnash agreed that these are OK to print if the user is "at the keyboard" and directly issued the command that's precompiling, but he wants to avoid clogging sub-process / script output with them. In particular, these messages can cause errors if your script calls Julia or a Julia-based app, but doesn't expect the "Precompiling..." message. The requirement then is to avoid adding this printing for non-interactive "background" / "child" processes (intentionally left a bit hand-wavey). The main idea we discussed was to add a Long story short, we think that the simplest thing to do here may be to disable this logging in
and |
I think this gets printed to stderr. |
That avoids some issues, but I still think it's fair that we support a mode that leaves all IO to the user-level Julia application, incl. |
|
Take a look at the last commit please. |
| push!(addflags, "--color=no") | ||
| end | ||
| if opts.quiet != 0 | ||
| push!(addflags, "-q") |
There was a problem hiding this comment.
What do you think about setting this by default (based on a kwarg?) instead of propagating?
julia_cmd() is typically used for automated executions IME
There was a problem hiding this comment.
seems reasonable to me, right now it is only for banner which is kind of pointless anyway.
There was a problem hiding this comment.
Although, we don't have a "verbose" so how do you turn it off if you want to?
There was a problem hiding this comment.
Base.julia_cmd(; quiet=false)?
There was a problem hiding this comment.
I guess... just feels like you should be able to do something like $(julia_cmd()) --verbose
There was a problem hiding this comment.
I think trying to mix "opposing" flags like that is its own kind of confusing TBH
uv doesn't allow it either:
$ uv -q -v help
error: the argument '--quiet...' cannot be used with '--verbose...'
There was a problem hiding this comment.
Normally our options allow last-one-wins
There was a problem hiding this comment.
I am OK with tweaking --quiet to also accept --quiet=no and --quiet=yes
But --verbose is probably not the right negated flag to think of (--verbose means "not quiet, and also more noisy than normal" imo)
@KristofferC based on the experience in #61126, I'm kind of inclined to have julia_cmd() not be quiet by default anyway. We'll have to adjust our uses in Base / Pkg to add the quiet flag / kwarg instead where necessary.
|
The help manual for |
|
#61126 ended up being a pre-compilation issue that was weirdly invisible in CI That mis-configuration led to some wasted engineering (and CI machine) time for us and the community, which I think is a good argument in favor of this PR. |
topolarity
left a comment
There was a problem hiding this comment.
LGTM.
I would like to merge this and then quiet-ify any places that @vtjnash (or others) consider too noisy, rather than leaving silent pre-compilation around to surprise users in CI and elsewhere.
vtjnash
left a comment
There was a problem hiding this comment.
Can you at least make sure Distributed and Test add the flag, so we don't get regressions in PkgEval or HPC startup behaviors?
Sure thing 👍
Do you mean Can you enlighten me? |
|
I think we run all of PkgEval via Pkg.test or Base.runtests? Things get very noisy in CI logs, making it hard to read them, when we get this auto-generated spam |
|
How often do we expect to encounter precompilation-from-loading in a typical The main reason I want to keep this logging is because that precompilation is surprising / unexpected in Does it actually appear in the majority of test runs? |
As of 1.13+ this will suppress logging output from Julia (specifically the loading system doing any pre-compilation, see JuliaLang/julia#61064).
|
Always? It changes whether PkgEval logs have the error visible on the first screen, or just log spam |
Don't we expect |
|
It's pretty common for that to compile the wrong set of packages (since it compiles the package itself and not test environment and injects Pkg into the mix), to the point that doing it does slow down the tests. I thought we'd removed that by now? |
|
I see. I am OK with disabling this logging in the tests until we have made My hope is definitely not to spam logs with useless messages about work that must routinely be done anyway. The desire is to make it noisy when you fall off the "happy path" and the work you thought you'd already done ended up useless (as happened in #61126). But that means we need to make the "happy path" good enough first. |
|
Funny, now the precompile tests fail because they read the stderr output of the precompile function 😭 😆 |
…ut in quiet mode, and use quiet mode for testing
Co-authored-by: Cody Tapscott <84105208+topolarity@users.noreply.github.com>
9ecf8c8 to
f6391b1
Compare
f6391b1 to
ad2d9cc
Compare
Fixes #59924