WIP: Direct binding deprecation warnings to logging system #25413
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a first attempt to direct the output of
jl_binding_deprecation_warning
to the logging system. This is a bit of a challenge as this depwarn may be generated from contexts where calling back into julia isn't allowed. I don't yet know what these contexts are and when they are active. @vtjnash suggested working around this by emitting the warning from a different task which is what I've done here.This approach works, but I'm not really satisfied with the current implementation because
Workqueue
variable, but to make it work with@sync
blocks becomes quite nasty (it would require allocating an ObjectIdDict from the C side, and inserting into it. All of which is defined in julia which we're supposed to not be calling into from this context.)@sync
blocks don't work so you can't collect async logs usingwith_logger()
.I've got some ideas on what to try next
jl_switchto
. This won't work if we're inside a finalizer or function generator, but maybe that's ok.Advice appreciated - anything done here will be reused to convert the rest of the user visible logging from the C code to the logging system.