-
Notifications
You must be signed in to change notification settings - Fork 80
GTK fails to precompile against master: ccall - type - typevar #573
Comments
Can reproduce, in a fresh project with only
|
Confirming this. Any chance it can be fixed? It's breaking |
I looked at this and found that a couple of functions are declared in
The problem is in the |
I'm not too sure but looking at Gtk's doc the data parameter is typed as https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-source-set-callback Tried it but it doesn't work, |
I tried to come up with a minimal example, as I understand callbacks can be any user defined function, and data can be anything as well so the situation is a bit like this : test(x,y) = begin @show x, y ; true end
call_fun(f, data::T) where T = ccall(f, Bool, (T,), data) # this is our uv_dispatch
funs = [@cfunction(test, Bool, (Int, Int)), @cfunction(test, Bool, (Float64, Float64))]
data = [(1,2), (1.0, 2.0)]
call_fun.(funs, data) But this doesn't work (test prints gibberish instead of the correct values on v1.6), so something must be missing. That said if you define : @generated function call_fun(f, data)
:( ccall(f, Bool, ($(data),), data) )
end Then it works (all Gtk's test pass in v1.8 with this solution). I find this a bit strange because in mind my mind the two Edit : this explains why my example doesn't work : https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/#Type-Parameters |
In
precompile of GTK, GTKReactive and ImageView all fail. Problem started about 3 days ago. Precompile is fine in Julia 1.6.1.
Assuming that GTK is the most fundamental requirement, here is the relevant error output:
The text was updated successfully, but these errors were encountered: