JuliaPackaging / Homebrew.jl

OSX Binary dependency provider for Julia
Other
27 stars 32 forks source link

Homebrew does not install all deps for Cairo.jl #211

Open sivapvarma opened 6 years ago

sivapvarma commented 6 years ago

@staticfloat

Below is the Pkg.add("Cairo") command's output . looks like freetype dependency is not being installed by Homebrew. Link to Cairo.jl's deps/build.jl file

julia> Pkg.add("Cairo")
INFO: Installing Cairo v0.3.1
INFO: Building Homebrew
Already up-to-date.
INFO: Building Cairo
WARNING: The following packages do not have relocatable bottles, installation may fail!
Please report these packages to https://github.com/JuliaLang/Homebrew.jl:
  staticfloat/juliadeps/fontconfig
==> Installing fontconfig from staticfloat/juliadeps
==> Downloading https://www.freedesktop.org/software/fontconfig/release/fontconf
Already downloaded: /Users/sivapvarma/Library/Caches/Homebrew.jl/fontconfig-2.12.1.tar.bz2
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/3790b
Already downloaded: /Users/sivapvarma/Library/Caches/Homebrew.jl/fontconfig--patch-e7c074109a367bf3966578034b20d11f7e0b4a611785a040aef1fd11359af04d.diff
==> Patching
==> Applying patch-2.12.1-fccache.diff
patching file src/fccache.c
==> ./configure --disable-silent-rules --enable-static --with-add-fonts=/System/
Last 15 lines from /Users/sivapvarma/Library/Logs/Homebrew/fontconfig/01.configure:
checking for struct statfs.f_flags... yes
checking for struct statfs.f_fstypename... yes
checking for struct dirent.d_type... yes
checking for FREETYPE... no
configure: error: in `/private/tmp/fontconfig-20171103-26222-17wwa08/fontconfig-2.12.1':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables FREETYPE_CFLAGS
and FREETYPE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
staticfloat/juliadeps

====================================[ ERROR: Cairo ]=====================================

LoadError: failed process: Process(`/Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies staticfloat/juliadeps/fontconfig`, ProcessExited(1)) [1]
while loading /Users/sivapvarma/.julia/v0.6/Cairo/deps/build.jl, in expression starting on line 162

=========================================================================================

====================================[ BUILD ERRORS ]=====================================

WARNING: Cairo had build errors.

 - packages with build errors remain installed in /Users/sivapvarma/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("Cairo")`
 - build a single package by running its `deps/build.jl` script

=========================================================================================
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of Cairo
INFO: Use `Pkg.update()` to get the latest versions of your packages

Here is my versioninfo

julia> versioninfo()
Julia Version 0.6.1
Commit 0d7248e (2017-10-24 22:15 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.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.9.1 (ORCJIT, broadwell)
sivapvarma commented 6 years ago

confirming that removing Homebrew with Pkg.rm("Cairo") and Pkg.rm("Homebrew") does not fix this issue for me.

v-i-s-h commented 6 years ago

+1

I tried executing the failed command from terminal and git this output.

iMac-vish:~ vish$ /Users/vish/.julia/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies staticfloat/juliatranslated/fontconfig
Error: No available formula with the name "staticfloat/juliatranslated/fontconfig" 
==> Searching for a previously deleted formula...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
v-i-s-h commented 6 years ago

Now with Pkg.build("Cairo") it works for me! Pkg.test( "Cairo" ) reports all tests are passed.

sivapvarma commented 6 years ago

the command does not work for me as well but it is because of pkg-config related issue. What confuses me about this pig-config issue is that should it be installed by Homebrew.jl or my macOS native homebrew installation

~                                                                             ⍉
▶ /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies staticfloat/juliadeps/fontconfig pkg-config
git: 'rebase' is not a git command. See 'git --help'.
==> Installing fontconfig from staticfloat/juliadeps
==> Downloading https://www.freedesktop.org/software/fontconfig/release/fontconf
Already downloaded: /Users/sivapvarma/Library/Caches/Homebrew/fontconfig-2.12.1.tar.bz2
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/3790b
Already downloaded: /Users/sivapvarma/Library/Caches/Homebrew/fontconfig--patch-e7c074109a367bf3966578034b20d11f7e0b4a611785a040aef1fd11359af04d.diff
==> Patching
==> Applying patch-2.12.1-fccache.diff
patching file src/fccache.c
==> ./configure --disable-silent-rules --enable-static --with-add-fonts=/System/
Last 15 lines from /Users/sivapvarma/Library/Logs/Homebrew/fontconfig/01.configure:
checking for struct statfs.f_flags... yes
checking for struct statfs.f_fstypename... yes
checking for struct dirent.d_type... yes
checking for FREETYPE... no
configure: error: in `/private/tmp/fontconfig-20171105-40320-1qj4pn4/fontconfig-2.12.1':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables FREETYPE_CFLAGS
and FREETYPE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
staticfloat/juliadeps

/Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/utils/github.rb:210:in `raise_api_error': GitHub  (GitHub::AuthenticationFailedError)
The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
  printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
Or create a personal access token:
  https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token"
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/utils/github.rb:178:in `open'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/utils/github.rb:278:in `search'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/utils/github.rb:225:in `search_issues'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/utils/github.rb:238:in `issues_for_formula'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/exceptions.rb:369:in `fetch_issues'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/exceptions.rb:365:in `issues'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/exceptions.rb:419:in `dump'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/brew.rb:135:in `rescue in <main>'
    from /Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/Library/Homebrew/brew.rb:30:in `<main>'

Pkg.build("Cairo") gives me the same error though

julia> Pkg.build("Cairo")
INFO: Building Homebrew
Updated 1 tap (homebrew/core).
==> Updated Formulae
afl-fuzz        diffoscope      imagemagick     nfdump          smartmontools
aspcud          dscanner        imagemagick@6   osrm-backend    swift-protobuf
aws-sdk-cpp     exploitdb       json-fortran    pandoc          terragrunt
cmake           faas-cli        lbdb            pdftoedn        traefik
corebird        feh             libwebsockets   pdftoipe        txt2tags
cython          fio             libxslt         poppler
dhall-json      fn              macvim          prometheus
diff-pdf        gmsh            memcached       shpotify
INFO: Building Cairo
WARNING: The following packages do not have relocatable bottles, installation may fail!
Please report these packages to https://github.com/JuliaLang/Homebrew.jl:
  staticfloat/juliadeps/fontconfig
==> Installing fontconfig from staticfloat/juliadeps
==> Downloading https://www.freedesktop.org/software/fontconfig/release/fontconf
Already downloaded: /Users/sivapvarma/Library/Caches/Homebrew.jl/fontconfig-2.12.1.tar.bz2
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/3790b
Already downloaded: /Users/sivapvarma/Library/Caches/Homebrew.jl/fontconfig--patch-e7c074109a367bf3966578034b20d11f7e0b4a611785a040aef1fd11359af04d.diff
==> Patching
==> Applying patch-2.12.1-fccache.diff
patching file src/fccache.c
==> ./configure --disable-silent-rules --enable-static --with-add-fonts=/System/
Last 15 lines from /Users/sivapvarma/Library/Logs/Homebrew/fontconfig/01.configure:
checking for struct statfs.f_flags... yes
checking for struct statfs.f_fstypename... yes
checking for struct dirent.d_type... yes
checking for FREETYPE... no
configure: error: in `/private/tmp/fontconfig-20171105-45437-kd49kk/fontconfig-2.12.1':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables FREETYPE_CFLAGS
and FREETYPE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
staticfloat/juliadeps

================================[ ERROR: Cairo ]================================

LoadError: failed process: Process(`/Users/sivapvarma/.julia/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies staticfloat/juliadeps/fontconfig`, ProcessExited(1)) [1]
while loading /Users/sivapvarma/.julia/v0.6/Cairo/deps/build.jl, in expression starting on line 162

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: Cairo had build errors.

 - packages with build errors remain installed in /Users/sivapvarma/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("Cairo")`
 - build a single package by running its `deps/build.jl` script

================================================================================
cortner commented 6 years ago

same problem here

maximerischard commented 6 years ago

I had the same problem. Running the incriminated command by hand gave a git error:

> $JULIA_PKGDIR/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies staticfloat/juliatranslated/fontconfig
git: 'rebase' is not a git command. See 'git --help'.
Warning: staticfloat/juliatranslated/fontconfig 2.12.6 is already installed

I noticed that $JULIA_PKGDIR/v0.6/Homebrew/deps/usr/bin/brew was set up with git 2.15 but my system git 2.13, so I tried upgrade my system git:

> brew upgrade git

After that I was able to build cairo from within julia.

cortner commented 6 years ago

I can confirm that @maximerischard 's suggestion worked for me as well. (though some Cairo tests are failing now) Thank you!

rsrock commented 6 years ago

I had similar problems. In addition to the git fix above, I needed to do:

julia> using Homebrew

shell> which brew
/Users/rrock/.julia/v0.6/Homebrew/deps/usr/bin/brew

shell> brew uninstall --force fontconfig

shell> brew install fontconfig
[snip]

[edit] To get fontconfig-2.12.6 instead of fontconfig-2.12.1.

Then a Pkg.build("Homebrew") was able to build everything after fontconfig (alphabetically), including it's own git package.

deszoeke commented 6 years ago

My problem was similar. An old incompatible version of fontconfig prevented cairo from installing:

julia> using Homebrew
julia> Libdl.dlopen("$(Homebrew.prefix("pango"))/lib/libpangocairo-1.0.dylib")
ERROR: could not load library ".../.julia/v0.6/Homebrew/deps/usr/Cellar/pango/1.42.2_1/lib/libpangocairo-1.0.dylib"
dlopen(/Users/sdeszoek/.julia/v0.6/Homebrew/deps/usr/Cellar/pango/1.42.2_1/lib/libpangocairo-1.0.dylib, 1): Library not loaded: .../.julia/v0.6/Homebrew/deps/usr/opt/fontconfig/lib/libfontconfig.1.dylib
  Referenced from: .../.julia/v0.6/Homebrew/deps/usr/Cellar/pango/1.42.2_1/lib/libpangocairo-1.0.dylib
  Reason: Incompatible library version: libpangocairo-1.0.dylib requires version 13.0.0 or later, but libfontconfig.1.dylib provides version 12.0.0

Thanks to a very helpful suggestion from homebrew that I got by following @rsrock's suggestion, the solution was to upgrade fontconfig for julia's homebrew via the command line:

shell> brew uninstall --force --ignore-dependencies fontconfig
shell> brew install --ignore-dependencies fontconfig
Error: fontconfig 2.12.6 is already installed
To upgrade to 2.13.0, run `brew upgrade fontconfig`

shell> brew upgrade fontconfig
==> Upgrading 1 outdated package, with result:
fontconfig 2.13.0
==> Upgrading fontconfig 
==> Downloading https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.0.tar.bz2
######################################################################## 100.0%
==> ./configure --disable-silent-rules --enable-static --with-add-fonts=/System/Library/Fonts,/Library/Fonts,~/Library/Fonts,/Syst
==> make install RUN_FC_CACHE_TEST=false
==> Regenerating font cache, this may take a while
==> .../.julia/v0.6/Homebrew/deps/usr/Cellar/fontconfig/2.13.0/bin/fc-cache -frv
🍺  .../.julia/v0.6/Homebrew/deps/usr/Cellar/fontconfig/2.13.0: 494 files, 3.2MB, built in 1 minute 23 seconds

Now Pkg.build("Rsvg","Cairo","Gtk") works.