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

'Incompatible libpangocairo and libcairo' means Cairo cannot load on macOS versions below 12 (Monterey) #362

Closed
anowacki opened this issue Mar 27, 2024 · 5 comments

Comments

@anowacki
Copy link

I am experiencing the following issue when trying to use Cairo on an Intel Mac running macOS 10.15.7 (discovered when trying to use CairoMakie). Essentially it seems like some incompatibility between the shipped libraries libpangocairo and libcairo, both provided as artifacts.

The issue is not present on a Linux machine (x86_64-linux-gnu), or on an Apple Silicon machine running macOS 14.4.

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.2 (2024-03-01)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> activate --temp
  Activating new project at `/var/folders/vb/j8by7pw95vs8nk16dz6_2fmc0000gn/T/jl_70fcuC`

(jl_70fcuC) pkg> add Cairo
   Resolving package versions...
    Updating `/private/var/folders/vb/j8by7pw95vs8nk16dz6_2fmc0000gn/T/jl_70fcuC/Project.toml`
  [159f3aea] + Cairo v1.0.5
    Updating `/private/var/folders/vb/j8by7pw95vs8nk16dz6_2fmc0000gn/T/jl_70fcuC/Manifest.toml`
  [159f3aea] + Cairo v1.0.5
  [3da002f7] + ColorTypes v0.11.4
  [5ae59095] + Colors v0.12.10
  [53c48c17] + FixedPointNumbers v0.8.4
  [a2bd30eb] + Graphics v1.1.2
  [692b3bcd] + JLLWrappers v1.5.0
  [77ba4419] + NaNMath v1.0.2
  [21216c6a] + Preferences v1.4.3
  [189a3867] + Reexport v1.2.2
  [6e34b625] + Bzip2_jll v1.0.8+1
  [83423d85] + Cairo_jll v1.18.0+1
  [2e619515] + Expat_jll v2.5.0+0
  [a3f928ae] + Fontconfig_jll v2.13.93+0
  [d7e528f0] + FreeType2_jll v2.13.1+0
  [559328eb] + FriBidi_jll v1.0.10+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.80.0+0
  [3b182d85] + Graphite2_jll v1.3.14+0
  [2e76f6c2] + HarfBuzz_jll v2.8.1+1
  [1d63c593] + LLVMOpenMP_jll v15.0.7+0
  [dd4b983a] + LZO_jll v2.10.1+0
⌅ [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.7+0
  [7add5ba3] + Libgpg_error_jll v1.42.0+0
  [94ce4f54] + Libiconv_jll v1.17.0+0
  [4b2f31a3] + Libmount_jll v2.39.3+0
  [38a345b3] + Libuuid_jll v2.39.3+1
  [36c8627f] + Pango_jll v1.52.1+0
  [30392449] + Pixman_jll v0.42.2+0
  [02c8fc9c] + XML2_jll v2.12.5+0
  [aed1982a] + XSLT_jll v1.1.34+0
  [4f6342f7] + Xorg_libX11_jll v1.8.6+0
  [0c0b7dd1] + Xorg_libXau_jll v1.0.11+0
  [a3789734] + Xorg_libXdmcp_jll v1.1.4+0
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.1+0
  [c7cfdc94] + Xorg_libxcb_jll v1.15.0+0
  [c5fb5394] + Xorg_xtrans_jll v1.5.0+0
  [b53b4c65] + libpng_jll v1.6.43+1
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.10.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays v1.10.0
  [10745b16] + Statistics v1.10.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.1.0+0
  [deac9b47] + LibCURL_jll v8.4.0+0
  [e37daf67] + LibGit2_jll v1.6.4+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.2+1
  [14a3606d] + MozillaCACerts_jll v2023.1.10
  [4536629a] + OpenBLAS_jll v0.3.23+4
  [05823500] + OpenLibm_jll v0.8.1+2
  [efcefdf7] + PCRE2_jll v10.42.0+1
  [bea87d4a] + SuiteSparse_jll v7.2.1+1
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850b90] + libblastrampoline_jll v5.8.0+1
  [8e850ede] + nghttp2_jll v1.52.0+1
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  ✗ Cairo
  0 dependencies successfully precompiled in 3 seconds. 46 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

Cairo [159f3aea-2a34-519c-b102-8c37f9878175]

Failed to precompile Cairo [159f3aea-2a34-519c-b102-8c37f9878175] to "/Users/user/.julia/compiled/v1.10/Cairo/jl_ZXnQm6".
ERROR: LoadError: InitError: could not load library "/Users/user/.julia/artifacts/80b8948d1fa864a4974c0d4e71ddce9586311598/lib/libpangocairo-1.0.0.dylib"
dlopen(/Users/user/.julia/artifacts/80b8948d1fa864a4974c0d4e71ddce9586311598/lib/libpangocairo-1.0.0.dylib, 1): Library not loaded: @rpath/libcairo.2.dylib
  Referenced from: /Users/user/.julia/artifacts/80b8948d1fa864a4974c0d4e71ddce9586311598/lib/libpangocairo-1.0.0.dylib
  Reason: Incompatible library version: libpangocairo-1.0.0.dylib requires version 11603.0.0 or later, but libcairo.2.dylib provides version 2.0.0
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:116
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined]
  [4] __init__()
    @ Pango_jll ~/.julia/packages/Pango_jll/ovus2/src/wrappers/x86_64-apple-darwin.jl:22
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [11] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [12] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [14] macro expansion
    @ ./loading.jl:1790 [inlined]
 [15] macro expansion
    @ ./lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [17] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [18] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [20] include
    @ ./Base.jl:495 [inlined]
 [21] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2222
 [22] top-level scope
    @ stdin:3
during initialization of module Pango_jll
in expression starting at /Users/user/.julia/packages/Cairo/smWIA/src/Cairo.jl:1
in expression starting at stdin:

julia> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 24 × Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, ivybridge)
Threads: 1 default, 0 interactive, 1 GC (on 24 virtual cores)
Environment:
  JULIA_MAX_NUM_PRECOMPILE_FILES = 20
  JULIA_EDITOR = subl -nw
  JULIA_PKG_PRESERVE_TIERED_INSTALLED = true

I can successfully add Pango_jll and Cairo_jll directly, but it is only when Cairo tries to load the libraries that the issue arises.

@mxhbl
Copy link

mxhbl commented Apr 18, 2024

I was able to resolve this by manually downgrading Cairo_jll to version 1.16.1. Running

add Cairo_jll@1.16.1
add Cairo

works for me.
I'm not sure which version of Cairo_jll is the latest that is still compatible with Pango_jll. I'm on macOS 11.7.10 on a 2019 Intel MacBook.

@giordano
Copy link
Contributor

giordano commented Apr 18, 2024

The issue is not present [...] on an Apple Silicon machine running macOS 14.4.

I believe you don't see anything on macOS 12+ because of https://github.com/giordano/macos-compatibility-version. If you upgrade your macOS version to 12 or later, you won't have any error at all.

@giordano
Copy link
Contributor

giordano commented Apr 18, 2024

For what is worth, this should be fixed by JuliaPackaging/Yggdrasil#8497 (PR in General just merged: JuliaRegistries/General#105194): if you upgrade Pango_jll to v1.52.2 you get a version which shouldn't crash with any compatible version of Cairo_jll. In principle I'd mark previous versions of Pango_jll as incompatible with Cairo_jll@1.18 in the registry, but this error is raised only for a small number of users (only those on sufficiently old macOS versions) that restricting the compatibility for all users, causing possible issues when resolving environments to many of them, makes me a bit hesitant.

@mxhbl
Copy link

mxhbl commented Apr 19, 2024

Awesome, I can confirm that the issue is fixed on my system.

@anowacki
Copy link
Author

Thanks, @giordano, and I agree with your approach about leaving compat. If there were more people using macOS < 12 we would have heard more about it.

I don't think a @JuliaGraphics maintainer has looked at this, but if anyone does, they can choose to repoen this if needed.

@anowacki anowacki changed the title 'Incompatible libpangocairo and libcairo' means Cairo cannot load on macOS 'Incompatible libpangocairo and libcairo' means Cairo cannot load on macOS versions below 12 (Monterey) Apr 19, 2024
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

No branches or pull requests

3 participants