JuliaGraphics / Cairo.jl

Bindings to the Cairo graphics library.
Other
87 stars 56 forks source link

Test of Cairo fails on v 0.7 - no method matching validate_cairo_version #187

Closed colbec closed 5 years ago

colbec commented 7 years ago

After the edits to build.jl suggested by @eielsen in https://github.com/JuliaGraphics/Cairo.jl/issues/185

julia> versioninfo()
Julia Version 0.7.0-DEV.26
Commit 9beece6e99 (2017-05-04 22:45 UTC)
Platform Info:
  OS: Linux (x86_64-suse-linux)
  CPU: Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

Cairo builds but test fails with:

julia> Pkg.build("Cairo")
INFO: Building Cairo

julia> Pkg.test("Cairo")
INFO: Computing test dependencies for Cairo...
INFO: Installing BaseTestNext v0.2.2
INFO: Testing Cairo

(process:11714): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:11714): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(process:11714): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:11714): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(process:11714): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:11714): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

and the test process hangs and only stops with Ctrl+c.

julia> using BinDeps; BinDeps.debug("Cairo")
INFO: Reading build script...
The package declares 1 dependencies.
 - Library Group "cairo"ERROR: MethodError: no method matching validate_cairo_version(::String, ::Ptr{Void})
The applicable method may be too new: running in world age 21786, while current world is 21792.
Closest candidates are:
  validate_cairo_version(::Any, ::Any) at /home/colin/.julia/v0.7/Cairo/deps/build.jl:9 (method too new to be called from this world context.)
