I’m trying to build an image of a simple web project. The project is present as a package in the global list of packages and also is located my dev
path. But getting stable error:
./build_native.jl
[ Info: Copying system image: /Users/.julia/packages/PackageCompiler/CJQcs/sysimg/backup/native/sys.dylib to /Applications/Julia-1.2.app/Contents/Resources/julia/lib/julia/sys.dylib
Julia program file:
"/Users/.julia/dev/JWebImageDemo/run.jl"
C program file:
"/Users/.julia/packages/PackageCompiler/CJQcs/examples/program.c"
Build directory:
"/Users/.julia/dev/JWebImageDemo/build"
4.508057 seconds (11.03 M allocations: 607.603 MiB, 8.55% gc time)
Test Summary: | Pass Total
JWebImageDemo.jl | 1 1
[ Info: used 294 out of 295 precompile statements
ERROR: LoadError: LoadError: LoadError: LoadError: UndefVarError: uv_jl_connectioncb not defined
Stacktrace:
[1] #trylisten#14 at /Applications/Julia-1.2.app/Contents/Resources/julia/share/julia/stdlib/v1.2/Sockets/src/Sockets.jl:543 [inlined]
[2] trylisten at /Applications/Julia-1.2.app/Contents/Resources/julia/share/julia/stdlib/v1.2/Sockets/src/Sockets.jl:542 [inlined]
[3] #listen#13 at /Applications/Julia-1.2.app/Contents/Resources/julia/share/julia/stdlib/v1.2/Sockets/src/Sockets.jl:521 [inlined]
[4] #listen at ./none:0 [inlined]
[5] #listen#8(::Int64, ::typeof(listen), ::Sockets.InetAddr{IPv4}) at /Applications/Julia-1.2.app/Contents/Resources/julia/share/julia/stdlib/v1.2/Sockets/src/Sockets.jl:491
[6] listen at /Applications/Julia-1.2.app/Contents/Resources/julia/share/julia/stdlib/v1.2/Sockets/src/Sockets.jl:489 [inlined]
[7] #start#1(::IPv4, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Bukdu.start), ::Int64) at /Users/.julia/packages/Bukdu/FNxUN/src/server.jl:24
[8] (::getfield(Bukdu, Symbol("#kw##start")))(::NamedTuple{(:host,),Tuple{IPv4}}, ::typeof(Bukdu.start), ::Int64) at ./none:0
[9] top-level scope at /Users/.julia/dev/JWebImageDemo/src/server.jl:72
[10] include at ./boot.jl:328 [inlined]
[11] include_relative(::Module, ::String) at ./loading.jl:1094
[12] include(::Module, ::String) at ./Base.jl:31
[13] include(::String) at ./client.jl:431
[14] top-level scope at /Users/.julia/dev/JWebImageDemo/run.jl:3
[15] include at ./boot.jl:328 [inlined]
[16] include_relative(::Module, ::String) at ./loading.jl:1094
[17] include(::Module, ::String) at ./Base.jl:31
[18] top-level scope at /Users/.julia/dev/JWebImageDemo/build/julia_main.jl:1
[19] include at ./boot.jl:328 [inlined]
[20] include_relative(::Module, ::String) at ./loading.jl:1094
[21] include at ./Base.jl:31 [inlined]
[22] include(::String) at /Users/.julia/packages/PackageCompiler/CJQcs/sysimg/run_julia_code.jl:8
[23] top-level scope at /Users/.julia/packages/PackageCompiler/CJQcs/sysimg/run_julia_code.jl:10
[24] include at ./boot.jl:328 [inlined]
[25] include_relative(::Module, ::String) at ./loading.jl:1094
[26] include(::Module, ::String) at ./Base.jl:31
[27] exec_options(::Base.JLOptions) at ./client.jl:295
[28] _start() at ./client.jl:464
in expression starting at /Users/.julia/dev/JWebImageDemo/src/server.jl:72
in expression starting at /Users/.julia/dev/JWebImageDemo/run.jl:3
in expression starting at /Users/.julia/dev/JWebImageDemo/build/julia_main.jl:1
in expression starting at /Users/.julia/packages/PackageCompiler/CJQcs/sysimg/run_julia_code.jl:10
ERROR: LoadError: failed process: Process(`/Applications/Julia-1.2.app/Contents/Resources/julia/bin/julia --output-o=run.a --track-allocation=none --code-coverage=none --history-file=yes --inline=yes --math-mode=ieee --project=@. --compile=yes --track-allocation=none --sysimage-native-code=yes --sysimage=/Applications/Julia-1.2.app/Contents/Resources/julia/lib/julia/sys.dylib --compiled-modules=yes --optimize=2 /Users/.julia/packages/PackageCompiler/CJQcs/sysimg/run_julia_code.jl`, ProcessExited(1)) [1]
The project which I’m running is - https://github.com/rssdev10/JWebImageDemo.jl - just a simple demo.
I have entry point run.jl
. And for that file I have prepared the build script:
#!/usr/bin/env julia --project=@.
using PackageCompiler
# Or if you simply want to get a native system image e.g. when you have downloaded the generic Julia install:
force_native_image!()
# Build an executable
build_executable(
"run.jl", # Julia script containing a `julia_main` function, e.g. like `examples/hello.jl`
snoopfile = "test/runtests.jl", # Julia script which calls functions that you want to make sure to have precompiled [optional]
builddir = "build" # that's where the compiled artifacts will end up [optional]
)
# Build a shared library
build_shared_lib("run.jl")
For now I’m not getting where to search the issue. The mentioned file https://github.com/JuliaLang/julia/blob/master/stdlib/Sockets/src/Sockets.jl contains uv_jl_connectioncb
initialization. And the only reason I see, why it might be unavailable, __init__()
doesn’t work when PackageCompiler runs the code. libuv
I also have explicitly installed. So, what might be the reason of the failure? Is it my mistake? Or PackageCompiler? Or Julia? Or Sockets?