Skip to content

Fix Julia nightly compatibility#23

Draft
msagarpatel wants to merge 5 commits into
sp-fix-ci-cache-actionfrom
sp-fix-nightly-threw
Draft

Fix Julia nightly compatibility#23
msagarpatel wants to merge 5 commits into
sp-fix-ci-cache-actionfrom
sp-fix-nightly-threw

Conversation

@msagarpatel
Copy link
Copy Markdown
Collaborator

@msagarpatel msagarpatel commented Feb 27, 2026

Fixes three nightly (v1.14) compatibility breaks that were pre-existing on master:

  1. Test.Threw field type change — nightly changed the current_exceptions field of Test.Threw to require a Base.ExceptionStack instead of accepting nothing. Fixed by computing the right Threw call at macro expansion time: current_exceptions() on Julia 1.7+ (when it was introduced), nothing on older versions.

  2. process_backtrace backtrace type change — nightly changed current_exceptions(task) to return backtraces typed as Vector{Union{Ptr{Nothing}, Base.InterpreterIP}} instead of Vector{Any}, which process_backtrace no longer accepts. Fixed by switching to Base.StackTraces.stacktrace() which accepts the raw backtrace format directly.

  3. Base.print_stackframe signature change — nightly added two new Int arguments to print_stackframe. Since this is a private internal API, replaced the call with manual reconstruction of the [1] func(args)\n @ Module file:line format using the public show(io, frame::StackFrame) API.

Co-authored-by: Claude noreply@anthropic.com

msagarpatel and others added 2 commits February 26, 2026 19:34
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>
@msagarpatel msagarpatel changed the title Fix Threw compat with Julia nightly Fix Julia nightly compatibility Feb 27, 2026
msagarpatel and others added 3 commits February 26, 2026 19:41
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant