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

Assume you guys know Cairo won't build on 0.7 #239

Closed
lewisl opened this issue Aug 13, 2018 · 20 comments · Fixed by #292
Closed

Assume you guys know Cairo won't build on 0.7 #239

lewisl opened this issue Aug 13, 2018 · 20 comments · Fixed by #292

Comments

@lewisl
Copy link

lewisl commented Aug 13, 2018

Messages from Pkg.build() for Cairo:

Building Cairo ───────────→ `~/.julia/packages/Cairo/NBtbd/deps/build.log`
┌ Error: Error building `Cairo`: 
│ ┌ Warning: Deprecated syntax `assignment inside [ ]`.
│ └ @ none:0
│ ┌ Warning: `is_apple` is deprecated, use `Sys.isapple` instead.
│ │   caller = top-level scope at none:0
│ └ @ Core none:0
│ ┌ Warning: `is_linux` is deprecated, use `Sys.islinux` instead.
│ │   caller = xx(::String, ::Vararg{String,N} where N) at build.jl:109
│ └ @ Main ~/.julia/packages/Cairo/NBtbd/deps/build.jl:109
│ ┌ Warning: `is_linux` is deprecated, use `Sys.islinux` instead.
│ │   caller = top-level scope at none:0
│ └ @ Core none:0
│ ┌ Warning: `is_apple` is deprecated, use `Sys.isapple` instead.
│ │   caller = top-level scope at none:0
│ └ @ Core none:0
│ ┌ Warning: `similar(a::AbstractDict)` is deprecated, use `empty(a)` instead.
│ │   caller = adjust_env(::Dict{AbstractString,AbstractString}) at BinDeps.jl:388
│ └ @ BinDeps ~/.julia/packages/BinDeps/Z6fwm/src/BinDeps.jl:388
│ ┌ Warning: `replace(s::AbstractString, pat, f)` is deprecated, use `replace(s, pat => f)` instead.
│ │   caller = top-level scope at none:0
│ └ @ Core none:0
│ ┌ Warning: `replace(s::AbstractString, pat, f)` is deprecated, use `replace(s, pat => f)` instead.
│ │   caller = top-level scope at none:0
│ └ @ Core none:0
│ ERROR: LoadError: Provider Homebrew.HB failed to satisfy dependency pangocairo
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /Users/lewis/.julia/packages/BinDeps/Z6fwm/src/dependencies.jl:945
│  [3] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at /Users/lewis/.julia/packages/BinDeps/Z6fwm/src/dependencies.jl:910
│  [4] satisfy!(::BinDeps.LibraryGroup) at /Users/lewis/.julia/packages/BinDeps/Z6fwm/src/dependencies.jl:874
│  [5] top-level scope at /Users/lewis/.julia/packages/BinDeps/Z6fwm/src/dependencies.jl:977
│  [6] include at ./boot.jl:317 [inlined]
│  [7] include_relative(::Module, ::String) at ./loading.jl:1038
│  [8] include(::Module, ::String) at ./sysimg.jl:29
│  [9] include(::String) at ./client.jl:398
│  [10] top-level scope at none:0
│ in expression starting at /Users/lewis/.julia/packages/Cairo/NBtbd/deps/build.jl:161
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1068
@tknopp
Copy link
Contributor

tknopp commented Aug 13, 2018

yes that is #230

workaround:

using Homebrew
Homebrew.brew(`reinstall fontconfig`)
Pkg.build("Cairo")

@carmagnole
Copy link

using Homebrew
Homebrew.brew(reinstall fontconfig)
Pkg.build("Cairo")

did not work.
Homebrew.brew(`reinstall fontconfig`)
gives an error in Julia 0.7.

==> Reinstalling staticfloat/juliatranslated/fontconfig
==> Downloading https://homebrew.bintray.com/bottles/fontconfig-2.12.6.high_sierra.bottle.tar.gz
Already downloaded: /Users/ZY/Library/Caches/Homebrew.jl/fontconfig-2.12.6.high_sierra.bottle.tar.gz
==> Pouring fontconfig-2.12.6.high_sierra.bottle.tar.gz
==> Regenerating font cache, this may take a while
==> /Users/ZY/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/fontconfig/2.12.6/bin/fc-cache -f
Last 15 lines from /Users/ZY/Library/Logs/Homebrew/fontconfig/post_install.01.fc-cache:
caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/misc: /usr/share/fonts/misc: failed to write cache
caching, new cache contents: 89 fonts, 0 dirs
/usr/share/fonts/util: /usr/share/fonts/util: failed to write cache
caching, new cache contents: 0 fonts, 0 dirs
/System/Library/Fonts: caching, new cache contents: 337 fonts, 0 dirs
/Library/Fonts: caching, new cache contents: 450 fonts, 0 dirs
/Users/ZY/Library/Fonts: caching, new cache contents: 45 fonts, 0 dirs
/System/Library/Assets/com_apple_MobileAsset_Font3: skipping, no such directory
/Users/ZY/.local/share/fonts: skipping, no such directory
/Users/ZY/.fonts: skipping, no such directory
/usr/local/var/cache/fontconfig: not cleaning unwritable cache directory
/Users/ZY/.cache/fontconfig: not cleaning unwritable cache directory
/Users/ZY/.fontconfig: not cleaning non-existent cache directory
/Users/ZY/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/fontconfig/2.12.6/bin/fc-cache: failed
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall staticfloat/juliatranslated/fontconfig`
==> Summary
🍺  /Users/ZY/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/fontconfig/2.12.6: 493 files, 3.2MB
ERROR: failed process: Process(`/Users/ZY/.julia/packages/Homebrew/l8kUw/deps/usr/bin/brew reinstall fontconfig`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:712 [inlined]
 [3] #run#509(::Bool, ::Function, ::Cmd) at ./process.jl:670
 [4] run at ./process.jl:668 [inlined]
 [5] #brew#4(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::Cmd) at /Users/ZY/.julia/packages/Homebrew/l8kUw/src/API.jl:19
 [6] brew(::Cmd) at /Users/ZY/.julia/packages/Homebrew/l8kUw/src/API.jl:11
 [7] top-level scope at none:0

@lewisl
Copy link
Author

lewisl commented Aug 17, 2018

Cairo continually fails on missing dependency pangocairo. What is that?

using Homebrew

julia> Homebrew.brew(`reinstall fontconfig`)
==> Reinstalling fontconfig 
==> Installing dependencies for fontconfig: pkg-config
==> Installing fontconfig dependency: pkg-config
==> Downloading https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/Users/lewis/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/
==> make
==> make check
==> make install
🍺  /Users/lewis/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/pkg-config/0.29.2: 11 files, 627.2KB, built in 3 minutes 7 seconds
==> Installing fontconfig
==> Downloading https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.
Already downloaded: /Users/lewis/Library/Caches/Homebrew.jl/fontconfig-2.13.0.tar.bz2
==> ./configure --disable-silent-rules --enable-static --with-add-fonts=/System/Libra
==> make install RUN_FC_CACHE_TEST=false
==> Not running post_install as we're building a bottle
You can run it manually using `brew postinstall fontconfig`
Error: Cannot link fontconfig
Another version is already linked: /Users/lewis/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/fontconfig/2.13.0
ERROR: failed process: Process(`/Users/lewis/.julia/packages/Homebrew/l8kUw/deps/usr/bin/brew reinstall fontconfig`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:712 [inlined]
 [3] #run#509(::Bool, ::Function, ::Cmd) at ./process.jl:670
 [4] run at ./process.jl:668 [inlined]
 [5] #brew#4(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::Cmd) at /Users/lewis/.julia/packages/Homebrew/l8kUw/src/API.jl:19
 [6] brew(::Cmd) at /Users/lewis/.julia/packages/Homebrew/l8kUw/src/API.jl:11
 [7] top-level scope at none:0

julia> Homebrew.brew(`postinstall fontconfig`)
==> Postinstalling fontconfig
==> Regenerating font cache, this may take a while
==> /Users/lewis/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/fontconfig/2.13.0/bin
Process(`/Users/lewis/.julia/packages/Homebrew/l8kUw/deps/usr/bin/brew postinstall fontconfig`, ProcessExited(0))

julia> Pkg.build("Cairo")
  Building LibCURL ─→ `~/.julia/packages/LibCURL/Qs5og/deps/build.log`
  Building WinRPM ──→ `~/.julia/packages/WinRPM/rDDZz/deps/build.log`
  Building Homebrew → `~/.julia/packages/Homebrew/l8kUw/deps/build.log`
  Building Cairo ───→ `~/.julia/packages/Cairo/blE1h/deps/build.log`
┌ Error: Error building `Cairo`: 
│ ERROR: LoadError: Provider Homebrew.HB failed to satisfy dependency pangocairo
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /Users/lewis/.julia/packages/BinDeps/ZEval/src/dependencies.jl:945
│  [3] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at /Users/lewis/.julia/packages/BinDeps/ZEval/src/dependencies.jl:910
│  [4] satisfy!(::BinDeps.LibraryGroup) at /Users/lewis/.julia/packages/BinDeps/ZEval/src/dependencies.jl:874
│  [5] top-level scope at /Users/lewis/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
│  [6] include at ./boot.jl:317 [inlined]
│  [7] include_relative(::Module, ::String) at ./loading.jl:1038
│  [8] include(::Module, ::String) at ./sysimg.jl:29
│  [9] include(::String) at ./client.jl:398
│  [10] top-level scope at none:0
│ in expression starting at /Users/lewis/.julia/packages/Cairo/blE1h/deps/build.jl:162
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1068

@cormullion
Copy link
Member

Yes, Cairo is broken on v1.0 as well... I nuked my entire Julia v1.0 installation and tried a clean reinstall, but nothing works, the workaround used to work, but now doesn't. Same error too. We'll have to wait until someone knowledgeable enough decides that Cairo.jl is worth fixing... :)

@lewisl
Copy link
Author

lewisl commented Aug 18, 2018

Can we get Cairo.jl to use a separate, correct installation of the Cairo libraries? I believe that what fails are the installation of various dependencies. I have installed these via the independent Homebrew, not the captive Julia won. Do you know how to force the build to use these? That must involve bindeps, but I don't know how to get bindeps to use externally installed dependencies.

@lewisl lewisl closed this as completed Aug 18, 2018
@lewisl lewisl reopened this Aug 18, 2018
@cormullion
Copy link
Member

No idea, sorry, that's way over my head. Have you considered trying older versions of Cairo/Homebrew rather than the latest ones? Because Cairo used to work on v0.7 and v1.0 last week, so some combination of libraries must have worked once...

@tknopp
Copy link
Contributor

tknopp commented Aug 18, 2018

this is strange. I just tried it locally here and it just worked.

@tknopp
Copy link
Contributor

tknopp commented Aug 18, 2018

@lewisl @cormullion: Have you tried this on a "fresh" Julia installation? By "fresh" I mean that you have removed .julia/packages/Homebrew and .julia/packages/Cairo. Make also sure that none of these packages is located in .julia/packages.

@cormullion
Copy link
Member

Yes, I nuked everything I could find in ~/.julia (apart from v0.3/, v0.4/, v0.5/, and v0.6/) - I doubt whether Donald Trump and Kim Jong-Un could have done it better... :)

I see the ERROR: LoadError: Provider Homebrew.HB failed to satisfy dependency pangocairo, then after trying the so-called workaround, I get: Error: Cannot link fontconfig, another version is already linked.

@tknopp
Copy link
Contributor

tknopp commented Aug 18, 2018

are you on High Sierra (OS X)?

@cormullion
Copy link
Member

yes. no going back...

@lewisl
Copy link
Author

lewisl commented Aug 18, 2018 via email

@lewisl
Copy link
Author

lewisl commented Aug 18, 2018 via email

@tknopp
Copy link
Contributor

tknopp commented Aug 18, 2018

in Cairo/deps/you can create a deps.jl file that looks like this

# This is an auto-generated file; do not edit and do not check-in to version control
  
# Pre-hooks

if VERSION >= v"0.7.0-DEV.3382"
    using Libdl
end
# Macro to load a library
macro checked_lib(libname, path)
    if Libdl.dlopen_e(path) == C_NULL
        error("Unable to load \n\n$libname ($path)\n\nPlease ",
              "re-run Pkg.build(package), and restart Julia.")
    end
    quote
        const $(esc(libname)) = $path
    end
end

# Load dependencies
@checked_lib _jl_libgobject "/Users/knopp/.julia/packages/Homebrew/l8kUw/deps/usr/lib/libgobject-2.0.dylib"
@checked_lib _jl_libcairo "/Users/knopp/.julia/packages/Homebrew/l8kUw/deps/usr/lib/libcairo.dylib"
@checked_lib _jl_libpango "/Users/knopp/.julia/packages/Homebrew/l8kUw/deps/usr/lib/libpango-1.0.dylib"
@checked_lib _jl_libpangocairo "/Users/knopp/.julia/packages/Homebrew/l8kUw/deps/usr/lib/libpangocairo-1.0.dylib"

# Load-hooks
function __init__()
    ENV["PANGO_SYSCONFDIR"] = joinpath("/Users/knopp/.julia/packages/Homebrew/l8kUw/deps/usr", "etc")
end

Then you just have to change the _jl_lib* paths to point to your system homebrew.

@cormullion
Copy link
Member

will try this tomorrow... had enough for today 😊

@lewisl
Copy link
Author

lewisl commented Aug 18, 2018 via email

@lewisl
Copy link
Author

lewisl commented Aug 18, 2018 via email

@lewisl
Copy link
Author

lewisl commented Aug 18, 2018 via email

@cormullion
Copy link
Member

Success, thanks to your brilliant suggestion, @tknopp! Creating a Cairo/deps/deps.jl file like this works. For the 'load dependencies' pathnames I raided the contents of the deps file from Julia v0.6:

# Load dependencies
@checked_lib _jl_libgobject "/Users/me/.julia/v0.6/Homebrew/deps/usr/lib/libgobject-2.0.dylib"
@checked_lib _jl_libcairo "/Users/me/.julia/v0.6/Homebrew/deps/usr/lib/libcairo.dylib"
@checked_lib _jl_libpango "/Users/me/.julia/v0.6/Homebrew/deps/usr/lib/libpango-1.0.dylib"
@checked_lib _jl_libpangocairo "/Users/me/.julia/v0.6/Homebrew/deps/usr/lib/libpangocairo-1.0.dylib"

So I'm probably stuck using older versions of something, but at least I can get a few things done.

@affans
Copy link

affans commented Aug 22, 2018

I think the problem might be even simpler for some people. I simply had to do

shell> brew install graphite2
==> Downloading https://homebrew.bintray.com/bottles/g
###########                                           ######################################################################## 100.0%
==> Pouring graphite2-1.3.12.high_sierra.bottle.tar.gz
🍺  /Users/abmlab/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/graphite2/1.3.12: 18 files, 236KB

See my progress:
#230 (comment)

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.

5 participants