julia icon indicating copy to clipboard operation
julia copied to clipboard

Hello world is no longer trimmable in 1.13

Open gbaraldi opened this issue 1 month ago • 2 comments

The JuliaC.jl hello world project is no longer trimmable in 1.13

julia +1.13 --project -m JuliaC --verbose --output-exe app --bundle /tmp/fun --trim=safe --experimental test/AppProject/
Running: setenv(`/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/bin/julia -C native -J/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/lib/julia/sys.dylib -g1 --project=test/AppProject/ -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'`,["TERM_PROGRAM_VERSION=v0.2025.11.19.08.12.stable_06", "WARP_IS_LOCAL_SHELL_SESSION=1", "TERM=xterm-256color", "STARSHIP_SHELL=fish", "STARSHIP_SESSION_KEY=2394616397204192", "USER=gbaraldi", "XPC_FLAGS=0x0", "WARP_USE_SSH_WRAPPER=1", "OPENBLAS_MAIN_FREE=1", "COMMAND_MODE=unix2003", "SHELL=/opt/homebrew/bin/fish", "SHLVL=1", "XPC_SERVICE_NAME=0", "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.SF3Ff42jYg/Listeners", "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0", "JULIA_LOAD_PATH=/var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/jl_RBDOR1:@:@stdlib", "SECURITYSESSIONID=186b8", "LC_CTYPE=UTF-8", "TERM_PROGRAM=WarpTerminal", "PWD=/Users/gbaraldi/.julia/dev/JuliaC", "TMPDIR=/var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/", "JULIA=~/julia/julia", "BIN=~/julia/build", "OPENBLAS_DEFAULT_NUM_THREADS=1", "__CFBundleIdentifier=dev.warp.Warp-Stable", "OMF_CONFIG=/Users/gbaraldi/.config/omf", "JULIA_DEPOT_PATH=/var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/jl_xE9xiy:/Users/gbaraldi/.julia:/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/local/share/julia:/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/share/julia", "LaunchInstanceID=FF5C54FE-99D4-40C8-B5BA-884887B25A01", "HOME=/Users/gbaraldi", "OMF_PATH=/Users/gbaraldi/.local/share/omf", "SSH_SOCKET_DIR=~/.ssh", "OSLogRateLimit=64", "PATH=/Users/gbaraldi/.julia/bin:/Users/gbaraldi/.juliaup/bin:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Applications/Warp.app/Contents/Resources/bin", "COLORTERM=truecolor", "WARP_HONOR_PS1=1", "LOGNAME=gbaraldi"])
┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.12.2). Unexpected behavior may occur.
└ @ ~/.julia/dev/JuliaC/test/AppProject/Manifest.toml:0
Precompiling packages finished.
  1 dependency successfully precompiled in 0 seconds
