function link_fontconfig()
@debug "Loading Fontconfig backend into Compose.jl"
include(joinpath(@__DIR__, "pango.jl")) # THIS IS THE ATTEMPT 2/2
pango_cairo_ctx[] = C_NULL
ccall((:g_type_init, libgobject), Cvoid, ())
pango_cairo_fm[] = ccall((:pango_cairo_font_map_new, libpangocairo),
Ptr{Cvoid}, ())
pango_cairo_ctx[] = ccall((:pango_font_map_create_context, libpango),
Ptr{Cvoid}, (Ptr{Cvoid},), pango_cairo_fm[])
pangolayout[] = PangoLayout()
end
function link_cairo()
@debug "Loading Cairo backend into Compose.jl"
include(joinpath(@__DIR__,"cairo_backends.jl"))
include(joinpath(@__DIR__,"immerse_backend.jl"))
end
function __init__()
@require Cairo="159f3aea-2a34-519c-b102-8c37f9878175" link_cairo()
# THIS IS THE ATTEMPT 1/2
@require Fontconfig="186bb1d3-e1f7-5a2c-a377-96d770f13627" link_fontconfig()
end
But then this happens (WITHOUT using Revise):
julia> using Cairo, Fontconfig
julia> using Compose
[ Info: Precompiling Compose [a81c6b42-2e10-5240-aca2-a61377ecd94b]
┌ Warning: Error requiring Fontconfig from Compose:
│ TypeError: in ccall: first argument not a pointer or valid constant expression, expected Ptr, got a value of type Tuple{Symbol,String}
│ Stacktrace:
│ [1] link_fontconfig() at /home/dehann/.julia/dev/Compose/src/Compose.jl:162
│ [2] top-level scope at none:1
│ [3] eval at ./boot.jl:331 [inlined]
│ [4] eval at /home/dehann/.julia/dev/Compose/src/Compose.jl:1 [inlined]
│ [5] (::Compose.var"#119#125")() at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:85
│ [6] err(::Any, ::Module, ::String) at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:42
│ [7] (::Compose.var"#118#124")() at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:84
│ [8] withpath(::Any, ::String) at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:32
│ [9] (::Compose.var"#117#123")() at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:83
│ [10] listenpkg(::Any, ::Base.PkgId) at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:15
│ [11] macro expansion at /home/dehann/.julia/packages/Requires/qy6zC/src/require.jl:81 [inlined]
│ [12] __init__() at /home/dehann/.julia/dev/Compose/src/Compose.jl:178
│ [13] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
│ [14] _require_from_serialized(::String) at ./loading.jl:749
│ [15] _require(::Base.PkgId) at ./loading.jl:1040
│ [16] require(::Base.PkgId) at ./loading.jl:928
│ [17] require(::Module, ::Symbol) at ./loading.jl:923
│ [18] eval(::Module, ::Any) at ./boot.jl:331
│ [19] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:134
│ [20] repl_backend_loop(::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:195
│ [21] start_repl_backend(::REPL.REPLBackend, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:180
│ [22] run_repl(::REPL.AbstractREPL, ::Any; backend_on_current_task::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:292
│ [23] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288
│ [24] (::Base.var"#806#808"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:399
│ [25] #invokelatest#1 at ./essentials.jl:710 [inlined]
│ [26] invokelatest at ./essentials.jl:709 [inlined]
│ [27] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:383
│ [28] exec_options(::Base.JLOptions) at ./client.jl:313
│ [29] _start() at ./client.jl:506
└ @ Requires ~/.julia/packages/Requires/qy6zC/src/require.jl:44
For Reference
Pretty sure I'm on the latest packages, and
julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS = 6
Thanks for the detailed investigation! I'm sorry for this annoying warning. I don't think it's hurting anything serious, but I really do need to get to it sometime soon.
Hi -- has anyone seen this before...
The error below does not occur when just doing:
However, there seems to be some difficulty when using Revise (a VSCode default) with Compose + Cairo + Fontconfig:
Attempt to Fix
I had similar-ish problems elsewhere when Requires.jl inputs use a
begin end
block -- i.e. this is "bad":but not when doing include directly:
So I have been changing to this all over (e.g. IncrementalInference.jl 845)
cc @timholy (Hi) since this might relate to timholy/Revise.jl#520
Different Error with Compose
I have been attempting to fix locally by doing the same pattern, but then
ccall
starts having issues. The current@require
code looks like this https://github.com/GiovineItalia/Compose.jl/blob/121510649e9c195545881a824916d6a81580ddc1/src/Compose.jl#L156-L180But when I change to this:
But then this happens (WITHOUT using Revise):
For Reference
Pretty sure I'm on the latest packages, and