Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lablgtk 3.1.4 fails to build with opam on macOS 14.4 #178

Closed
davidnowak opened this issue Mar 15, 2024 · 4 comments
Closed

Lablgtk 3.1.4 fails to build with opam on macOS 14.4 #178

davidnowak opened this issue Mar 15, 2024 · 4 comments

Comments

@davidnowak
Copy link

A successful opam init followed by opam install lablgtk3 fails on macOS Sonoma 14.4:

#=== ERROR while compiling lablgtk3.3.1.4 =====================================#
# context     2.1.5 | macos/x86_64 | ocaml.5.1.1 | https://opam.ocaml.org#69e073a5
# path        ~/.opam/default/.opam-switch/build/lablgtk3.3.1.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 19
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-26124-d6bcd6.env
# output-file ~/.opam/log/lablgtk3-26124-d6bcd6.out
### output ###
# 31 |    ml_gtk ml_gtkmisc
# [...]
# (cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -pthread -D_FILE_OFFSET_BITS=64 -I/usr/local/Cellar/gtk+3/3.24.41/include/gtk-3.0 -I/usr/local/Cellar/glib/2.80.0/include/gio-unix-2.0 -I/usr/local/Cellar/cairo/1.18.0/include -I/usr/local/Cellar/libepoxy/1.5.10/include -I/usr/local/Cellar/pango/1.52.1/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/8.3.0_1/include/harfbuzz[...]
# ml_gtk.c:236:78: error: incompatible function pointer types passing 'value (const char *)' (aka 'long (const char *)') to parameter of type 'value_in' (aka 'long (*)(void *)') [-Wincompatible-function-pointer-types]
# { return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), Val_string); }
#                                                                              ^~~~~~~~~~
# ./wrappers.h:422:20: note: expanded from macro 'Val_string'
# #define Val_string copy_string_check
#                    ^~~~~~~~~~~~~~~~~
# ./ml_glib.h:30:50: note: passing argument to parameter here
# CAMLexport value Val_GList (GList *list, value_in);
#                                                  ^
# 1 error generated.

In case it is related to issue #177, the command gcc --version returns:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
@davidnowak
Copy link
Author

Workaround: opam pin lablgtk3 3.1.3

@peterlefanulumsdaine
Copy link

peterlefanulumsdaine commented Mar 18, 2024

I’m having what seems like the probably the same issue — a build failure for lablgtk3 3.1.4 on macOS Sonoma 14.4, on a fairly clean system, with other opam packages building fine — but with different error details:

#=== ERROR while compiling lablgtk3.3.1.4 =====================================#
# context     2.1.5 | macos/arm64 | ocaml.5.1.1 | https://opam.ocaml.org#ac9a846c
# path        ~/.opam/default/.opam-switch/build/lablgtk3.3.1.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 11
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-31404-a4c564.env
# output-file ~/.opam/log/lablgtk3-31404-a4c564.out
### output ###
# [...]
# #define GLIB_DEPRECATED_MACRO_IN_2_30_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
#                                              ^
# /opt/homebrew/Cellar/glib/2.80.0/include/glib-2.0/glib/gmacros.h:1300:3: note: expanded from macro 'GLIB_DEPRECATED_MACRO_FOR'
#   _GLIB_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Deprecated pre-processor symbol: replace with #f))
#   ^
# /opt/homebrew/Cellar/glib/2.80.0/include/glib-2.0/glib/gmacros.h:1297:33: note: expanded from macro '_GLIB_GNUC_DO_PRAGMA'
# #define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x))
#                                 ^
# <scratch space>:84:6: note: expanded from here
#  GCC warning "Deprecated pre-processor symbol: replace with \"const\""
#      ^
# 6 warnings generated.

My gcc --version returns almost exactly the same as @davidnowak gives above:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Following @davidnowak ’s suggested workaround, lablgtk3.3.1.3 installs fine.

@MSoegtropIMC
Copy link
Contributor

I can confirm both the issue with lablgtk3.3.1.4 and that falling back to lablgtk3.3.1.3 fixes this (in the Coq Platform context).

@garrigue
Copy link
Owner

Passing a function pointer without a cast seems to be a bad idea...
Fixed; will also put the patch in opam before doing a new release.

garrigue added a commit to garrigue/opam-repository that referenced this issue Jun 10, 2024
CHANGES:

2024.06.10 [Jacques]
  * Prepare for release
  * Fix typos in README.md (garrigue/lablgtk#182) [Sylvain Chiron]

2024.05.20 [Jacques]
  * Typo in ml_gtk_text_buffer_get_iter_at_line_index. (garrigue/lablgtk#181) [Hugo Herbelin]

2024.05.14 [Jacques]
  * Support windows sockets in Glib.IO.channel_of_descr (garrigue/lablgtk#176)
    [with Michael Soegtrop]

2024.03.24 [Jacques]
  * fix pointer incompatibility in ml_gtk_style_context_list_classes (garrigue/lablgtk#178)
avsm pushed a commit to avsm/opam-repository that referenced this issue Sep 5, 2024
CHANGES:

2024.06.10 [Jacques]
  * Prepare for release
  * Fix typos in README.md (garrigue/lablgtk#182) [Sylvain Chiron]

2024.05.20 [Jacques]
  * Typo in ml_gtk_text_buffer_get_iter_at_line_index. (garrigue/lablgtk#181) [Hugo Herbelin]

2024.05.14 [Jacques]
  * Support windows sockets in Glib.IO.channel_of_descr (garrigue/lablgtk#176)
    [with Michael Soegtrop]

2024.03.24 [Jacques]
  * fix pointer incompatibility in ml_gtk_style_context_list_classes (garrigue/lablgtk#178)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants