garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
89 stars 40 forks source link

Lablgtk 3.1.4 fails to build with opam #177

Closed Halbaroth closed 3 months ago

Halbaroth commented 5 months ago

The latest release of Lablgtk doesn't compile anymore with opam 2.2:

opam switch create test ocaml-base-compiler.4.14.1 
opam install lablgtk3

produces the output:

[ERROR] The compilation of lablgtk3.3.1.4 failed at "dune build -p lablgtk3 -j 7".

#=== ERROR while compiling lablgtk3.3.1.4 =====================================#
# context     2.2.0~alpha3~dev | linux/x86_64 | ocaml-base-compiler.4.14.1 | https://opam.ocaml.org#8b5a0a33
# path        ~/.opam/ocaml4.14.1/.opam-switch/build/lablgtk3.3.1.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 7
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-41437-779266.env
# output-file ~/.opam/log/lablgtk3-41437-779266.out
### output ###
# [...]
# ml_gtktree.c: In function ‘custom_model_ref_node’:
# ml_gtktree.c:1445:20: warning: "callback2" is deprecated: use "caml_callback2" instead
#  1445 |         callback2(method, callback_object, row);})}}
#       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                            
# ml_gtktree.c: In function ‘custom_model_unref_node’:
# ml_gtktree.c:1459:20: warning: "callback2" is deprecated: use "caml_callback2" instead
#  1459 |         callback2(method, callback_object, row);})}}
#       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                            
# ml_gtktree.c: In function ‘ml_gtk_tree_view_get_visible_range’:
# ml_gtktree.c:1588:13: warning: "alloc_tuple" is deprecated: use "caml_alloc_tuple" instead
#  1588 |      result = alloc_tuple(2);
#       |             ^~~~~~~~~~~~~~~~~                                                

My distribution is Archlinux and my version of gtk is 3.24.41-1.

The complete output of gcc: https://pastebin.com/w71RqJJi The only error message in the output of gcc is:

In file included from ml_gtk.c:36:
ml_gtk.c: In function ‘ml_gtk_style_context_list_classes’:
wrappers.h:422:20: error: passing argument 2 of ‘Val_GList’ from incompatible pointer type [-Wincompatible-pointer-types]
  422 | #define Val_string copy_string_check
      |                    ^~~~~~~~~~~~~~~~~
      |                    |
      |                    value (*)(const char *) {aka long int (*)(const char *)}
ml_gtk.c:236:78: note: in expansion of macro ‘Val_string’
Halbaroth commented 5 months ago

My bad, I used an experimental version of gcc. I recompiled ocamlc with gcc 13.2.1 and now it works :)

garrigue commented 3 months ago

This seems to be the same error as #178, so this is now fixed.