Homebrew troubles with v0.6

I can’t install packages on 0.6 because my homebrew doesn’t work. I’ve already reported the issue, but it seems to be a more general problem with my setup, so maybe someone here has an idea of what the problem is.

The build process stop with autoreconf, but doesn’t provide a clear error message:

==> autoreconf -i -f
Last 15 lines from /Users/jbieler/Library/Logs/Homebrew/glib/01.autoreconf:
2017-07-14 11:29:27 +0200

autoreconf
-i
-f


READ THIS: http://docs.brew.sh/Troubleshooting.html

ERROR: failed process: Process(`/Users/jbieler/.julia/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies glib`, ProcessExited(1)) [1]

Log here: https://gist.github.com/jonathanBieler/2aef2b746b24f88ae5a5dd5213937f29

I went thourgh the Troubleshooting page and I updated my OS X to 10.12 and Xcode to 8.3.3 but that hasn’t made any difference. Any clue ?

I tried to remove the --ignore-dependencies (/Users/jbieler/.julia/v0.6/Homebrew/deps/usr/bin/brew install -v glib) and he manages to build glib. But then if I try to install cairo I get a

checking for pkg-config... no
configure: error: pkg-config >=  required but not found (http://pkgconfig.freedesktop.org/)

Even though pkg-config is installed:

shell> /Users/jbieler/.julia/v0.6/Homebrew/deps/usr/bin/brew info pkg-config
pkg-config: stable 0.29.2
Manage compile and link flags for libraries
https://freedesktop.org/wiki/Software/pkg-config/
/Users/jbieler/.julia/v0.6/Homebrew/deps/usr/Cellar/pkg-config/0.29.2 (11 files, 627.5KB) *
  Built from source on 2017-07-17 at 11:11:12
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pkg-config.rb

Is julia’s homebrew looking in a specific path for executable ? this looks like a path issue.

Like this?
https://github.com/JuliaPackaging/Homebrew.jl/blob/master/src/Homebrew.jl#L8-L10

Ok, so pkg-config is in the brew_prefix bin’s folder, it correctly get added to ENV[“PATH”] but it yet cannot be found during the build process:

julia> Homebrew.brew_prefix
"/Users/jbieler/.julia/v0.6/Homebrew/deps/usr"

shell> ls /Users/jbieler/.julia/v0.6/Homebrew/deps/usr/bin
aclocal			envsubst		gdbus-codegen		glibtoolize		msgcomm			pcre-config
aclocal-1.15		fc-cache		gettext			gobject-query		msgconv			pcregrep
autoconf		fc-cat			gettext.sh		gresource		msgen			pcretest
autoheader		fc-list			gettextize		gsettings		msgexec			pkg-config
autom4te		fc-match		gio			gtester			msgfilter		png-fix-itxt
automake		fc-pattern		gio-querymodules	gtester-report		msgfmt			pngfix
automake-1.15		fc-query		glib-compile-resources	ifnames			msggrep			recode-sr-latin
autopoint		fc-scan			glib-compile-schemas	libpng-config		msginit			xgettext
autoreconf		fc-validate		glib-genmarshal		libpng16-config		msgmerge
autoscan		freetype-config		glib-gettextize		msgattrib		msgunfmt
autoupdate		gapplication		glib-mkenums		msgcat			msguniq
brew			gdbus			glibtool		msgcmp			ngettext

julia> Homebrew.add("cairo")
WARNING: Couldn't find bottle stanza in pkg-config
WARNING: Couldn't find bottle stanza in pixman
WARNING: Couldn't find bottle stanza in libpng
WARNING: Couldn't find bottle stanza in freetype
WARNING: Couldn't find bottle stanza in staticfloat/juliadeps/fontconfig
WARNING: Couldn't find bottle stanza in autoconf
WARNING: Couldn't find bottle stanza in automake
WARNING: Couldn't find bottle stanza in libffi
WARNING: Couldn't find bottle stanza in pcre
WARNING: Couldn't find bottle stanza in gettext
WARNING: Couldn't find bottle stanza in libtool
WARNING: Couldn't find bottle stanza in glib
WARNING: Couldn't find bottle stanza in cairo
WARNING: The following packages do not have relocatable bottles, installation may fail!
Please report these packages to https://github.com/JuliaLang/Homebrew.jl:
  gettext
  glib
  cairo
==> Using the sandbox
==> Downloading https://cairographics.org/releases/cairo-1.14.10.tar.xz
Already downloaded: /Users/jbieler/Library/Caches/Homebrew.jl/cairo-1.14.10.tar.xz
==> ./configure --prefix=/Users/jbieler/.julia/v0.6/Homebrew/deps/usr/Cellar/cairo/1.14.10 --enable-gobject=yes --enable-svg=yes --enable-tee=yes --enable-
Last 15 lines from /Users/jbieler/Library/Logs/Homebrew/cairo/01.configure:
checking how to run the C++ preprocessor... clang++ -E
checking for ld used by clang++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
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 (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin16.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking for inline... inline
checking for pkg-config... no
configure: error: pkg-config >=  required but not found (http://pkgconfig.freedesktop.org/)

READ THIS: http://docs.brew.sh/Troubleshooting.html

ERROR: failed process: Process(`/Users/jbieler/.julia/v0.6/Homebrew/deps/usr/bin/brew install --ignore-dependencies cairo`, ProcessExited(1)) [1]
Stacktrace:
 [1] pipeline_error(::Base.Process) at ./process.jl:682
 [2] run(::Cmd) at ./process.jl:651
 [3] #brew#4(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::Cmd) at /Users/jbieler/.julia/v0.6/Homebrew/src/API.jl:19
 [4] (::Homebrew.#kw##brew)(::Array{Any,1}, ::Homebrew.#brew, ::Cmd) at ./<missing>:0
 [5] #install_and_link#42(::Bool, ::Function, ::String) at /Users/jbieler/.julia/v0.6/Homebrew/src/API.jl:492
 [6] (::Homebrew.#kw##install_and_link)(::Array{Any,1}, ::Homebrew.#install_and_link, ::String) at ./<missing>:0
 [7] #add#33(::Bool, ::Bool, ::Function, ::String) at /Users/jbieler/.julia/v0.6/Homebrew/src/API.jl:462
 [8] add(::String) at /Users/jbieler/.julia/v0.6/Homebrew/src/API.jl:412

julia> ENV["PATH"]
"/Applications/Julia-0.6.app/Contents/Resources/julia/bin:/Users/jbieler/.julia/v0.6/Homebrew/deps/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin"