Fix Julia nightly compatibility#23
Draft
msagarpatel wants to merge 5 commits into
Draft
Conversation
Julia nightly (v1.14) changed Test.Threw to require a Base.ExceptionStack for its current_exceptions field rather than accepting nothing. Use current_exceptions() on Julia 1.7+ (when it was introduced) and nothing on older versions. Co-authored-by: Claude <noreply@anthropic.com>
In nightly (v1.14), current_exceptions() returns backtraces typed
as Vector{Union{Ptr{Nothing}, Base.InterpreterIP}} rather than
Vector{Any}, which process_backtrace no longer accepts. Convert
to Any[] before passing.
Co-authored-by: Claude <noreply@anthropic.com>
In nightly (v1.14), process_backtrace() no longer handles
Ptr{Nothing} frames (C frames), causing a MethodError. Switch to
Base.StackTraces.stacktrace() which accepts the raw backtrace
Vector{Union{Ptr{Nothing}, Base.InterpreterIP}} directly and
handles format changes across Julia versions.
Co-authored-by: Claude <noreply@anthropic.com>
print_stackframe gained two new Int arguments in nightly (v1.14). Reconstruct the "[1] func(args)\n @ Module file:line" format manually using the public show(io, frame::StackFrame) API, which is stable across Julia versions. Co-authored-by: Claude <noreply@anthropic.com>
Replace Base.StackTraces.stacktrace(stack) with a lazy per-frame loop
using Base.StackTraces.lookup(). The stacktrace() call symbolizes every
frame in the backtrace at once, which can be very expensive for large
production stacktraces (up to a minute). The per-frame approach stops
as soon as the first non-C Julia frame is found, matching the original
intent of the code.
StackTraces.lookup() accepts both Ptr{Nothing} and Base.InterpreterIP,
so this is compatible with nightly's changed backtrace element type.
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes three nightly (v1.14) compatibility breaks that were pre-existing on master:
Test.Threwfield type change — nightly changed thecurrent_exceptionsfield ofTest.Threwto require aBase.ExceptionStackinstead of acceptingnothing. Fixed by computing the rightThrewcall at macro expansion time:current_exceptions()on Julia 1.7+ (when it was introduced),nothingon older versions.process_backtracebacktrace type change — nightly changedcurrent_exceptions(task)to return backtraces typed asVector{Union{Ptr{Nothing}, Base.InterpreterIP}}instead ofVector{Any}, whichprocess_backtraceno longer accepts. Fixed by switching toBase.StackTraces.stacktrace()which accepts the raw backtrace format directly.Base.print_stackframesignature change — nightly added two newIntarguments toprint_stackframe. Since this is a private internal API, replaced the call with manual reconstruction of the[1] func(args)\n @ Module file:lineformat using the publicshow(io, frame::StackFrame)API.Co-authored-by: Claude noreply@anthropic.com