Precompilation took 0.708712334 s
Running: setenv(`/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/bin/julia -C native -J/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/lib/julia/sys.dylib -g1 --startup-file=no --history-file=no --project=test/AppProject/ --output-o /var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/jl_ggRukD/image.o.a --output-incremental=no --strip-ir --strip-metadata --experimental --trim=safe --experimental /Users/gbaraldi/.julia/dev/JuliaC/src/scripts/juliac-buildscript.jl --scripts-dir /Users/gbaraldi/.julia/dev/JuliaC/src/scripts --source /Users/gbaraldi/.julia/dev/JuliaC/test/AppProject/ --output-exe`,["TERM_PROGRAM_VERSION=v0.2025.11.19.08.12.stable_06", "WARP_IS_LOCAL_SHELL_SESSION=1", "TERM=xterm-256color", "STARSHIP_SHELL=fish", "STARSHIP_SESSION_KEY=2394616397204192", "USER=gbaraldi", "XPC_FLAGS=0x0", "WARP_USE_SSH_WRAPPER=1", "OPENBLAS_MAIN_FREE=1", "COMMAND_MODE=unix2003", "SHELL=/opt/homebrew/bin/fish", "SHLVL=1", "XPC_SERVICE_NAME=0", "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.SF3Ff42jYg/Listeners", "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0", "JULIA_LOAD_PATH=/var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/jl_RBDOR1:@:@stdlib", "SECURITYSESSIONID=186b8", "LC_CTYPE=UTF-8", "TERM_PROGRAM=WarpTerminal", "PWD=/Users/gbaraldi/.julia/dev/JuliaC", "TMPDIR=/var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/", "JULIA=~/julia/julia", "BIN=~/julia/build", "OPENBLAS_DEFAULT_NUM_THREADS=1", "__CFBundleIdentifier=dev.warp.Warp-Stable", "OMF_CONFIG=/Users/gbaraldi/.config/omf", "JULIA_DEPOT_PATH=/var/folders/gy/3x71f89d5399nxchznw315ym0000gn/T/jl_xE9xiy:/Users/gbaraldi/.julia:/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/local/share/julia:/Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/share/julia", "LaunchInstanceID=FF5C54FE-99D4-40C8-B5BA-884887B25A01", "HOME=/Users/gbaraldi", "OMF_PATH=/Users/gbaraldi/.local/share/omf", "SSH_SOCKET_DIR=~/.ssh", "OSLogRateLimit=64", "PATH=/Users/gbaraldi/.julia/bin:/Users/gbaraldi/.juliaup/bin:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Applications/Warp.app/Contents/Resources/bin", "COLORTERM=truecolor", "WARP_HONOR_PS1=1", "LOGNAME=gbaraldi"])
◒ Compiling...φ ()::Any)::Int64: unresolved call from statement Base._str_sizehint(
Stacktrace:
  [1] print_to_string(::String, ::Vararg{Any})
    @ Base strings/io.jl:138
  [2] string(::String, ::Int64)
    @ Base strings/io.jl:184 [inlined]
  [3] prevind(s::String, i::Int64, n::Int64)
    @ Base strings/basic.jl:506
  [4] prevind(s::String, i::Int64)
    @ Base strings/basic.jl:503 [inlined]
  [5] prevind(s::String, i::UInt64)
    @ Base strings/basic.jl:502 [inlined]
  [6] match(re::Regex, str::String, idx::Int64, add_opts::UInt32)
    @ Base regex.jl:441
  [7] match(re::Regex, str::String, idx::Int64)
    @ Base regex.jl:432 [inlined]
  [8] match(r::Regex, s::String)
    @ Base regex.jl:477 [inlined]
  [9] _splitdir_nodrive(a::String, b::String)
    @ Base.Filesystem path.jl:157
 [10] splitdir(path::String)
    @ Base.Filesystem path.jl:151 [inlined]
 [11] dirname(path::String)
    @ Base.Filesystem path.jl:183 [inlined]
 [12] __init__()
    @ libblastrampoline_jll ./libblastrampoline_jll/src/libblastrampoline_jll.jl:58

Verifier error #2: unresolved call from statement Base.print(%new()::IOBuffer, φ ()::Any)::Any
Stacktrace:
  [1] print_to_string(::String, ::Vararg{Any})
    @ Base strings/io.jl:143
  [2] string(::String, ::Int64)
    @ Base strings/io.jl:184 [inlined]
  [3] prevind(s::String, i::Int64, n::Int64)
    @ Base strings/basic.jl:506
  [4] prevind(s::String, i::Int64)
    @ Base strings/basic.jl:503 [inlined]
  [5] prevind(s::String, i::UInt64)
    @ Base strings/basic.jl:502 [inlined]
  [6] match(re::Regex, str::String, idx::Int64, add_opts::UInt32)
    @ Base regex.jl:441
  [7] match(re::Regex, str::String, idx::Int64)
    @ Base regex.jl:432 [inlined]
  [8] match(r::Regex, s::String)
    @ Base regex.jl:477 [inlined]
  [9] _splitdir_nodrive(a::String, b::String)
    @ Base.Filesystem path.jl:157
 [10] splitdir(path::String)
    @ Base.Filesystem path.jl:151 [inlined]
 [11] dirname(path::String)
    @ Base.Filesystem path.jl:183 [inlined]
 [12] __init__()
    @ libblastrampoline_jll ./libblastrampoline_jll/src/libblastrampoline_jll.jl:58

Verifier error #3: unresolved call from statement Base.IOContext(%new()::IOBuffer, Base.stderr::IO)::IOContext{IOBuffer}
Stacktrace:
 [1] wait_forever()
   @ Base task.jl:1173

Verifier error #4: unresolved call from statement Base.write(Base.stderr::IO, Base.IOContext(%new()::IOBuffer, Base.stderr::IO)::IOContext{IOBuffer})::Any
Stacktrace:
 [1] wait_forever()
   @ Base task.jl:1176

Verifier error #5: unresolved call from statement Core.kwcall(%new()::@NamedTuple{backtrace::Bool}, Base.showerror, io::IOContext{IOBuffer}, Base.getfield(Base.memoryrefget(Base.memoryrefnew(Base.getfield(Base.getfield(stack::Base.ExceptionStack, :stack)::Vector{NamedTuple{(:exception, :backtrace)}}, :ref)::MemoryRef{NamedTuple{(:exception, :backtrace)}}, φ ()::Int64, false::Bool)::MemoryRef{NamedTuple{(:exception, :backtrace)}}, :not_atomic, false::Bool)::NamedTuple{(:exception, :backtrace)}, 1)::Any, Base.getfield(Base.memoryrefget(Base.memoryrefnew(Base.getfield(Base.getfield(stack::Base.ExceptionStack, :stack)::Vector{NamedTuple{(:exception, :backtrace)}}, :ref)::MemoryRef{NamedTuple{(:exception, :backtrace)}}, φ ()::Int64, false::Bool)::MemoryRef{NamedTuple{(:exception, :backtrace)}}, :not_atomic, false::Bool)::NamedTuple{(:exception, :backtrace)}, 2)::Any)::Any
Stacktrace:
 [1] show_exception_stack(io::IOContext{IOBuffer}, stack::Base.ExceptionStack)
   @ Base errorshow.jl:1114
 [2] display_error(io::IOContext{IOBuffer}, stack::Base.ExceptionStack)
   @ Base client.jl:110
 [3] wait_forever()
   @ Base task.jl:1175

Verifier error #6: unresolved call from statement (f::Function)(%new()::IOContext{IOBuffer}, Core.getfield(args::Tuple{String}, 1)::String)::Any
Stacktrace:
 [1] with_output_color(f::Function, color::Symbol, io::IOContext{IOBuffer}, args::String; bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool)
   @ Base util.jl:78
 [2] printstyled(io::IOContext{IOBuffer}, msg::String; bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Symbol)
   @ Base util.jl:141 [inlined]
 [3] display_error(io::IOContext{IOBuffer}, stack::Base.ExceptionStack)
   @ Base client.jl:109
 [4] wait_forever()
   @ Base task.jl:1175

Verifier error #7: unresolved call from statement Base.print(io::IOBuffer, φ ()::Any)::Any
Stacktrace:
 [1] print(::IOBuffer, ::String, ::SubString{String}, ::Vararg{Any})
   @ Base strings/io.jl:46
 [2] with_output_color(f::Function, color::Symbol, io::IOContext{IOBuffer}, args::String; bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool)
   @ Base util.jl:110
 [3] printstyled(io::IOContext{IOBuffer}, msg::String; bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Symbol)
   @ Base util.jl:141 [inlined]
 [4] display_error(io::IOContext{IOBuffer}, stack::Base.ExceptionStack)
   @ Base client.jl:109
 [5] wait_forever()
   @ Base task.jl:1175

Verifier error #8: unresolved call from statement (f::Function)(%new()::IOContext{IOBuffer}, Core.getfield(args::Tuple{String}, 1)::String)::Any
Stacktrace:
 [1] with_output_color(f::Function, color::Int64, io::IOContext{IOBuffer}, args::String; bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool)
   @ Base util.jl:78
 [2] printstyled(io::IOContext{IOBuffer}, msg::String; bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Int64)
   @ Base util.jl:141 [inlined]
 [3] display_error(io::IOContext{IOBuffer}, stack::Base.ExceptionStack)
   @ Base client.jl:109
 [4] wait_forever()
   @ Base task.jl:1175

Trim verify finished with 8 errors, 0 warnings.
fatal: error thrown and no exception handler available.
UndefVarError(var=:exit, world=0x0000000000002c48, scope=Base.Compiler)
ijl_undefined_var_error at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/rtutils.c:167
compile_and_emit_native at ./../usr/share/julia/Compiler/src/precompile.jl:421
jfptr_compile_and_emit_native_87286.1 at /Users/gbaraldi/.julia/juliaup/julia-1.13.0-alpha2+0.aarch64.apple.darwin14/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/./julia.h:2275 [inlined]
jl_create_native_impl at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/aotcompile.cpp:723
ijl_create_system_image at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/staticdata.c:3372
ijl_write_compiler_output at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/precompile.c:140
ijl_atexit_hook at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/init.c:279
jl_repl_entrypoint at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-13/src/jlapi.c:1139
✓ Compiling...
ERROR: Failed to compile test/AppProject/
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:44
 [2] compile_products(recipe::JuliaC.ImageRecipe)
   @ JuliaC ~/.julia/dev/JuliaC/src/compiling.jl:146
 [3] _main_cli(args::Vector{String}; io::Base.TTY)
   @ JuliaC ~/.julia/dev/JuliaC/src/JuliaC.jl:179
 [4] _main_cli(args::Vector{String})
   @ JuliaC ~/.julia/dev/JuliaC/src/JuliaC.jl:170
 [5] main(ARGS::Vector{String})
   @ JuliaC ~/.julia/dev/JuliaC/src/JuliaC.jl:185
 [6] _start()
   @ Base ./client.jl:583

I haven't done debugging yet

gbaraldi avatar Dec 05 '25 20:12 gbaraldi

Seems like we need to add this to CI.

ViralBShah avatar Dec 07 '25 17:12 ViralBShah

I think the problem is that we have these things in contrib/juliac but not in the JuliaC package:

wait_forever() = while true; wait(); end
...
setfield!(typeof(print_to_string).name, :max_args, Int32(10), :monotonic)

JeffBezanson avatar Dec 08 '25 21:12 JeffBezanson