Backports for 1.13.0-beta1#60312
Merged
KristofferC merged 30 commits intorelease-1.13from Jan 9, 2026
Merged
Conversation
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)
(cherry picked from commit af36919)
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)
(cherry picked from commit 44ecbcf)
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.
(cherry picked from commit 5ee0816)
(cherry picked from commit 0192801)
#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
│││││└────────────────────
```
(cherry picked from commit 14945c0)
(cherry picked from commit 06ebe6e)
(cherry picked from commit 3b21c7f)
(cherry picked from commit 7450aba)
(cherry picked from commit b6337dd)
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)
`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)
90cefec to
5abf758
Compare
Member
Author
|
@nanosoldier |
Collaborator
|
The package evaluation job you requested has completed - possible new issues were detected. Report summary❗ Packages that crashed50 packages crashed only on the current version.
27 packages crashed on the previous version too. ✖ Packages that failed755 packages failed only on the current version.
3327 packages failed on the previous version too. ✔ Packages that passed tests114 packages passed tests only on the current version.
5609 packages passed tests on the previous version too. ➖ Packages that were skipped altogether39 packages were skipped only on the current version.
1386 packages were skipped on the previous version too. |
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.
No description provided.