Stacktrace:
 [1] #_find_library#50(::Type{T} where T, ::Function, ::BinDeps.LibraryDependency) at /home/colin/.julia/v0.7/BinDeps/src/dependencies.jl:522
 [2] next(::Base.Generator{Array{BinDeps.LibraryDependency,1},BinDeps.##53#54}, ::Int64) at ./generator.jl:45
 [3] collect_to!(::Array{Tuple{BinDeps.LibraryDependency,Array{Any,1}},1}, ::Base.Generator{Array{BinDeps.LibraryDependency,1},BinDeps.##53#54}, ::Int64, ::Int64) at ./array.jl:462
 [4] collect(::Base.Generator{Array{BinDeps.LibraryDependency,1},BinDeps.##53#54}) at ./array.jl:430
 [5] allf at /home/colin/.julia/v0.7/BinDeps/src/dependencies.jl:665 [inlined]
 [6] show(::Base.TTY, ::BinDeps.LibraryGroup) at /home/colin/.julia/v0.7/BinDeps/src/debug.jl:32
 [7] debug(::Base.TTY, ::String) at /home/colin/.julia/v0.7/BinDeps/src/debug.jl:62
 [8] debug(::String) at /home/colin/.julia/v0.7/BinDeps/src/debug.jl:65
lobingera commented 7 years ago

Sigh

lobingera commented 7 years ago

I've seen something similar very early in experiments with julia (~2013) which was a mismatch between different versions of one library loaded by different BinDeps build scripts. Just to confirm, close julia, start and do Pkg.test("Cairo") as the first. And please list Pkg.status()

colbec commented 7 years ago
julia7
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.26 (2017-05-04 22:45 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 9beece6e99 (0 days old master)
|__/                   |  x86_64-suse-linux

julia> Pkg.test("Cairo")
INFO: Computing test dependencies for Cairo...
INFO: Installing BaseTestNext v0.2.2
INFO: Testing Cairo

(process:14598): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:14598): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(process:14598): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:14598): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(process:14598): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:14598): GLib-GObject-CRITICAL **: /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

^C
signal (2): Interrupt
while loading /home/colin/.julia/v0.7/Cairo/test/runtests.jl, in expression starting on line 15
pthread_cond_wait at /lib64/libpthread.so.0 (unknown line)
g_cond_wait at /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/glib/gthread-posix.c:748
g_once_init_enter at /home/colin/.julia/v0.7/Cairo/deps/src/glib-2.34.3/glib/gthread.c:682
pango_font_map_get_type at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pango-fontmap.c:33
pango_cairo_font_map_get_type at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fontmap.c:40
pango_cairo_fc_font_map_get_type at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fcfontmap.c:83
pango_cairo_font_map_new at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fontmap.c:74
pango_cairo_font_map_get_default at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fontmap.c:154
pango_cairo_create_context at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pangocairo-context.c:419
pango_cairo_create_layout at /home/colin/.julia/v0.7/Cairo/deps/src/pango-1.32.6/pango/pangocairo-context.c:455
Type at /home/colin/.julia/v0.7/Cairo/src/Cairo.jl:442
macro expansion at /home/colin/.julia/v0.7/Cairo/test/runtests.jl:20 [inlined]
macro expansion at ./test.jl:856 [inlined]
anonymous at ./<missing> (unknown line)
jl_call_fptr_internal at /home/colin/Downloads/julia7/src/julia_internal.h:337 [inlined]
jl_call_method_internal at /home/colin/Downloads/julia7/src/julia_internal.h:356 [inlined]
jl_toplevel_eval_flex at /home/colin/Downloads/julia7/src/toplevel.c:587
jl_parse_eval_all at /home/colin/Downloads/julia7/src/ast.c:873
jl_load at /home/colin/Downloads/julia7/src/toplevel.c:614
include_from_node1 at ./loading.jl:552
unknown function (ip: 0x7f2de45bf7db)
jl_call_fptr_internal at /home/colin/Downloads/julia7/src/julia_internal.h:337 [inlined]
jl_call_method_internal at /home/colin/Downloads/julia7/src/julia_internal.h:356 [inlined]
jl_apply_generic at /home/colin/Downloads/julia7/src/gf.c:1930
include at ./sysimg.jl:14
unknown function (ip: 0x7f2de4452b0b)
jl_call_fptr_internal at /home/colin/Downloads/julia7/src/julia_internal.h:337 [inlined]
jl_call_method_internal at /home/colin/Downloads/julia7/src/julia_internal.h:356 [inlined]
jl_apply_generic at /home/colin/Downloads/julia7/src/gf.c:1930
process_options at ./client.jl:305
_start at ./client.jl:371
unknown function (ip: 0x7f2de45cb0c8)
jl_call_fptr_internal at /home/colin/Downloads/julia7/src/julia_internal.h:337 [inlined]
jl_call_method_internal at /home/colin/Downloads/julia7/src/julia_internal.h:356 [inlined]
jl_apply_generic at /home/colin/Downloads/julia7/src/gf.c:1930
jl_apply at /home/colin/Downloads/julia7/ui/../src/julia.h:1422 [inlined]
true_main at /home/colin/Downloads/julia7/ui/repl.c:127
main at /home/colin/Downloads/julia7/ui/repl.c:264
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x401738)
unknown function (ip: 0xffffffffffffffff)
Allocations: 1861298 (Pool: 1859955; Big: 1343); GC: 1
================================[ ERROR: Cairo ]================================

InterruptException:

================================================================================
INFO: Removing BaseTestNext v0.2.2
ERROR: Cairo had test errors

julia> Pkg.status()
5 required packages:
 - CUDAnative                    0.2.0
 - Cairo                         0.3.0              63352a59 (dirty)
 - DataFrames                    0.9.1
 - Images                        0.9.1
 - PyPlot                        2.3.1
55 additional packages:
 - AxisAlgorithms                0.1.6
 - AxisArrays                    0.1.2
 - BinDeps                       0.4.7
 - CUDAdrv                       0.3.0
 - Calculus                      0.2.2
 - CatIndices                    0.0.2
 - ColorTypes                    0.4.1
 - ColorVectorSpace              0.4.2
 - Colors                        0.7.3
 - Compat                        0.24.0
 - ComputationalResources        0.0.2
 - Conda                         0.5.3
 - CoordinateTransformations     0.4.1
 - CustomUnitRanges              0.0.4
 - DataArrays                    0.5.0
 - DataStructures                0.5.3
 - DualNumbers                   0.3.0
 - FFTViews                      0.0.2
 - FileIO                        0.3.1
 - FixedPointNumbers             0.3.7
 - GZip                          0.3.0
 - Graphics                      0.2.0
 - ImageAxes                     0.2.1
 - ImageCore                     0.3.0
 - ImageFiltering                0.1.4
 - ImageMetadata                 0.2.3
 - ImageTransformations          0.2.2
 - IndirectArrays                0.1.1
 - Interpolations                0.6.1
 - IntervalSets                  0.0.5
 - Iterators                     0.3.1
 - JSON                          0.10.0
 - LLVM                          0.3.3
 - LaTeXStrings                  0.2.1
 - MacroTools                    0.3.6
 - MappedArrays                  0.0.7
 - NaNMath                       0.2.4
 - OffsetArrays                  0.3.0
 - PyCall                        1.12.0
 - RangeArrays                   0.1.2
 - Ratios                        0.0.4
 - Reexport                      0.0.3
 - Rotations                     0.5.0
 - SHA                           0.3.2
 - SIUnits                       0.1.0
 - ShowItLikeYouBuildIt          0.0.1
 - SimpleTraits                  0.5.0
 - SortingAlgorithms             0.1.1
 - SpecialFunctions              0.1.1
 - StaticArrays                  0.5.0
 - StatsBase                     0.14.1
 - TexExtensions                 0.0.3
 - TiledIteration                0.0.2
 - URIParser                     0.1.8
 - WoodburyMatrices              0.2.2
lobingera commented 7 years ago

Thanks for your info in https://github.com/JuliaLang/BinDeps.jl/issues/281#issuecomment-299501441

The last thing you could check now is, what BinDeps creates in deps.jl i.e.


shell> cat ~/.julia/v0.5/Cairo/deps/deps.jl
# This is an auto-generated file; do not edit

# Pre-hooks

# Macro to load a library
macro checked_lib(libname, path)
    ((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
    quote const $(esc(libname)) = $path end
end

# Load dependencies
@checked_lib _jl_libgobject "/usr/lib/x86_64-linux-gnu/libgobject-2.0.so"
@checked_lib _jl_libpango "/usr/lib/x86_64-linux-gnu/libpango-1.0.so"
@checked_lib _jl_libpangocairo "/usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so"
@checked_lib _jl_libcairo "/usr/lib/x86_64-linux-gnu/libcairo.so"

# Load-hooks
colbec commented 7 years ago
> cat .julia/v0.7/Cairo/deps/deps.jl 
# This is an auto-generated file; do not edit

# Pre-hooks

# Macro to load a library
macro checked_lib(libname, path)
    ((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
    quote const $(esc(libname)) = $path end
end

# Load dependencies
@checked_lib _jl_libgobject "/home/colin/.julia/v0.7/Cairo/deps/usr/lib64/libgobject-2.0.so"
@checked_lib _jl_libcairo "/home/colin/.julia/v0.7/Cairo/deps/usr/lib64/libcairo.so"
@checked_lib _jl_libpango "/home/colin/.julia/v0.7/Cairo/deps/usr/lib64/libpango-1.0.so"
@checked_lib _jl_libpangocairo "/home/colin/.julia/v0.7/Cairo/deps/usr/lib64/libpangocairo-1.0.so"

# Load-hooks
lobingera commented 7 years ago
  1. To me it looks like BinDeps decided to let the 4 libraries built locally (/home/colin/.julia/v0.7/Cairo/deps/usr/ etc.) while the system libraries seem to be available.

  2. from the trace i see something in pangocairo happens, might be a missing font, might be some other dependency which causes the infinite wait.

  3. In a similar situation i hardcoded the path to the 4 libs in Cairo/deps/deps.jl, in your case this would be replacing the local installations with

/usr/lib64/libgobject-2.0.so /usr/lib64/libcairo.so /usr/lib64/libpango-1.0.so /usr/lib64/libpangocairo-1.0.so

  1. Even, if this works then, you'll have the problem that with every update or Pkg.build call this setting would come back.
  2. I'm 90% sure it's a BinDeps issue triggered by the missing gettext while the libraries that will be ccalled are actually system-wide available.
patrikreiske commented 6 years ago

This problem persists and since it's pretty annoying I just wanted to ask if there's any ambition to fix this.

lobingera commented 6 years ago

@patrikreiske Do you have an idea how fix and test this (because i haven't)? btw: what version of julia and linux OS are you running, and could you please copy the fail log here?

patrikreiske commented 6 years ago

Neither have I. Sadly I probably won't have any time to do investigation on this problem.

I'm running openSUSE Tumbleweed from which's repositories I installed Julia.

julia> versioninfo()
Julia Version 0.6.2
Commit d386e40 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-suse-linux)
  CPU: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH Sandybridge)
  LAPACK: libopenblas_openmp.so.0
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, ivybridge)
julia> Pkg.test("Cairo")
INFO: Testing Cairo

(process:19006): GLib-GObject-CRITICAL **: /home/patrik/.julia/v0.6/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()

(process:19006): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed                                                                                                            

(process:19006): GLib-GObject-CRITICAL **: /home/patrik/.julia/v0.6/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()                                           

(process:19006): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed                                                                                                            

(process:19006): GLib-GObject-CRITICAL **: /home/patrik/.julia/v0.6/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()                                           

(process:19006): GLib-GObject-CRITICAL **: /home/patrik/.julia/v0.6/Cairo/deps/src/glib-2.34.3/gobject/gtype.c:2720: You forgot to call g_type_init()                                           
^C                                                                                                                                                                                              
signal (2): Interrupt                                                                                                                                                                           
while loading /home/patrik/.julia/v0.6/Cairo/test/runtests.jl, in expression starting on line 11                                                                                                
pthread_cond_wait at /lib64/libpthread.so.0 (unknown line)                                                                                                                                      
g_cond_wait at /home/patrik/.julia/v0.6/Cairo/deps/src/glib-2.34.3/glib/gthread-posix.c:748                                                                                                     
g_once_init_enter at /home/patrik/.julia/v0.6/Cairo/deps/src/glib-2.34.3/glib/gthread.c:682                                                                                                     
pango_font_map_get_type at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pango-fontmap.c:33                                                                                        
pango_cairo_font_map_get_type at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fontmap.c:40
pango_cairo_fc_font_map_get_type at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fcfontmap.c:83
pango_cairo_font_map_new at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fontmap.c:74
pango_cairo_font_map_get_default at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pangocairo-fontmap.c:154
pango_cairo_create_context at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pangocairo-context.c:419
pango_cairo_create_layout at /home/patrik/.julia/v0.6/Cairo/deps/src/pango-1.32.6/pango/pangocairo-context.c:455
Type at /home/patrik/.julia/v0.6/Cairo/src/Cairo.jl:519
macro expansion at /home/patrik/.julia/v0.6/Cairo/test/runtests.jl:16 [inlined]
macro expansion at ./test.jl:860 [inlined]
anonymous at ./<missing> (unknown line)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:358 [inlined]
jl_toplevel_eval_flex at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/toplevel.c:589
jl_parse_eval_all at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/ast.c:873
jl_load at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/toplevel.c:616
include_from_node1 at ./loading.jl:576
unknown function (ip: 0x7f493f07f64b)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/gf.c:1926
include at ./sysimg.jl:14
unknown function (ip: 0x7f493ef0cbab)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/gf.c:1926
process_options at ./client.jl:305
_start at ./client.jl:371
unknown function (ip: 0x7f493f08e758)
jl_call_fptr_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/abuild/rpmbuild/BUILD/julia-0.6.2/src/gf.c:1926
jl_apply at /home/abuild/rpmbuild/BUILD/julia-0.6.2/ui/../src/julia.h:1424 [inlined]
true_main at /home/abuild/rpmbuild/BUILD/julia-0.6.2/ui/repl.c:127
main at /home/abuild/rpmbuild/BUILD/julia-0.6.2/ui/repl.c:264
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x401689)
unknown function (ip: 0xffffffffffffffff)
Allocations: 2346569 (Pool: 2345378; Big: 1191); GC: 2
========================================================================================[ ERROR: Cairo ]========================================================================================

InterruptException:

================================================================================================================================================================================================
ERROR: Cairo had test errors
lobingera commented 6 years ago

I think this is a different problem from the original - which was 0.7 version check and tied to BinDeps. Is this an empty, fresh started julia session?

patrikreiske commented 6 years ago

Yes, it is.