Skip to content

Backports for 1.13.0-beta1#60312

Merged
KristofferC merged 30 commits intorelease-1.13from
backports-release-1.13
Jan 9, 2026
Merged

Backports for 1.13.0-beta1#60312
KristofferC merged 30 commits intorelease-1.13from
backports-release-1.13

Conversation

@KristofferC
Copy link
Member

No description provided.

xal-0 and others added 7 commits December 4, 2025 14:34
Some testing by @BenChung has revealed how hard it is to load a
JuliaC-built library into a program that has already loaded a very old
version of libstdc++. Even with probing disabled, `libjulia-internal.so`
fails because of missing GLIBCXX symbols.

We use so little of the C++ standard library in `libjulia-internal.so`
that it's worth the tradeoff to link it statically: it barely changes
the size of the resulting library, removes a medium-size library we have
to ship in trimmed bundles, and solves some of our hermeticity issues
when being loaded by other software. `libjulia-codegen.so` uses it more
extensively, and we expect to be able to load it as a plugin for `opt`,
meaning it may have to remain dynamically linked.

This PR contains a series of changes to enable statically linked
libstdc++ by default and mitigate the size impact:
- We enable `--gc-sections` when building with gcc/ld.bfd. This saves us
some code already, since we can trim out a lot of
libLLVMSupport/libLLVMTargetParser. On macOS, we can use `-dead_strip`
to save some space even though the rest of these changes are not
applicable.
- Two flags for `-static-libstdc++` and `-static-libgcc`, called
`USE_RT_STATIC_LIBSTDCXX` and `USE_RT_STATIC_LIBGCC`, are added and
enabled by default.
- Most of the additional code that gets linked into
`libjulia-internal.so` is related to locales for iostreams. Replace
these with standard C IO and LLVM helpers that don't have weird
locale-related behaviour.
- (NOT IMPLEMENTED) `--gc-sections` removes unused executable code, but
leaves us with a lot of irrelevant debug info. I tested the effect of
`llvm-dwarfutil --garbage-collection` and saw pretty good savings, but
that is not included in this PR because BinaryBuilder doesn't have a new
enough version of the LLVM tools.

| Change | Size of `libjulia-internal.so` (KiB) |

|--------------------------------------|--------------------------------------|
| No change | 14524 |
| Linker GC enabled | 13220 |
| -static-libstdc++ and -static-libgcc | 22136 |
| Excise iostreams | 15036 |
| DWARF GC (not in this PR) | 11488 |

This is a comparison of symbols that were added and removed. Even though
15 times more code is removed than added, the resulting
`libjulia-internal.so` has a similar size to the original because of the
additional debug info.

(cherry picked from commit f36882f)
It was exported in v1.7, not v1.10: #39588

(cherry picked from commit 1067db8)
Co-authored-by: Cody Tapscott <84105208+topolarity@users.noreply.github.com>
(cherry picked from commit 841148d)
(cherry picked from commit cb2ceb9)
Somewhat of a companion to
#60248.

For a small application that has just started up `fork()` is not a huge
concern, but it's quite heavy-handed for Julia- as-a-library scenarios
where resident memory may already be large. Many soft-embedded targets
also do not support fork() well, so it is good for our compatibility to
adjust this.

Rather than relying on the linker to do all of the heavy lifting, this
changes our `libstdcxx` probe sequence to directly parse the
`ld.so.cache` and `libstdc++.so.6` files. As long as we can expect
`/etc/ld.so.cache` to be the same path on all Linux systems, this seems
to be a reliable way to locate system libraries.

(cherry picked from commit ac4ee59)
@KristofferC KristofferC added the release Release management and versioning. label Dec 4, 2025
@KristofferC KristofferC requested a review from giordano as a code owner December 4, 2025 13:34
vtjnash and others added 21 commits December 9, 2025 17:57
Add fake_stack_pop implementation for Linux platforms to improve stack
unwinding in debuggers when analyzing core dumps from signals like
SIGQUIT. This provides proper DWARF Call Frame Information (CFI)
directives that help unwinders locate saved register values on the
manipulated stack.

The implementation follows the same pattern as the existing macOS
version, with fake_stack_pop now unified in signals-unix.c to support
both platforms:
- x86_64: Uses .cfi_def_cfa %rsp with offsets for %rip and %rsp
- i686: Uses .cfi_def_cfa %esp with offsets for %eip and %esp
- aarch64: Uses .cfi_def_cfa sp with offsets for lr and sp

The jl_call_in_ctx function on Linux now sets up the stack similarly to
jl_call_in_state on macOS, pushing saved register state and a return
address pointing to fake_stack_pop to enable proper unwinding.

🤖 Generated with Claude Code

(cherry picked from commit 8fd607a)
…0259)

If a method we precompile instantiates a closure struct, and there is a
single compileable signature for the closure method, we can compile the
closure method with few downsides.

For example:
```julia
f(x::T) where {T <: Number} = y::T -> x+y
precompile(f, (Int,))

f(1)(2)
```

Before, the closure method would not get precompiled, resulting in
`--trace-compile` output:
`precompile(Tuple{Foo.var"#f##0#f##1"{Int64, Int64}, Int64})`

This idea was motivated by trying to make the REPL precompile script
more "static". Creating a task with `@task` or `@async` expands into a
no-argument lambda, which won't get precompiled with the containing
method.
#60394)

Stdlib: LinearAlgebra
URL: https://github.com/JuliaLang/LinearAlgebra.jl.git
Stdlib branch: release-1.13
Julia branch: backports-release-1.13
Old commit: 7e11b5e
New commit: 4786452
Julia version: 1.13.0-alpha2
LinearAlgebra version: 1.13.0
Bump invoked by: @dkarrasch
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/LinearAlgebra.jl@7e11b5e...4786452

```
$ git log --oneline 7e11b5e..4786452
4786452 Backports release 1.13 (#1495)
31f3947 Make sure inputs to the hemm etc tests are Hermitian  (#1522)
d39ff40 Fix GEMM dispatch for complex-real matmul (#1520)
8a7f5dc Make `dot` consistently return `zero` on empty arrays (#1494)
99da7a5 Fixed typo in matmul.jl (#1492)
8152331 Fix 3-arg `dot` for empty arrays (#1485)
ea1e3f8 Fix forgotten conj(alpha) in her2k documentation (#1480)
```

Co-authored-by: dkarrasch <26658441+dkarrasch@users.noreply.github.com>
Fixed `method_ir_ci` typo in the `abstract_invoke`.
In various packages I am JETing, I see the same error being reported:

> local variable `pp` may be undefined: pp::Base.Process

This patch helps JET proof that there is no actual problem.

Would be kinda nice to see this backported to 1.12 so that if I run JET
with 1.12.4 this is not reported anymore. And of course also to 1.13.
…!` (#60453)

> local variable `msk_d1` may be undefined: msk_d1::UInt64

The code logic was actually right, but by transforming the code, JET can
also see it (and arguably it is now also easier for a human to see that
everything is correct)
As a bonus, also change `T == BigInt` to `T === BigInt`.

Fixes this:
```
│┌ load_artifacts_toml(artifacts_toml::String) @ Artifacts /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/Artifacts/src/Artifacts.jl:315
││┌ load_artifacts_toml(artifacts_toml::String; pkg_uuid::Nothing) @ Artifacts /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/Artifacts/src/Artifacts.jl:317
│││┌ parse_toml(path::String) @ Artifacts /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/Artifacts/src/Artifacts.jl:26
││││┌ parsed_toml(project_file::String) @ Base ./loading.jl:276
│││││┌ parsed_toml(project_file::String, toml_cache::Base.TOMLCache{nothing}, toml_lock::ReentrantLock) @ Base ./loading.jl:278
││││││┌ lock(f::Base.var"#parsed_toml##0#parsed_toml##1"{String, Base.TOMLCache{nothing}}, l::ReentrantLock) @ Base ./lock.jl:335
│││││││┌ (::Base.var"#parsed_toml##0#parsed_toml##1"{String, Base.TOMLCache{nothing}})() @ Base ./loading.jl:281
││││││││┌ Base.CachedTOMLDict(p::Base.TOML.Parser{nothing}, path::String) @ Base ./loading.jl:222
│││││││││┌ parse(l::Base.TOML.Parser{nothing}) @ Base.TOML ./toml_parser.jl:444
││││││││││┌ tryparse(l::Base.TOML.Parser{nothing}) @ Base.TOML ./toml_parser.jl:453
│││││││││││┌ parse_toplevel(l::Base.TOML.Parser{nothing}) @ Base.TOML ./toml_parser.jl:157
││││││││││││┌ parse_array(l::Base.TOML.Parser{nothing}) @ Base.TOML ./toml_parser.jl:719
│││││││││││││┌ getproperty(x::Nothing, f::Symbol) @ Base ./Base_compiler.jl:54
││││││││││││││ invalid builtin function call: getfield(x::Nothing, f::Symbol)
│││││││││││││└────────────────────
```
Help JET (and humans?) understand that src_file and dst_file won't be
used without being defined.

Fixes this JET report:
```
│┌ cp(src::AbstractString, dst::String) @ Base.Filesystem ./file.jl:404
││┌ cp(src::AbstractString, dst::String; force::Bool, follow_symlinks::Bool) @ Base.Filesystem ./file.jl:410
│││┌ kwcall(::@NamedTuple{force::Bool, follow_symlinks::Bool}, ::typeof(Base.Filesystem.cptree), src::String, dst::String) @ Base.Filesystem ./file.jl:366
││││┌ cptree(src::String, dst::String; force::Bool, follow_symlinks::Bool) @ Base.Filesystem ./file.jl:379
│││││┌ sendfile(src::String, dst::String) @ Base.Filesystem ./file.jl:1282
││││││ local variable `src_file` may be undefined: src_file::Base.Filesystem.File
│││││└────────────────────
│││││┌ sendfile(src::String, dst::String) @ Base.Filesystem ./file.jl:1283
││││││ local variable `src_file` may be undefined: src_file::Base.Filesystem.File
│││││└────────────────────
│││││┌ sendfile(src::String, dst::String) @ Base.Filesystem ./file.jl:1285
││││││ local variable `dst_file` may be undefined: dst_file::Base.Filesystem.File
│││││└────────────────────
│││││┌ sendfile(src::String, dst::String) @ Base.Filesystem ./file.jl:1286
││││││ local variable `dst_file` may be undefined: dst_file::Base.Filesystem.File
│││││└────────────────────
```
This is a typo from #58344

(cherry picked from commit d9879e3)
Calls to this method are produced by syntax lowering for simple typed
comprehensions. The current signature is ambiguous, making JET believe
that the modified method could have ended up invoking itself. Resolve
this by renaming the other methods.

These are the the warnings I am seeing while JETing a package:
```
││┌ _array_for(::Type{T}, itr::AbstractVector{T} where T<:NCRingElement, isz::Any) where T @ Base ./array.jl:673
│││┌ _array_for(::Type, itr::Base.SizeUnknown, isz::Any) @ Base ./array.jl:673
││││┌ _similar_shape(itr::Base.SizeUnknown, ::Base.HasLength) @ Base ./array.jl:657
│││││ no matching method found `length(::Base.SizeUnknown)`: length(itr::Base.SizeUnknown)
││││└────────────────────
││││┌ _similar_shape(itr::Base.SizeUnknown, ::Base.HasShape) @ Base ./array.jl:658
│││││┌ axes(A::Base.SizeUnknown) @ Base ./abstractarray.jl:98
││││││ no matching method found `size(::Base.SizeUnknown)`: size(A::Base.SizeUnknown)
│││││└────────────────────
```
and
```
││││││││┌ Base.AnnotatedString(s::String, annots::Any) @ Base ./strings/annotated.jl:107
│││││││││┌ collect(::Type{@NamedTuple{region::UnitRange{Int64}, label::Symbol, value}}, itr::Any) @ Base ./array.jl:641
││││││││││┌ _collect(::Type{@NamedTuple{…}}, itr::Any, isz::Union{Base.HasLength, Base.HasShape}) @ Base ./array.jl:643
│││││││││││┌ _array_for(::Type{@NamedTuple{region::UnitRange{Int64}, label::Symbol, value}}, itr::Base.HasLength, isz::Any) @ Base ./array.jl:673
││││││││││││┌ _similar_shape(itr::Base.HasLength, ::Base.HasLength) @ Base ./array.jl:657
│││││││││││││ no matching method found `length(::Base.HasLength)`: length(itr::Base.HasLength)
││││││││││││└────────────────────
││││││││││││┌ _similar_shape(itr::Base.HasLength, ::Base.HasShape) @ Base ./array.jl:658
│││││││││││││┌ axes(A::Base.HasLength) @ Base ./abstractarray.jl:98
││││││││││││││ no matching method found `size(::Base.HasLength)`: size(A::Base.HasLength)
│││││││││││││└────────────────────
││││││││││││┌ _array_for(::Type{@NamedTuple{region::UnitRange{Int64}, label::Symbol, value}}, itr::Base.HasLength, isz::Nothing) @ Base ./array.jl:673
│││││││││││││ no matching method found `_similar_shape(::Base.HasLength, ::Nothing)`: Base._similar_shape(itr::Base.HasLength, isz::Nothing)
││││││││││││└────────────────────
```

(cherry picked from commit 41c4d97)
libuv reports times in milliseconds, but the Julia docs and show() use units of
1/Sys.SC_CLK_TCK which is 100 on my laptop. The mismatch might be due
to libuv changeset libuv/libuv@37a8aff.

Fixes #53577

(cherry picked from commit 3d611fd)
Dot operators (e.g., .+, .-) are lowered to `BroadcastFunction` and do
not have corresponding function definitions.
Fix the regression by adding the needed wrapper.
Test added.

---------

Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
(cherry picked from commit 7ba24a7)
…60506)

This lead to JET warnings in e.g. `realpath`.

I would say even better would be to avoid this `getproperty` method
altogether. I have an alternative patch which adds a `path(::DirEntry)`
method and changes code in REPL and tests to avoid it.

(cherry picked from commit a4d2129)
fingolfin and others added 2 commits January 8, 2026 14:19
`unpack_platform` might return nothing in case of an error.

Together with PR #60506 and my previous changes, when applied to
release-1.12, the JET report for GAP.jl is now free of reports. Well, if
I filter out certain "unavoidable issues":
```julia
using Revise, JET, AbstractAlgebra, GAP

struct AnyFrameMethod <: ReportMatcher
    m::Union{Function,Method,Symbol}
end

function JET.match_report(matcher::AnyFrameMethod, @nospecialize(report::JET.InferenceErrorReport))
    # check all VirtualFrames in the VirtualStackTrace for a match to the specified method
    m = matcher.m
    if m isa Symbol
        return any(vf -> vf.linfo.def.name === m, report.vst)
    elseif m isa Method
        return any(vf -> vf.linfo.def === m, report.vst)
    else # if m isa Function
        return any(vf -> vf.linfo.def in methods(m), report.vst)
    end
end

report_package(GAP; ignored_modules=[AnyFrameMethod(:is_loaded_directly)])
```

(cherry picked from commit 8123a5c)
(cherry picked from commit a0d9b39)
@KristofferC KristofferC force-pushed the backports-release-1.13 branch from 90cefec to 5abf758 Compare January 8, 2026 13:21
@KristofferC
Copy link
Member Author

@nanosoldier runtests(vs=":release-1.12")

@KristofferC KristofferC merged commit 1ef81a6 into release-1.13 Jan 9, 2026
7 of 8 checks passed
@KristofferC KristofferC deleted the backports-release-1.13 branch January 9, 2026 13:31
@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Report summary

❗ Packages that crashed

50 packages crashed only on the current version.

  • The process was aborted: 38 packages
  • An internal error was encountered: 4 packages
  • An unreachable instruction was executed: 1 packages
  • GC corruption was detected: 1 packages
  • A segmentation fault happened: 6 packages

27 packages crashed on the previous version too.

✖ Packages that failed

755 packages failed only on the current version.

  • Package has syntax issues: 1 packages
  • Package has test failures: 153 packages
  • Package tests unexpectedly errored: 333 packages
  • Package requires a missing binary dependency: 3 packages
  • Package is using an unknown package: 1 packages
  • There were unidentified errors: 134 packages
  • Tests became inactive: 11 packages
  • Test duration exceeded the time limit: 112 packages
  • Test log exceeded the size limit: 7 packages

3327 packages failed on the previous version too.

✔ Packages that passed tests

114 packages passed tests only on the current version.

  • Other: 114 packages

5609 packages passed tests on the previous version too.

➖ Packages that were skipped altogether

39 packages were skipped only on the current version.

  • Package could not be installed: 39 packages

1386 packages were skipped on the previous version too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Release management and versioning.

Projects

None yet

Development

Successfully merging this pull request may close these issues.