docker-library / julia

Docker Official Image packaging for julia

Home Page:http://julialang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plots.jl precompile failed in Alpine's docker image. (But work in Debian image)

sppmg opened this issue · comments

commented

Hi
I am new to Julia, so just report it.

add Plots work in Debian image bookworm but not in Alpine (3.18)

For note, test by 1.9.3-alpine and 1.9.3-bookworm, and host OS is Debian GNU/Linux 11 (bullseye).

Thanks.

# in package mode: ] add Plots
# .......

  ✗ Plots
  ✗ Plots  UnitfulExt
  97 dependencies successfully precompiled in 62 seconds. 7 already precompiled.
  33 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages
  
julia> import Pkg; Pkg.precompile()
Precompiling project...
  Progress [========================================>]  33/33
  ✗ Fontconfig_jll
  ✗ XSLT_jll
  ✗ Gettext_jll
  ✗ Wayland_jll
  ✗ Glib_jll
  ✗ Xorg_libxcb_jll
  ✗ Xorg_xcb_util_jll
  ✗ Xorg_libX11_jll
  ✗ Fontconfig_jll
  ✗ XSLT_jll
  ✗ Gettext_jll
  ✗ Wayland_jll
  ✗ Glib_jll
  ✗ Xorg_libxcb_jll
  ✗ Xorg_xcb_util_jll
  ✗ Xorg_libX11_jll
  ✗ Xorg_xcb_util_image_jll
  ✗ Xorg_xcb_util_keysyms_jll
  ✗ Xorg_xcb_util_renderutil_jll
  ✗ Xorg_xcb_util_wm_jll
  ✗ Xorg_libXrender_jll
  ✗ Xorg_libXext_jll
  ✗ Xorg_libXfixes_jll
  ✗ Xorg_libxkbfile_jll
  ✗ Xorg_libXcursor_jll
  ✗ Xorg_xkbcomp_jll
  ✗ Xorg_libXi_jll
  ✗ Libglvnd_jll
  ✗ Xorg_libXinerama_jll
  ✗ Xorg_libXrandr_jll
  ✗ Cairo_jll
  ✗ HarfBuzz_jll
  ✗ Xorg_xkeyboard_config_jll
  ✗ GLFW_jll
  ✗ libass_jll
  ✗ FFMPEG_jll
  ✗ FFMPEG
  ✗ xkbcommon_jll
  ✗ Qt6Base_jll
  ✗ Plots
  ✗ Plots  UnitfulExt
  0 dependencies successfully precompiled in 49 seconds. 137 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to "/root/.julia/compiled/v1.9/Plots/jl_jBCFll".
ERROR: LoadError: InitError: could not load library "/root/.julia/artifacts/b53f05b910a25dc167faf1eda3ff4254d595bc4a/lib/libfreetype.so"
Error loading shared library libbz2.so.1.0: No such file or directory (needed by /root/.julia/artifacts/b53f05b910a25dc167faf1eda3ff4254d595bc4a/lib/libfreetype.so)
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:116
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined]
  [4] __init__()
    @ FreeType2_jll ~/.julia/packages/FreeType2_jll/OxMYp/src/wrappers/x86_64-linux-musl.jl:10
  [5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1115
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1506
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1783
  [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
 [10] macro expansion
    @ ./loading.jl:1648 [inlined]
 [11] macro expansion
    @ ./lock.jl:267 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
 [13] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [14] top-level scope
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl:192
 [15] include
    @ ./Base.jl:457 [inlined]
 [16] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2049
 [17] top-level scope
    @ stdin:3
during initialization of module FreeType2_jll
in expression starting at /root/.julia/packages/libass_jll/SaaQW/src/wrappers/x86_64-linux-musl.jl:4
in expression starting at /root/.julia/packages/libass_jll/SaaQW/src/libass_jll.jl:2
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile libass_jll [0ac62f75-1d6f-5e53-bd7c-93b484bb37c0] to "/root/.julia/compiled/v1.9/libass_jll/jl_GHDdld".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2300
  [3] compilecache
    @ ./loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [10] top-level scope
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl:192
 [11] include
    @ ./Base.jl:457 [inlined]
 [12] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2049
 [13] top-level scope
    @ stdin:3
in expression starting at /root/.julia/packages/FFMPEG_jll/OCtN5/src/wrappers/x86_64-linux-musl.jl:4
in expression starting at /root/.julia/packages/FFMPEG_jll/OCtN5/src/FFMPEG_jll.jl:2
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile FFMPEG_jll [b22a6f82-2f65-5046-a5b2-351ab43fb4e5] to "/root/.julia/compiled/v1.9/FFMPEG_jll/jl_ekIFaM".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2300
  [3] compilecache
    @ ./loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] include
    @ ./Base.jl:457 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2049
 [11] top-level scope
    @ stdin:3
in expression starting at /root/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to "/root/.julia/compiled/v1.9/FFMPEG/jl_KJEhFH".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2300
  [3] compilecache
    @ ./loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [10] include(x::String)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/Plots.jl:1
 [11] top-level scope
    @ ~/.julia/packages/Plots/sxUvK/src/Plots.jl:168
 [12] include
    @ ./Base.jl:457 [inlined]
 [13] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2049
 [14] top-level scope
    @ stdin:3
in expression starting at /root/.julia/packages/Plots/sxUvK/src/animation.jl:1
in expression starting at /root/.julia/packages/Plots/sxUvK/src/Plots.jl:1
in expression starting at stdin:3
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /usr/local/julia/share/julia/stdlib/v1.9/Pkg/src/Types.jl:69
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:1581
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
 [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [5] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:171
 [6] precompile()
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.9/Pkg/src/API.jl:162
 [7] top-level scope
   @ REPL[5]:1

julia> 

Probably related :

Error loading shared library libbz2.so.1.0: No such file or directory (needed by /root/.julia/artifacts/b53f05b910a25dc167faf1eda3ff4254d595bc4a/lib/libfreetype.so)

The problem is here; you are missing OS library dependencies. Using https://pkgs.alpinelinux.org/contents to search for the lib, I only find libbz2.so.1 and libbz2.so.1.0.8 (https://pkgs.alpinelinux.org/contents?file=libbz2.so.1*&path=&name=&branch=v3.18&arch=x86_64). Assuming the library is compatible, I installed libbz2 and made a symlink to libbz2.so.1.0. Then it needed libxml2.so.2, so I installed the package that provides it (and so on for the next lib libmount.so.1). But then I came to libffi.so.6, but there is no Alpine package providing .6, only .8 (and this I doubt is compatible).

So, conclusion is that Plot is likely not compatible for Alpine 3.18 and needs updated dependencies somewhere:

ERROR: LoadError: InitError: could not load library "/root/.julia/artifacts/c1ba2270edd3508a3f44b307e484911cf0bcfbee/lib/libgio-2.0.so"
Error loading shared library libffi.so.6: No such file or directory (needed by /root/.julia/artifacts/c1ba2270edd3508a3f44b307e484911cf0bcfbee/lib/libgobject-2.0.so.0)

These were the packages added and symlink created:

$ apk add --no-cache libbz2 gnu-libiconv-libs libxml2 libmount
...
$ cd /usr/lib
$ ln -s libbz2.so.1 libbz2.so.1.0
commented

Thanks your help

@ImreSamu

Yes, look like it's same issue. I saw it, but because it about musl and log in file, so I just ignored, sorry.

@yosifkit

I saw libbz2.so.1.0 message too, but not sure it's because OS/library in docker or julia package. Because I see there is Bzip2_jll package. (and Xorg_lib* etc.) I don't know what is difference between julia package and OS package.

The libbz2.so.1.0 referenced would need to come from the OS (if the Julia package does include it, it would very likely be linked against the wrong version of libc for use in Alpine anyhow, which would also probably exhibit in the error message shown, so this is either a problem with that specific Julia package or a problem of missing OS level deps).