-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Log precompile _failures_ as well as errors. Pass log level through to helper process. #457
base: master
Are you sure you want to change the base?
Conversation
…o helper process. This allows users to set the debug log level in the process, not just via the `JULIA_DEBUG=all` environment variable (we _thought_ we had enabled the debug messages, but we had not! 😬 ). Also, adds a log statement for precompile statements that _fail_, not just those that error. For example, this surfaces this failure: ```julia ┌ Debug: Precompilation failed: precompile(Tuple{typeof(Base.deepcopy_internal), Any, Base.IdDict{Any, Any}}) └ @ Main.anonymous none:31 ``` Which is a pattern I've noticed in our own precompilation failures, where Julia seems to be emitting a precompile statement with an abstract argument (`Any` in this case, but i've seen others) for a method that is _not_ marked `@nospecialize`, which causes `precompile()` to fail, since you cannot normally instantiate a method for abstract types. So that's a separate issue that we need to dig into, but this PR allows us to identify issues like these. :)
76c29e0
to
6aa2fb2
Compare
I would prefer to be able to somehow pass through the Log config if you set I'd love suggestions for that if you have any! :) |
Codecov Report
@@ Coverage Diff @@
## master #457 +/- ##
==========================================
- Coverage 84.91% 84.31% -0.60%
==========================================
Files 2 2
Lines 338 338
==========================================
- Hits 287 285 -2
- Misses 51 53 +2
Continue to review full report at Codecov.
|
end | ||
total = length(precompile_statements) | ||
@info "PackageCompiler: completed \$total precompile statements with \$failures failures, \$errors errors." |
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.
One problem here is that people think there is something wrong with their code when they see "x errors" but there is really nothing they can do to fix it. So I'm a little bit against adding this as something people see by default.
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.
Yeah, i had the same concern, and wasn't sure what to do about it.
Maybe a flag, to control reporting precompilation success rate?
Or we could print this to @debug
, too, but debug is very noisy and i think we'd like to see this all the time.
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.
Do you have any suggestions? :) Thanks!
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.
Maybe we can also print the link to the julia issue that's in the comment, above?
Or do you think I should just move this to a @debug
log as well?
5409fb3
to
2e50a35
Compare
This allows users to set the debug log level in the process, not just
via the
JULIA_DEBUG=all
environment variable (we thought we hadenabled the debug messages, but we had not! 😬 ).
Also, adds a log statement for precompile statements that fail, not
just those that error. For example, this surfaces this failure:
Which is a pattern I've noticed in our own precompilation failures,
where Julia seems to be emitting a precompile statement with an abstract
argument (
Any
in this case, but i've seen others) for a method that isnot marked
@nospecialize
, which causesprecompile()
to fail, sinceyou cannot normally instantiate a method for abstract types.
So that's a separate issue that we need to dig into, but this PR allows
us to identify issues like these. :)