JuliaGraphics / Cairo.jl

Bindings to the Cairo graphics library.
Other
86 stars 57 forks source link

Cannot build Cairo.jl on macOS Mojave #271

Closed ronisbr closed 5 years ago

ronisbr commented 5 years ago

Hi guys!

I am trying to build Cairo.jl on macOS Mojave (clean Julia installation) and I am getting the following error:

┌ Error: Error building `Cairo`:
│ ==> Installing graphite2 from staticfloat/juliatranslated
│ ==> Downloading https://homebrew.bintray.com/bottles/graphite2-1.3.13.mojave.bottle.tar.gz
│ Already downloaded: /Users/ronan.arraes/Library/Caches/Homebrew.jl/downloads/36f9054572b26853c4726b48a48041476190c6e2069d088be488bd9489445ade--graphite2-1.3.13.mojave.bottle.tar.gz
│ ==> Pouring graphite2-1.3.13.mojave.bottle.tar.gz
│ 🍺  /Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr/Cellar/graphite2/1.3.13: 18 files, 232.2KB
│ Warning: Already linked: /Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr/Cellar/graphite2/1.3.13
│ ==> Installing gettext from staticfloat/juliatranslated
│ ==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.mojave.bottle.tar.gz
│ Already downloaded: /Users/ronan.arraes/Library/Caches/Homebrew.jl/downloads/20fb183d8882abab5874937646456a6d73fcd3510ec65a0b2a54fdfeb0174519--gettext-0.19.8.1.mojave.bottle.tar.gz
│ ==> Pouring gettext-0.19.8.1.mojave.bottle.tar.gz
│ ==> Caveats
│ gettext is keg-only, which means it was not symlinked into /Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr,
│ because macOS provides the BSD gettext library & some software gets confused if both are in the library path.
│
│ If you need to have gettext first in your PATH run:
│   echo 'export PATH="/Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr/opt/gettext/bin:$PATH"' >> ~/.zshrc
│
│ For compilers to find gettext you may need to set:
│   export LDFLAGS="-L/Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr/opt/gettext/lib"
│   export CPPFLAGS="-I/Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr/opt/gettext/include"
│
│ ==> Summary
│ 🍺  /Users/ronan.arraes/.julia/packages/Homebrew/s09IX/deps/usr/Cellar/gettext/0.19.8.1: 1,935 files, 16.9MB
│
│ signal (11): Segmentation fault: 11
│ in expression starting at /Users/ronan.arraes/.julia/packages/Cairo/CXPG1/deps/build.jl:165
│ _platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)
│ Allocations: 20714313 (Pool: 20711314; Big: 2999); GC: 46
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075

Trying to build manually Cairo leads to:

julia> Pkg.build("Cairo")
  Building LibCURL ─→ `~/.julia/packages/LibCURL/OoXMv/deps/build.log`
  Building WinRPM ──→ `~/.julia/packages/WinRPM/Y9QdZ/deps/build.log`
  Building Homebrew → `~/.julia/packages/Homebrew/s09IX/deps/build.log`
  Building Cairo ───→ `~/.julia/packages/Cairo/CXPG1/deps/build.log`
┌ Error: Error building `Cairo`:
│
│ signal (11): Segmentation fault: 11
│ in expression starting at /Users/ronan.arraes/.julia/packages/Cairo/CXPG1/deps/build.jl:165
│ _platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)
│ Allocations: 19803997 (Pool: 19801167; Big: 2830); GC: 44
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
asinghvi17 commented 5 years ago

Maybe, I haven't dived too deep into Homebrew :)

Have you tried master?

]add Cairo#master

there seems to be a fix there.

albep commented 5 years ago

I had the same issue (segmentation fault: 11, when building Cairo.jl). I followed the instructions in the previous posts - and I switched to glib 2.58.3 - but now I get another error ERROR: LoadError: Provider Homebrew.HB failed to satisfy dependency pangocairo.

Can anyone help to fix this?

julia> Homebrew.brew(info glib) glib: stable 2.60.2 Core application library for C https://developer.gnome.org/glib/ /Users/albep/.julia/packages/Homebrew/s09IX/deps/usr/Cellar/glib/2.58.3 (451 files, 18.8MB) * Built from source on 2019-05-09 at 15:01:44 /Users/albep/.julia/packages/Homebrew/s09IX/deps/usr/Cellar/glib/2.60.2 (429 files, 15.2MB) Poured from bottle on 2019-05-09 at 11:44:36 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/glib.rb ==> Dependencies Build: meson ✔, ninja ✔, pkg-config ✔ Required: gettext ✔, libffi ✔, pcre ✔, python ✔ Process(/Users/albep/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew info glib`, ProcessExited(0))

(v1.0) pkg> build Cairo Building LibCURL ─→ ~/.julia/packages/LibCURL/khRkY/deps/build.log Building WinRPM ──→ ~/.julia/packages/WinRPM/Y9QdZ/deps/build.log Building Homebrew → ~/.julia/packages/Homebrew/s09IX/deps/build.log Building Cairo ───→ ~/.julia/packages/Cairo/CXPG1/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/albep/.julia/packages/BinDeps/ZEval/src/dependencies.jl:945 │ [3] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at /Users/albep/.julia/packages/BinDeps/ZEval/src/dependencies.jl:910 │ [4] satisfy!(::BinDeps.LibraryGroup) at /Users/albep/.julia/packages/BinDeps/ZEval/src/dependencies.jl:874 │ [5] top-level scope at /Users/albep/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977 │ [6] include at ./boot.jl:317 [inlined] │ [7] include_relative(::Module, ::String) at ./loading.jl:1044 │ [8] include(::Module, ::String) at ./sysimg.jl:29 │ [9] include(::String) at ./client.jl:392 │ [10] top-level scope at none:0 │ in expression starting at /Users/albep/.julia/packages/Cairo/CXPG1/deps/build.jl:165 └ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1097 `

CiaranOMara commented 5 years ago

I was able to get Cairo to build after a system level brew update, and brew upgrade. The upgrade happenned to touch glib.

$ ~ brew update
$ ~ brew upgrade

...

==> Upgrading glib 
==> Downloading https://homebrew.bintray.com/bottles/glib-2.60.2.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/19/1969b4088e0235f81bdd6fc846f0f990008d07122728b2e927a0af71b6edf56d?__gda__=exp=1557477454~hmac=8c9a278e51740dd7d827fd02dc2e22fb3a0f776564cc72d1dfb33cc406cac5ee&response-c
######################################################################## 100.0%
==> Pouring glib-2.60.2.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/glib/2.60.2: 429 files, 15.2MB
Removing: /usr/local/Cellar/glib/2.60.0_1... (432 files, 15.3MB)
ronisbr commented 5 years ago

I tried here and it did not work. Are you using master?

pwaver commented 5 years ago

With glib 2.60.2 I get

julia> Pkg.build("Cairo") Building LibCURL ─→ ~/.julia/packages/LibCURL/khRkY/deps/build.log Building WinRPM ──→ ~/.julia/packages/WinRPM/Y9QdZ/deps/build.log Building Homebrew → ~/.julia/packages/Homebrew/s09IX/deps/build.log Building Cairo ───→ ~/.julia/packages/Cairo/p68X8/deps/build.log ┌ Error: Error building Cairo: │ WARNING: redefining constant DEBIAN_VERSION_REGEX │ WARNING: redefining constant have_sonames │ WARNING: redefining constant sonames │ WARNING: redefining constant EXTENSIONS │ │ signal (11): Segmentation fault: 11 │ in expression starting at /Users/billb/.julia/packages/Cairo/p68X8/deps/build.jl:176 │ _platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)

CiaranOMara commented 5 years ago

@ronisbr, I'm using the latest tagged release.

dognotdog commented 5 years ago

After no success with pinning glib to 2.58.3, but after seeing https://github.com/JuliaPackaging/BinDeps.jl/issues/397, I unlinked pango from the system homebrew as well, and succeeded in building Cairo! My system pango version was 1.42.4_1.

It looks as though the actual plot results in garbage, with pango giving errors like

(process:29772): Pango-WARNING **: 17:38:12.972: pango_layout_set_markup_with_accel: Error on line 1 char 17: Invalid UTF-8 encoded text in name — not valid “6.5×10\xe2”

but at least its progress.

jonathanBieler commented 5 years ago

@dognotdog I also get this kind of errors sometimes (when using % in labels) but the plots look fine.

dognotdog commented 5 years ago

@dognotdog I also get this kind of errors sometimes (when using % in labels) but the plots look fine.

Thanks, I've just figured out that that was not the source of the plots being garbage, it was just that I specified weird ranges on log scales and that seems to have dislocated everything in weird ways.

So unlinking the system brew pango did end up getting me a working system.

v-a-s-a commented 5 years ago

For what its worth. I was seeing the same segfault on MacOS Mojave 10.14.4:

(v1.1) pkg> build Cairo
  Building LibCURL ─→ `~/.julia/packages/LibCURL/teHPG/deps/build.log`
  Building WinRPM ──→ `~/.julia/packages/WinRPM/Y9QdZ/deps/build.log`
  Building Homebrew → `~/.julia/packages/Homebrew/s09IX/deps/build.log`
  Building Cairo ───→ `~/.julia/packages/Cairo/CXPG1/deps/build.log`
┌ Error: Error building `Cairo`:
│
│ signal (11): Segmentation fault: 11
│ in expression starting at /Users/vasa/.julia/packages/Cairo/CXPG1/deps/build.jl:165
│ _platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)
│ Allocations: 19330551 (Pool: 19327763; Big: 2788); GC: 43
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075

With the following package versions:

  [159f3aea] Cairo v0.5.6
  [d9be37ee] Homebrew v0.7.1

and Julia:

Julia Version 1.1.1
Commit 55e36cc (2019-05-16 04:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

and glib:

shell> brew info glib
/usr/local/Cellar/glib/2.58.3 (451 files, 18.8MB)
  Built from source on 2019-06-04 at 13:42:25
/usr/local/Cellar/glib/2.60.3 (429 files, 15.3MB) *
  Poured from bottle on 2019-06-04 at 07:21:36
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/glib.rb

Downgrading to glib 2.58.3 allowed me to successfully build Cairo. This done via @Animadversio 's comment above:

Homebrew.brew(`install --verbose --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/05871cb0394f78ef25a5c1c071456d0f1e4be4fe/Formula/glib.rb`)
axsk commented 5 years ago

I can't get it to run either, seems related.

First I got some errors from Homebrew.jl that it can't install glib because its (quite outdated) version of Homebrew couldn't cope with the uses_from_macos directive in glib's brew script. Trying to downgrad glib, as suggested above, gave the same error. After fiddling around and updating Julias Homebrew.jl, building Cairo just segfaulted.

Back to stock Homebrew.jl I tried unlinking glib and indeed I got further. The current output of build Cairo is:

checking for LIBFFI... no
│ configure: error: Package requirements (libffi >= 3.0.0) were not met:
│
│ No package 'libffi' found

Giving up for now :(

cormullion commented 5 years ago

@axsk This error looks to have been introduced recently (this month?), because Travis now fails to build Cairo on macOS.

jonathanBieler commented 5 years ago

I'm also getting this on macOS Sierra, it's the same error message as this 2013 issue:

https://github.com/JuliaGraphics/Cairo.jl/issues/30#issuecomment-23041559

cormullion commented 5 years ago

I recently had this error when I tried to use Cairo on Nextjournal, apparently it's a fairly common issue, even on Linux.

ronisbr commented 5 years ago

Yeah, it is now failing due to libffi here also. Any updates?

dpsanders commented 5 years ago

I'm trying to fix glib on Mojave but get the following error:

julia> Homebrew.brew(`install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/05871cb0394f78ef25a5c1c071456d0f1e4be4fe/Formula/glib.rb`)
######################################################################## 100.0%
Error: gtk-doc: undefined method `uses_from_macos' for #<Class:0x00007f957015e610>
ERROR: failed process: Process(`/Users/dpsanders/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/05871cb0394f78ef25a5c1c071456d0f1e4be4fe/Formula/glib.rb`, ProcessExited(1)) [1]
mirestrepo commented 5 years ago

@dpsanders I ran into that issue too. That's because, Julia's Homebrew is older. Here is what fixed the glib issue for me

pkg> rm Homebrew
shell> brew unlink glib
shell> brew install -verbose --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/05871cb0394f78ef25a5c1c071456d0f1e4be4fe/Formula/glib.rb

That got past the glib issue, but then it failed with the libffi ... I haven't been able to get past that one yet

dpsanders commented 5 years ago

@mirestrepo That seems (?) to have solved the glib problem, thanks! But now I'm getting the libffi error.

I tried

dpsanders@Davids-MBP-9 ~> brew reinstall libffi
==> Reinstalling libffi
==> Downloading https://homebrew.bintray.com/bottles/libffi-3.2.1.mojave.bottle.
######################################################################## 100.0%
==> Pouring libffi-3.2.1.mojave.bottle.tar.gz
==> Caveats
libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find libffi you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/libffi/lib"

For pkg-config to find libffi you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/libffi/lib/pkgconfig"

so I did that line to set PKG_CONFIG_PATH. If you do that from the same terminal that you launch Julia from, it has the correct address:

julia> ENV["PKG_CONFIG_PATH"]
"/usr/local/opt/libffi/lib/pkgconfig"

But this information does not seem to be being passed to the Cairo configure.

Does somebody with better Unix etc. skills know how to get this information over?

jonas-schulze commented 5 years ago

@dpsanders @mirestrepo Homebrew.jl has since been updated (see https://github.com/JuliaPackaging/Homebrew.jl/pull/259), maybe you can try its #master version once again. I still get the segfaulting failures, though.

montyvesselinov commented 5 years ago

I was able to resolve this problem by resetting Homebrew.jl

/Users/user/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew update-reset
/Users/user/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew config 
/Users/user/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew install cairo

after that you need really remove Cairo.jl (rm -fR Cairo) and add it again.

This is not a Cairo.jl problem in some ways. Homebrew.jl gets corrupted and nothing works until it is fixed. Therefore, Cairo.jl has to detect corrupted Homebrew.jl and fix it.

Also maybe Homebrew.jl should be rebuilding itself if there are issues.

dpsanders commented 5 years ago

When I try @montyvesselinov's suggestion, I still get

dpsanders@31-36-71 ~/.j/p/H/s/d/u/bin (stable)> ./brew install cairo
Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespaceee94a588c18de246f0e47aa7250b0d14::Glib:Class
jonas-schulze commented 5 years ago

@dpsanders please try ] add Homebrew#master first, as I mentioned above.

Unfortunately, montyvesselinov's suggestion didn't work for me.

dpsanders commented 5 years ago

I did try master of Homebrew first; still no luck.

dpsanders commented 5 years ago

I removed Cairo and Homebrew and added master branches of both; still get

┌ Error: Error building `Cairo`, showing the last 100 of log:
│ checking whether we are using the GNU C Library 2.1 or newer... no

[snip]

 checking for LIBFFI... no
│ configure: error: Package requirements (libffi >= 3.0.0) were not met:
│
│ No package 'libffi' found
│
│ Consider adjusting the PKG_CONFIG_PATH environment variable if you
│ installed software in a non-standard prefix.
dpsanders commented 5 years ago

Hmm, I am on Mojave 10.14 instead of 10.14.3, and when I try @mirestrepo's suggestion it complains that my XCode is too old -- but to update it I have to update my OS. Dependency hell...

AshtonSBradley commented 5 years ago

I am on High Sierra 10.13.6, get

  Building Cairo ───→ `~/.julia/packages/Cairo/p68X8/deps/build.log`
┌ Error: Error building `Cairo`: 
│ WARNING: redefining constant DEBIAN_VERSION_REGEX
│ WARNING: redefining constant have_sonames
│ WARNING: redefining constant sonames
│ WARNING: redefining constant EXTENSIONS
│ Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespace4eb6f3b02951643dc38adb936658d948::Glib:Class
│ Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespace4eb6f3b02951643dc38adb936658d948::Glib:Class
│ Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespace4eb6f3b02951643dc38adb936658d948::Glib:Class
│ 
│ signal (11): Segmentation fault: 11
│ in expression starting at /Users/abradley/.julia/packages/Cairo/p68X8/deps/build.jl:176
│ _platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)
│ Allocations: 20112496 (Pool: 20109614; Big: 2882); GC: 44
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075

with

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
mirestrepo commented 5 years ago

Has anybody been able to get over the libffi issue?

montyvesselinov commented 5 years ago

I was able to. But it seems did not work for others.

On Thu, Jul 25, 2019 at 3:01 PM Maria Isabel Restrepo < notifications@github.com> wrote:

Has anybody been able to get over the libffi issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JuliaGraphics/Cairo.jl/issues/271?email_source=notifications&email_token=ABK7C6BW5N4CWKGAJJDRCA3QBIIDDA5CNFSM4G4XK3L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD22YOUA#issuecomment-515213136, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK7C6FVL7FZVCPBINV36K3QBIIDDANCNFSM4G4XK3LQ .

-- -monty monty.gitlab.io

cmey commented 5 years ago

About the problem of segfault:

1) brew reinstall cairo works!

2) /Users/cmeyer/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew install cairo fails with:

Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespacef3877cf90a113fb2305c53ebb4f59672::Glib:Class

3) /Users/cmeyer/.julia/packages/Homebrew/SvXTp/deps/usr/bin/brew install cairo works!

4) pkg> build Cairo fails with:

Building LibCURL ─→ `~/.julia/packages/LibCURL/lWJxD/deps/build.log`
  Building WinRPM ──→ `~/.julia/packages/WinRPM/Y9QdZ/deps/build.log`
  Building Homebrew → `~/.julia/packages/Homebrew/SvXTp/deps/build.log`
  Building Cairo ───→ `~/.julia/packages/Cairo/p68X8/deps/build.log`
┌ Error: Error building `Cairo`:
│ WARNING: redefining constant DEBIAN_VERSION_REGEX
│ WARNING: redefining constant have_sonames
│ WARNING: redefining constant sonames
│ WARNING: redefining constant EXTENSIONS
│
│ signal (11): Segmentation fault: 11
│ in expression starting at /Users/cmeyer/.julia/packages/Cairo/p68X8/deps/build.jl:176
│ _platform_strcmp at /usr/lib/system/libsystem_platform.dylib (unknown line)
│ Allocations: 26160723 (Pool: 26155607; Big: 5116); GC: 57
└ @ Pkg.Operations /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.2/Pkg/src/backwards_compatible_isolation.jl:647

Notice Homebrew used the SvXTp version, which worked when called from outside (see point 3 above).

Why does it fail when called from inside Julia? 🤔

The log (~/.julia/packages/Cairo/p68X8/deps/build.log) contains the exact same error message, nothing more to learn from there.

The error:

│ signal (11): Segmentation fault: 11
│ in expression starting at /Users/cmeyer/.julia/packages/Cairo/p68X8/deps/build.jl:176

seems to be from this code:

@BinDeps.install Dict([(:gobject, :_jl_libgobject),
                       (:cairo, :_jl_libcairo),
                       (:pango, :_jl_libpango),
                       (:pangocairo, :_jl_libpangocairo)])

Not sure how to proceed from here, does anyone know how to call these BinDeps installs manually in order to see which one is failing, and maybe get a better error message?

scottstanie commented 5 years ago

Just checking- is there even an older version of this that can build successfully on mac for julia v1.1+ ? Or has it been broken for newest mac OS?

timholy commented 5 years ago

There's been a lot of recent discussion of TTFP as a Julia problem, but I'd like to remind some of the folks worried about such things that TTFP is also a Cairo.jl and Gtk.jl problem because of this issue. Currently, the TTFP is infinite for some people using certain applications, and that's much worse than waiting a few minutes.

Would love it if there were some effort to get BinaryBuilder working for both Cairo.jl & Gtk.jl, then we could move past this. Otherwise we'll just have to abandon Cairo/Gtk.

cormullion commented 5 years ago

Otherwise we'll just have to abandon Cairo/Gtk.

Yikes. That's a "goodbye Julia" scenario (for me)... ☹️

timholy commented 5 years ago

Definitely don't want that! By "we" I meant "my group and my applications": ImageView, ProfileView, and my lab's entire GUI toolkit.

But really, it's not OK for this to drag out for months while also complaining that other hard problems aren't getting enough attention.

cormullion commented 5 years ago

Oh, OK :) I thought you might be speaking on behalf of Julia in general. But isn't this mainly a macOS problem - Cairo seems to still run on Linux/Travis and Windows/Travis (the two most popular OSs according to Viral's 2019 survey)? Or is it a deeper problem?

timholy commented 5 years ago

I thought you might be speaking on behalf of Julia in general.

Sorry for the confusion. I can't really do that :smile:.

But isn't this mainly a macOS

I think that's right. And I don't personally use macOS, and AFAICT neither do the primary maintainers of this package and Gtk.jl. However, it's a serious problem to have a package that doesn't work for one of the most popular platforms. I've spent an awful lot of time fixing problems that only show up on platforms I don't use. (Most recent example dating from approximately 2min ago: https://github.com/timholy/Revise.jl/pull/336 :smile:.)

The purpose of this message is to point out that those who are expressing concerns about a different problem (TTFP) might instead consider investing some time fixing this one. There is an obvious if difficult path: get BinaryBuilder working all the way through Gtk.jl. Then we don't rely on Homebrew anymore, and IIUC the differences between platforms are almost eliminated.

ghost commented 5 years ago

There is an obvious if difficult path: get BinaryBuilder working all the way through Gtk.jl. Then we don't rely on Homebrew anymore, and IIUC the differences between platforms are almost eliminated.

Ideally one would use native libraries, especially for creating anything that has any actual interface components instead of just displaying an image. Gtk interfaces are… clunky… compared to Mac native ones. Also see https://github.com/JuliaGraphics/Gtk.jl/issues/437 and https://github.com/JuliaImages/ImageView.jl/issues/178 for serious problems with trying to use Gtk —which wants to take complete control of everything—from Julia. I think the real solution is to have an "interface/graphics server" running in a different system thread that the backend library has full control of. A simple protocol for accessing that server (I don't think we need full-fledged GUI libraries) which can then be implemented using native libraries.

Or use Qt, which is much better at integrating with the native GUI framework than Gtk (which along with everything Gnome-related, I'd personally not touch with a long stick; they destroyed Linux for me, creeping into everything, hiding the unix under layers of something undescribable).

jonathanBieler commented 5 years ago

@timholy I'm a mac user, I've tried a couple times to use BinaryBuilder but never managed to do anything with it. Last time I got stuck on this issue, so there's not much I can do to help.

https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/380

giordano commented 5 years ago

Note that I've just updated CairoBuilder to latest BinaryBuilder version: https://github.com/JuliaGraphics/CairoBuilder/pull/5. I'm also working on building Pango (see https://github.com/JuliaGraphics/CairoBuilder/pull/5) but it'll take time (and some changes to BinaryBuilder itself, too)

jkrumbiegel commented 5 years ago

I think I've gone through all the threads I could find about the topic but still can't get Cairo.jl to work on my Mac Mojave system.. So far I've tried:

if I try to build Cairo now I get this

Building Cairo ───→ `~/.julia/packages/Cairo/QBbmo/deps/build.log`
┌ Error: Error building `Cairo`: 
│ WARNING: redefining constant DEBIAN_VERSION_REGEX
│ WARNING: redefining constant have_sonames
│ WARNING: redefining constant sonames
│ WARNING: redefining constant EXTENSIONS
│ ==> Installing pango from staticfloat/juliatranslated
│ Error: Operation already in progress for libpng.formula
│ Another active Homebrew process is already using libpng.formula.
│ Please wait for it to finish or terminate it to continue.
│ ERROR: LoadError: failed process: Process(`/Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/deps/usr/bin/brew install staticfloat/juliatranslated/pango`, ProcessExited(1)) [1]
│ 
│ Stacktrace:
│  [1] pipeline_error at ./process.jl:813 [inlined]
│  [2] #run#536(::Bool, ::typeof(run), ::Cmd) at ./process.jl:728
│  [3] run at ./process.jl:726 [inlined]
│  [4] #brew#4(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::typeof(Homebrew.brew), ::Cmd) at /Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/src/API.jl:19
│  [5] #brew at ./tuple.jl:0 [inlined]
│  [6] #install_and_link#38(::Bool, ::typeof(Homebrew.install_and_link), ::String) at /Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/src/API.jl:492
│  [7] (::getfield(Homebrew, Symbol("#kw##install_and_link")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(Homebrew.install_and_link), ::String) at ./none:0
│  [8] #add#29(::Bool, ::Bool, ::typeof(Homebrew.add), ::String) at /Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/src/API.jl:462
│  [9] add at /Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/src/API.jl:412 [inlined]
│  [10] install(::Array{String,1}) at /Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/src/bindeps_integration.jl:50
│  [11] (::getfield(Homebrew, Symbol("##80#81")))() at /Users/jkrumbiegel/.julia/packages/Homebrew/SvXTp/src/bindeps_integration.jl:45
│  [12] run(::getfield(Homebrew, Symbol("##80#81"))) at /Users/jkrumbiegel/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:478
│  [13] run(::BinDeps.SynchronousStepCollection) at /Users/jkrumbiegel/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521
│  [14] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at ./string:944
│  [15] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at ./string:910
│  [16] satisfy!(::BinDeps.LibraryGroup) at ./string:874
│  [17] top-level scope at string:977
│  [18] include at ./boot.jl:328 [inlined]
│  [19] include_relative(::Module, ::String) at ./loading.jl:1094
│  [20] include(::Module, ::String) at ./Base.jl:31
│  [21] include(::String) at ./client.jl:431
│  [22] top-level scope at none:5
│ in expression starting at /Users/jkrumbiegel/.julia/packages/Cairo/QBbmo/deps/build.jl:176
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()

I feel like I'm going in circles here, there are several threads about interrelated problems and too many workarounds to try that I don't know what the order of steps is I need to take. I don't understand why installing cairo through homebrew works, but then building Cairo.jl doesn't. What is there left to build after brew has done its job? If someone on Mojave has managed to get their system to work, could they be so kind to post a short sequence of steps going from a clean julia environment?

giordano commented 5 years ago

If you can please wait just a few days more, we're trying to deliver an hopefully working solution for everyone 🙂

jkrumbiegel commented 5 years ago

Of course, thank you for putting in the effort to fix this! You're talking about your previous post using CairoBuilder? Once it's done I'll be glad to test it on my system and report back

giordano commented 5 years ago

Yes, I'm talking about that. There is actually a preview in https://github.com/JuliaGraphics/Cairo.jl/pull/289, if you're able to test that branch on macOS it would be awesome. For the time being Travis tells us that Cairo basic features are working, Pango is disabled on that branch but there is the possibility that it's working for macOS (I can't check right now)

montyvesselinov commented 5 years ago

I had to rebuild Cairo on a new machine. The step I proposed before fixed it again:

https://github.com/JuliaGraphics/Cairo.jl/issues/271#issuecomment-511863408

  1. quit julia
  2. execute the following (replace user)
/Users/**user**/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew update-reset
/Users/**user**/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew config 
/Users/**user**/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew install cairo
rm -fR /Users/**user**/.julia/packages/Cairo
  1. start julia
  2. Pkg.add("Cairo)
giordano commented 5 years ago

Folks, I think you may want to check out #292 :slightly_smiling_face:.