Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg.test("Cairo") fails for me #148

Closed
ranjanan opened this issue Jun 27, 2016 · 16 comments · Fixed by #292
Closed

Pkg.test("Cairo") fails for me #148

ranjanan opened this issue Jun 27, 2016 · 16 comments · Fixed by #292

Comments

@ranjanan
Copy link

ranjanan commented Jun 27, 2016

Since build is passing, I must be doing something wrong. Help please!

julia> Pkg.test("Cairo")
INFO: Testing Cairo
ERROR: LoadError: UndefVarError: _jl_libcairo not defined
 in CairoImageSurface(::Int64, ::Int64, ::Int32) at /Users/ranjan/.julia/v0.5/Cairo/src/Cairo.jl:168
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:266
 in _start() at ./client.jl:322
while loading /Users/ranjan/.julia/v0.5/Cairo/test/runtests.jl, in expression starting on line 6
==============================================================[ ERROR: Cairo ]===============================================================

failed process: Process(`/Users/ranjan/julia/usr/bin/julia -Cnative -J/Users/ranjan/julia/usr/lib/julia/sys.dylib --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=yes /Users/ranjan/.julia/v0.5/Cairo/test/runtests.jl`, ProcessExited(1)) [1]

=============================================================================================================================================
ERROR: Cairo had test errors
 in #test#49(::Bool, ::Function, ::Array{AbstractString,1}) at ./pkg/entry.jl:694
 in (::Base.Pkg.Entry.#kw##test)(::Array{Any,1}, ::Base.Pkg.Entry.#test, ::Array{AbstractString,1}) at ./null:0
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#test,Tuple{Array{AbstractString,1}}})() at ./pkg/dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#test,Tuple{Array{AbstractString,1}}}, ::String) at ./file.jl:59
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::Array{AbstractString,1}, ::Vararg{Array{AbstractString,1},N}) at ./pkg/dir.jl:31
 in (::Base.Pkg.Dir.#kw##cd)(::Array{Any,1}, ::Base.Pkg.Dir.#cd, ::Function, ::Array{AbstractString,1}, ::Vararg{Array{AbstractString,1},N}) at ./null:0
 in #test#3(::Bool, ::Function, ::String, ::Vararg{String,N}) at ./pkg/pkg.jl:255
 in test(::String, ::Vararg{String,N}) at ./pkg/pkg.jl:255
 in eval(::Module, ::Any) at ./boot.jl:234
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46

versioninfo():

julia> versioninfo()
Julia Version 0.5.0-dev+4956
Commit 861100c* (2016-06-27 16:47 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.4.0)
  CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)
@rsrock
Copy link
Contributor

rsrock commented Aug 10, 2016

I just ran into this myself. A Pkg.build("Cairo") fixed it.

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

I also have the problem "ERROR: LoadError: UndefVarError: _jl_libcairo not defined". OP reports from Mac, I am on Linux. I have done Pkg.checkout("Cairo") followed by Pkg.build("Cairo"), but no difference. The suggestion in #149 to remove Cairo installed in my system would be severe requiring ~600 other applications to be removed.

I believe this issue may be responsible for the failure to test of ImageView which @timholy tried to help me with in julia-users.

Using:

julia> versioninfo()
Julia Version 0.6.0-dev.416
Commit c20a8bc* (2016-08-27 06:57 UTC)
Platform Info:
  System: 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.7.1 (ORCJIT, haswell)

@tkelman
Copy link
Contributor

tkelman commented Aug 27, 2016

Is there a file at Pkg.dir("Cairo","deps","deps.jl") ? If so, what does it say?

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

File /home/colin/.julia/v0.6/Cairo/deps/deps.jl says:

# 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)
    quote const $(esc(libname)) = $path end
end

# Load dependencies

# Load-hooks

I have been checking file Cairo/deps/build.jl, and note that section "System Package Managers" contains a reference to Zypper, but previous experience has indicated that the earlier reference to an existing but truncated AptGet might get preference on my system. If I were to move the Zypper entry to precede the AptGet would that ensure that AptGet entry would be ignored?

I have also been checking the format of the deps aliases for minor differences but all looks ok so far.

@timholy
Copy link
Member

timholy commented Aug 27, 2016

For comparison, on mine the crucial section looks like this:

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

@tkelman
Copy link
Contributor

tkelman commented Aug 27, 2016

What is BinDeps.has_apt ? ref JuliaPackaging/BinDeps.jl@89d4d8d

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

julia> using BinDeps

julia> BinDeps.has_apt
false

Edit: as a side note, calling apt-get -v simply as a test triggers the odd appearance of the openSUSE package manager GUI, which is such a curious oddity on openSUSE.

@tkelman
Copy link
Contributor

tkelman commented Aug 27, 2016

Okay then that old issue with BinDeps thinking opensuse has apt-get should be resolved. If you comment out

Cairo.jl/deps/build.jl

Lines 75 to 84 in 18c5638

provides(Zypper,
@compat Dict(
"libcairo" => cairo,
"libfontconfig" => fontconfig,
"libpango-1.0" => [pango,pangocairo],
"libglib-2.0" => gobject,
"libpng12" => libpng,
"libpixman-1" => pixman,
"gettext" => gettext
))
and do Pkg.build("Cairo"), it should build a local copy from source.

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

OK so did the following:
Commented out the Zypper section as instructed.
Pkg.rm("Cairo") twice, Pkg.add("Cairo"), Pkg.build("Cairo") => build successful but test still fails as above.
Did rm(Pkg.dir("Cairo","deps","usr"); recursive=true) and rm(Pkg.dir("Cairo","deps","src"); recursive=true) then rebuild but again build successful but tests fail same error.
File /home/colin/.julia/v0.6/Cairo/deps/deps.jl no change from above.

@tkelman
Copy link
Contributor

tkelman commented Aug 27, 2016

I did not say to Pkg.rm. That probably removed the modifications to the build script.

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

Oh dear then that is very strange. I go back to my cached Cairo files and find that the modifications I made are still in place. I will start again.

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

Nope, can't seem to get it. Wiped all traces of Cairo from julia and added it back, . Modified the build.jl file and rebuilt. Still the same error. Changed from block comment to series of single line comments to see if I had the block comment wrong but no I had it right (and build complained once when I had the syntax wrong, so we are looking at the same file), build is fine (and goes very quickly) but test still not cooperating.

@tkelman
Copy link
Contributor

tkelman commented Aug 27, 2016

alright then it sounds like this requires trying to debug why bindeps isn't writing any results. I don't have many great suggestions for how to go about that other than adding a bunch of @show calls in various different BinDeps functions.

@colbec
Copy link
Contributor

colbec commented Aug 27, 2016

@tkelman I found the output from the BinDeps.debug("Cairo") quite interesting.
It may not be writing anything because it is satisfied from the system sources?

julia> BinDeps.debug("Cairo")
INFO: Reading build script...
The package declares 1 dependencies.
 - Library Group "cairo"
     - Library "png" (not applicable to this system)
     - Library "pixman" (not applicable to this system)
     - Library "ffi" (not applicable to this system)
     - Library "gettext"
        - Satisfied by:
          - Autotools Build at /home/colin/.julia/v0.6/Cairo/deps/usr/lib64/preloadable_libintl.so
          - Autotools Build at /home/colin/.julia/v0.6/Cairo/deps/usr/lib64/libgettextpo.so
        - Providers:
          - BinDeps.AptGet package gettext (can't provide)
          - BinDeps.Yum package gettext-libs (can't provide)
          - Autotools Build
     - Library "gobject"
        - Satisfied by:
          - System Paths at /usr/lib64/libgobject-2.0.so
        - Providers:
          - BinDeps.AptGet package libglib2.0-0 (can't provide)
          - BinDeps.Yum package glib2 (can't provide)
          - Autotools Build
     - Library "freetype" (not applicable to this system)
     - Library "fontconfig" (not applicable to this system)
     - Library "cairo"
        - Satisfied by:
          - Autotools Build at /home/colin/.julia/v0.6/Cairo/deps/usr/lib64/libcairo.so
          - Autotools Build at /home/colin/.julia/v0.6/Cairo/deps/usr/lib64/libcairo.so.2
          - System Paths at /usr/lib64/libcairo.so
        - Providers:
          - BinDeps.AptGet package libcairo2 (can't provide)
          - BinDeps.Yum package cairo (can't provide)
          - Autotools Build
     - Library "pango"
        - Satisfied by:
          - System Paths at /usr/lib64/libpango-1.0.so
        - Providers:
          - BinDeps.AptGet package libpango1.0-0 (can't provide)
          - BinDeps.Yum package pango (can't provide)
          - Autotools Build
     - Library "pangocairo"
        - Satisfied by:
          - System Paths at /usr/lib64/libpangocairo-1.0.so
        - Providers:
          - BinDeps.AptGet package libpango1.0-0 (can't provide)
          - BinDeps.Yum package pango (can't provide)
          - Autotools Build
     - Library "zlib" (not applicable to this system)

@tkelman
Copy link
Contributor

tkelman commented Aug 27, 2016

Since they're part of a library group, they're supposed to all be provided from the same provider category.

@micahjsmith
Copy link

+1 This was still an issue for me today.

The solution was to brew uninstall -f cairo, Pkg.add("Cairo"), brew install cairo.

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753* (2016-09-19 18:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants