-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hello dear Maintainers,
when trying to use juliac to compile the following small example on MacOS (M4 Mac):
(@main)(ARGS) = begin
s::String = readline(stdin)
println(Core.stdout, s)
return 0
endI encounter the following 2 errors:
◐ Compiling...Verifier error #1: unresolved call from statement Main.readline(Main.stdin::IO)::String
Stacktrace:
[1] main(ARGS::Vector{String})
@ Main ~/Downloads/test_juliac/LSLAppTest/scripts/DataLoadingTest.jl:13
[2] _main(argc::Int32, argv::Ptr{Ptr{Int8}})
@ Main ~/.julia/packages/JuliaC/EFQEY/src/scripts/juliac-buildscript.jl:77
Verifier error #2: unresolved call from statement Main.readline(Main.stdin::IO)::String
Stacktrace:
[1] main(ARGS::Vector{String})
@ Main ~/Downloads/test_juliac/LSLAppTest/scripts/DataLoadingTest.jl:13
[2] _main(argc::Int32, argv::Ptr{Ptr{Int8}})
@ Main ~/.julia/packages/JuliaC/EFQEY/src/scripts/juliac-buildscript.jl:77
Trim verify finished with 2 errors, 0 warnings.
✓ Compiling...
ERROR: Failed to compile scripts/DataLoadingTest.jl
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:44
[2] compile_products(recipe::JuliaC.ImageRecipe)
@ JuliaC ~/.julia/packages/JuliaC/EFQEY/src/compiling.jl:142
[3] _main_cli(args::Vector{String}; io::Base.TTY)
@ JuliaC ~/.julia/packages/JuliaC/EFQEY/src/JuliaC.jl:191
[4] _main_cli(args::Vector{String})
@ JuliaC ~/.julia/packages/JuliaC/EFQEY/src/JuliaC.jl:182
[5] main(ARGS::Vector{String})
@ JuliaC ~/.julia/packages/JuliaC/EFQEY/src/JuliaC.jl:197
[6] _start()
@ Base ./client.jl:556
I was able to find out that Base.stdin seems to be unavailable, and recreating the Base.TTY for the RawFD of 0 did not help (file descriptor for stdin under POSIX, iirc.) as we encounter the following situation:
(@main)(ARGS) = begin
s::String = readline(Base.TTY(Base.RawFD(0)))
println(Core.stdout, s)
return 0
endError:
◐ Compiling...Verifier error #1: unresolved call from statement (Base.var"#readcb_specialized#uv_readcb##0"())(ccall(:jl_value_ptr)::Base.LibuvStream, nread::Any, ccall(:jl_uv_buf_len)::UInt64)::Any
Stacktrace:
[1] uv_readcb(handle::Ptr{Nothing}, nread::Int64, buf::Ptr{Nothing})
@ Base stream.jl:720
It seems to me that parts of libuv are not yet "compileable", would you be able to point me to the reason or give me some pointers on how to read from stdin when using juliac?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels