JuliaGraphics / Gtk.jl

Julia interface to Gtk windowing toolkit.
Other
287 stars 80 forks source link

build Gtk error on Mac with Julia v1.0.1 #397

Open BoundaryValueProblems opened 6 years ago

BoundaryValueProblems commented 6 years ago

I just added the current master branch of Gtk.jl on my MacBook Pro (OSX 10.11.6), and tried to build and precompile it, but it failed as follows:

(v1.0) pkg> build Gtk
  Building LibCURL ─→ `~/.julia/packages/LibCURL/OoXMv/deps/build.log`
  Building WinRPM ──→ `~/.julia/packages/WinRPM/Y9QdZ/deps/build.log`
  Building Homebrew → `~/.julia/packages/Homebrew/Hf3Fm/deps/build.log`
  Building Cairo ───→ `~/.julia/packages/Cairo/CXPG1/deps/build.log`
  Building Gtk ─────→ `~/.julia/packages/Gtk/lkz0k/deps/build.log`
┌ Error: Error building `Gtk`:
│ ==> Downloading https://download.gnome.org/sources/librsvg/2.44/librsvg-2.44.8.tar.xz
│ Already downloaded: /Users/xxx/Library/Caches/Homebrew.jl/downloads/b509988d38c573bac37b6a9de4391282b73dc60be9070e7a23af6f38a7b6d478--librsvg-2.44.8.tar.xz
│ ==> ./configure --prefix=/Users/xxx/.julia/packages/Homebrew/Hf3Fm/deps/usr/Cellar/librsvg/2.44.8 --disable-Bsymbolic --enable-tools=yes --enable-pixbuf-loader=yes --enable-introspection=yes
│ Last 15 lines from /Users/saito/Library/Logs/Homebrew/librsvg/01.configure:
│ checking for clang option to produce PIC... -fno-common -DPIC
│ checking if clang PIC flag -fno-common -DPIC works... yes
│ checking if clang static flag -static works... no
│ checking if clang supports -c -o file.o... yes
│ checking if clang supports -c -o file.o... (cached) yes
│ checking whether the clang linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
│ checking dynamic linker characteristics... darwin15.6.0 dyld
│ checking how to hardcode library paths into programs... immediate
│ checking whether stripping libraries is possible... yes
│ checking if libtool supports shared libraries... yes
│ checking whether to build shared libraries... yes
│ checking whether to build static libraries... yes
│ checking for dlopen... yes
│ checking for cargo... no
│ configure: error: cargo is required.  Please install the Rust toolchain from https://www.rust-lang.org/
│
│ Do not report this issue to Homebrew/brew or Homebrew/core!
│
│ Error: You are using macOS 10.11.
│ We (and Apple) do not provide support for this old version.
│ You will encounter build failures and other breakages.
│ Please create pull-requests instead of asking for help on Homebrew's
│ GitHub, Discourse, Twitter or IRC. As you are running this old version,
│ you are responsible for resolving any issues you experience.
│
│ Error: You are using macOS 10.11.
│ We (and Apple) do not provide support for this old version.
│ You will encounter build failures and other breakages.
│ Please create pull-requests instead of asking for help on Homebrew's
│ GitHub, Discourse, Twitter or IRC. As you are running this old version,
│ you are responsible for resolving any issues you experience.
│
│ ┌ Warning: The following packages do not have relocatable bottles, installation may fail!
│ │ Please report these packages to https://github.com/JuliaLang/Homebrew.jl:
│ │   cairo
│ │   harfbuzz
│ │   librsvg
│ └ @ Homebrew ~/.julia/packages/Homebrew/Hf3Fm/src/API.jl:449
│ ERROR: LoadError: failed process: Process(`/Users/xxx/.julia/packages/Homebrew/Hf3Fm/deps/usr/bin/brew install --ignore-dependencies librsvg`, ProcessExited(1)) [1]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│  [2] pipeline_error at ./process.jl:705 [inlined]
│  [3] #run#504(::Bool, ::Function, ::Cmd) at ./process.jl:663
│  [4] run at ./process.jl:661 [inlined]
│  [5] #brew#4(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::Cmd) at /Users/xxx/.julia/packages/Homebrew/Hf3Fm/src/API.jl:19
│  [6] #brew at ./none:0 [inlined]
│  [7] #install_and_link#38(::Bool, ::Function, ::String) at /Users/xxx/.julia/packages/Homebrew/Hf3Fm/src/API.jl:492
│  [8] (::getfield(Homebrew, Symbol("#kw##install_and_link")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(Homebrew.install_and_link), ::String) at ./none:0
│  [9] macro expansion at ./logging.jl:310 [inlined]
│  [10] #add#29(::Bool, ::Bool, ::Function, ::String) at /Users/xxx/.julia/packages/Homebrew/Hf3Fm/src/API.jl:449
│  [11] add(::String) at /Users/xxx/.julia/packages/Homebrew/Hf3Fm/src/API.jl:412
│  [12] top-level scope at /Users/xxx/.julia/packages/Gtk/lkz0k/deps/build.jl:60
│  [13] include at ./boot.jl:317 [inlined]
│  [14] include_relative(::Module, ::String) at ./loading.jl:1041
│  [15] include(::Module, ::String) at ./sysimg.jl:29
│  [16] include(::String) at ./client.jl:388
│  [17] top-level scope at none:0
│ in expression starting at /Users/xxx/.julia/packages/Gtk/lkz0k/deps/build.jl:43
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1069

It's strange since I already built cargo when I built rust. I also installed harfbuzz and cairo via Homebrew.jl. When I explicitly ran the Homebrew installatation of librsvg via Terminal, it was installed after quite a bit of effort:

$ pwd
/Users/xxx/.julia/packages/Homebrew/Hf3Fm/deps/usr/bin
$ ./brew install librsvg
==> Downloading https://download.gnome.org/sources/librsvg/2.44/librsvg-2.44.8.t
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/b509988d38c573bac37b6a9de4391282b73dc60be9070e7a23af6f38a7b6d478--librsvg-2.44.8.tar.xz
==> ./configure --prefix=/Users/xxx/.julia/packages/Homebrew/Hf3Fm/deps/usr/Ce
==> make install gdk_pixbuf_binarydir=/Users/xxx/.julia/packages/Homebrew/Hf3F
==> /Users/xxx/.julia/packages/Homebrew/Hf3Fm/deps/usr/opt/gdk-pixbuf/bin/gdk-
🍺  /Users/xxx/.julia/packages/Homebrew/Hf3Fm/deps/usr/Cellar/librsvg/2.44.8: 46 files, 86.6MB, built in 5 minutes 49 seconds

Before this, I had to install rust etc., via Homebrew on Terminal, which took a long time to compile and install. In principle, we should not need to run Homebrew on Terminal, and build Gtk within the package management in Julia should do all these necessary installation. What is wrong here? I use the current master branch of Homebrew.jl, by the way. Thanks for your help!

BoundaryValueProblems commented 6 years ago

BTW, in order to successfully install librsvg under Homebrew.jl (the Julia specific version of Homebrew stuff), I had to install librsvg on my main systemwide Homebrew system first. By doing so, it also automatically installed rust on the systemwide Homebrew system. So, it is not a good situation at all. I had to install all these packages twice for the systemwide Homebrew and the Julia-specific Homebrew...

BoundaryValueProblems commented 6 years ago

I just want to add that I didn't have any problem installing it on my Windows 10 machine with Julia v1.0.1.

tknopp commented 6 years ago

The issue seems that the OSX version is pretty old. We run tests but these are on more recent versions.

jonathanBieler commented 6 years ago

│ We (and Apple) do not provide support for this old version. │ You will encounter build failures and other breakages.

I think the "we" here refers to Homebrew (and not Homebrew.jl). It seems like you either need to upgrade your OS or make a fix yourself and contribute it to Homebrew. It's probably easier to upgrade.

BoundaryValueProblems commented 6 years ago

I also installed Gtk.jl on linux machines: it initially failed to build due to the failure of installing libgtk-3-dev, but after running sudo apt-get install libgtk-3-dev explicitly on the shell/terminal, it worked. Hence, so far, installing Gtk.jl on Mac is the most difficult and cumbersome, perhaps, partially due to the current problematic status of Homebrew.jl...

BoundaryValueProblems commented 6 years ago

About the version of OS X (El Capitan, 10.11.6), I believe many people still use this quite stable and reliable version of OS X. Although I plan to update to Mojave (10.14.x) soon, it would be great if things works under El Capitan. In fact, finally, I could build Gtk, but I had to install all these packages (rust, librsvg, etc.) twice: one under Julia-specific version of Homebrew, and the other under the systemwide Homebrew. @tknopp and @jonathanBieler : you didn't have to install these twice under your newer macOS, correct? I just want to double check with you guys.

tknopp commented 6 years ago

I do not use system wide homebrew and so does not Travis:

https://travis-ci.org/JuliaGraphics/Gtk.jl

Every commit that we make is tested there so that nothing brakes. But this is not done across a variety of OSX versions.

In general, this is more a Homebrew.jl issue and not so much a Gtk.jl issue. So the solution is not in this package but in the formulas provided by Homebrew.jl