Shopify / homebrew-shopify

47 stars 24 forks source link

libgda@5.rb does not compile on a fresh install of MacOS 14.4 #922

Open masom opened 6 months ago

masom commented 6 months ago

Meanwhile, the default Homebrew libgda installs fine.

┃ ==> Applying configure-big_sur.diff
┃
┃ patching file configure
┃
┃ ==> ./configure --disable-silent-rules --disable-binreloc --disable-gtk-doc --wi
┃
┃ ==> make
┃
┃ Last 15 lines from /Users/martinsamson/Library/Logs/Homebrew/libgda@5/02.make:
┃
┃                                                                    NULL, _gda_prepared_estatement_free);
┃
┃                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
┃
┃ /opt/homebrew/Cellar/glib/2.80.0/include/glib-2.0/glib/ghash.h:66:61: note: passing argument to parameter 'value_destroy_func' here
┃
┃                                             GDestroyNotify  value_destroy_func);
┃
┃                                                             ^
┃
┃ 1 error generated.
┃
┃ make[2]: *** [gda-connection.lo] Error 1
┃
┃ make[2]: *** Waiting for unfinished jobs....
rew/Cellar/glib/2.80.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/f
fi -DHAVE_GIO   -Wall   -g -O2 -c -o gda-data-select.lo gda-data-select.c
gda-connection.c:6461:18: error: incompatible function pointer types passing 'void (PreparedStatementRef *)' to parameter of type 'GDestroyNotify' (a
ka 'void (*)(void *)') [-Wincompatible-function-pointer-types]
                                                                   NULL, _gda_prepared_estatement_free);
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/glib/2.80.0/include/glib-2.0/glib/ghash.h:66:61: note: passing argument to parameter 'value_destroy_func' here
                                            GDestroyNotify  value_destroy_func);
davidstosik commented 5 months ago

Same here. ✋🏻

First met the error when trying to run dev up in shopify/shopify on my new M3, but I can also reproduce with brew install shopify/shopify/libgda@5.

ilikeorangutans commented 5 months ago

Same issue here. brew install shopify/shopify/libgda@5 fails.

sandor-shopify commented 5 months ago

same, I'm also getting the same problem

masom commented 5 months ago

The short-term solution is downgrading xcode command line tools as the one shipping in XCode on 14.4 does not seem compatible with libgda@5.

% xcode-select -v
xcode-select version 2406.

^ This version seems to work.

mottallify commented 5 months ago

Can confirm that this is also happening on the M1 machines. My Xcode version is also 2406:

┃ libgda@5.rb does not compile on a fresh install of MacOS 14.4 https://github.com/Shopify/homebrew-shopify/issues/922
┃
┗━━ 💥  Failed! Aborting! The packages: shopify/shopify/libgda@5 =>  aren't available from Homebrew.
➜  shopify git:(main) xcode-select -v
xcode-select version 2406.
ianks commented 5 months ago

Do we even need to be on a patched libgda??

olga-mcbfe commented 5 months ago

doesn't work for me on M3 with 2406 xcode version

laudera commented 5 months ago

Does anyone know if there is a fix for this yet?

GoodForOneFare commented 5 months ago

dev clang reset && dev up worked for me.

laudera commented 5 months ago

@GoodForOneFare thank you!!

ilikeorangutans commented 5 months ago

Did dev clang reset and that got me to a different error. Looks like glib is missing/wrong version:

Couldn't find include 'GObject-2.0.gir' (search path: '['.', '/private/tmp/libgdaA5-20240408-50276-wy7ucg/libgda-5.2.10/.brew_home/.local/share/gir-1.0', 'gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/opt/homebrew/Cellar/gobject-introspection/1.80.0/share/gir-1.0', '/opt/homebrew/Cellar/gobject-introspection/1.80.0/share/gir-1.0', '/opt/homebrew/share/gir-1.0']')

I have /opt/homebrew/Cellar/glib/2.80.0_2/share/gir-1.0/GObject-2.0.gir, but turns out glib wasn't linked. brew link glib did the trick and it's successfully finished dev up.

Update: spoke too soon. It did install libgda, however gda.bundle was linked against the wrong version of libgda:

LoadError: dlopen(/Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle, 0x0009): Library not loaded: /opt/homebrew/opt/libgda/lib/libgda-6.0.6.0.0.dylib (LoadError)
  Referenced from: <22636203-AD1B-385E-BAD4-96C0EFF8AD37> /Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle
  Reason: tried: '/opt/homebrew/opt/libgda/lib/libgda-6.0.6.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libgda/lib/libgda-6.0.6.0.0.dylib' (no such file),
'/opt/homebrew/opt/libgda/lib/libgda-6.0.6.0.0.dylib' (no such file) - /Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle

Confirmed with

$ otool -L /Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle

/Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle:
        /opt/rubies/3.3.0/lib/libruby.3.3.dylib (compatibility version 3.3.0, current version 3.3.0)
        /opt/homebrew/opt/libgda/lib/libgda-6.0.6.0.0.dylib (compatibility version 6.0.0, current version 6.0.0)
        /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
        /opt/homebrew/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
        /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
        /opt/homebrew/opt/gettext/lib/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
        /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)

Forcing a rebuild: rm -rf ~/.gem/ruby/3.3.0/gems/gda-1.1.5 && dev up links the bundle correctly:

$ otool -L /Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle

/Users/jakobkulzer/.gem/ruby/3.3.0/gems/gda-1.1.5/lib/gda.bundle:
        /opt/rubies/3.3.0/lib/libruby.3.3.dylib (compatibility version 3.3.0, current version 3.3.0)
        /opt/homebrew/opt/libgda@5/lib/libgda-5.0.4.dylib (compatibility version 6.0.0, current version 6.1.0)
        /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
        /opt/homebrew/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
        /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
        /opt/homebrew/opt/gettext/lib/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
        /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)

Running into an unrelated error now, but it looks like dev up would succeed otherwise.

metamoni commented 1 month ago

@masom my Xcode version is 2408. How can I downgrade Xcode, seeing as it's all managed through self-service?