Yggdrasil icon indicating copy to clipboard operation
Yggdrasil copied to clipboard

Glib: change product order

Open t-bltg opened this issue 1 year ago • 2 comments

If I'm not mistaken, the product declaration order in build_tarballs.jl seems to determine the load order in __init__ (as in https://github.com/JuliaBinaryWrappers/Glib_jll.jl/blob/main/src/wrappers/x86_64-linux-gnu.jl#L18-L46).

This PR changes the product order so that libglib and others are loaded before libgobject (see the symbol dependency using ldd -r libXXX.so).

Fix https://discourse.julialang.org/t/julia-error-initerror-when-trying-to-use-plots-in-python-via-juliacall/112425, or https://discourse.julialang.org/t/libgobject-2-0-so-0-undefined-symbol-g-dir-unref/112301.

Needed for https://github.com/JuliaPlots/Plots.jl/pull/4914:

Test Summary:            | Pass  Total  Time
Preferences UnicodePlots |    2      2  0.6s
Test Summary:         | Pass  Total  Time
Persistent backend GR |    1      1  0.0s
Test Summary:                   | Pass  Total  Time
Persistent backend UnicodePlots |    1      1  0.0s
ERROR: LoadError: InitError: could not load library "[...]/lib/libgobject-2.0.so"
[...]/648a32a349aac06f19b6bfed47f0b822b4ef28c3/lib/libgobject-2.0.so: undefined symbol: g_dir_unref

t-bltg avatar Apr 06 '24 20:04 t-bltg

I'm moderately sure we sort them alphabetically, because the order is otherwise undefined (the original order is lost serialising/deserialising the data through json into a Dict)

giordano avatar Apr 06 '24 21:04 giordano

Thanks, the missing symbol error is odd, g_dir_unref is provided by libglib: nm -D libglib-2.0.so | grep g_dir_unref.

So I'm failing to understand why dlopening libgobject fails in a precompilation / test context (I can reproduce locally).

t-bltg avatar Apr 06 '24 21:04 t-bltg

What was the conclusion about the ordering here? Do we still want to change this ordering, or does it not matter?

imciner2 avatar Dec 28 '24 00:12 imciner2

Needed for JuliaPlots/Plots.jl#4914:

Looks like that PR was merged long ago, presumably this isn't that needed after all.

giordano avatar Dec 28 '24 00:12 giordano

Well, I'll go ahead and close this then.

imciner2 avatar Dec 28 '24 00:12 imciner2