Opened 8 months ago

Closed 6 months ago

Last modified 4 months ago

#69471 closed defect (fixed)

gtk2 @2.24.33_3+quartz fails to build: incompatible function pointer types

Reported by: DrLex0 (Alexander Thomas) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: Cc: DrLex0 (Alexander Thomas), jp-hoehmann (Jean-Pierre Höhmann)
Port: gtk2 gimp

Description (last modified by DrLex0 (Alexander Thomas))

I am attempting to upgrade my MacPorts to Sonoma. First I tried the restore_ports.tcl script, the gtk2 build failed with “Requested variants” mismatch.

So, I again wiped everything (sudo port -f uninstall installed), and re-executed the same commands from scratch as I had used to install things under Mojave. The first command already failed:

sudo port install gimp +quartz -x11

For some reason the gtk2 build always causes the “Install Command Line Developer Tools.app” to be launched, claiming that “The "m4" command requires the command line developer tools,” even though they are already installed. I re-installed them just to be sure, it made no difference. I guess this is unrelated to the actual failure.

The gtk2 build fails; digging into the log reveals this error:

:info:build gtkscale.c:1474:50: error: incompatible function pointer types passing 'GCompareFunc' (aka 'int (*)(const void *, const void *)') to parameter of type 'GCompareDataFunc' (aka 'int (*)(const void *, const void *, void *)') [-Wincompatible-function-pointer-types]
:info:build                                                  (GCompareFunc) compare_marks,
:info:build                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/include/glib-2.0/glib/gslist.h:76:26: note: passing argument to parameter 'func' here
:info:build                                           GCompareDataFunc  func,

Full build log attached.

Absolutely nothing to be found about this (but maybe that's just because Google is useless nowadays). I can't be the first trying to install gtk2 +quartz in Sonoma?

I rely heavily on GIMP, and the MacPorts build is the most usable from what is available, moreover I also want to reinstall some other programs that rely on gtk2, so I hope this can be fixed quickly.

Attachments (1)

main.log.bz2 (60.9 KB) - added by jmroot (Joshua Root) 8 months ago.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 8 months ago by DrLex0 (Alexander Thomas)

Cc: DrLex0 added
Port: gtk2 gimp added
Version: 2.9.1

comment:2 Changed 8 months ago by DrLex0 (Alexander Thomas)

Description: modified (diff)

Changed 8 months ago by jmroot (Joshua Root)

Attachment: main.log.bz2 added

comment:3 Changed 8 months ago by jmroot (Joshua Root)

Owner: set to mascguy
Status: newassigned

comment:4 in reply to:  description Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to DrLex0:

For some reason the gtk2 build always causes the “Install Command Line Developer Tools.app” to be launched, claiming that “The "m4" command requires the command line developer tools,” even though they are already installed.

We had another report of this in #69467 yesterday, also using Xcode 15.3, but this error is new to me. Xcode 15.3 was just released five days ago. Maybe Apple broke something in this version of Xcode. I made a suggestion in comment:ticket:69467:2 for how to possibly avoid this message. Let us know if that eliminates that message, and whether it improves the gtk2 build problem, being sure to clean gtk2 before trying again. If you just want to work around the problem without spending time investigating, you could downgrade to Xcode 15.2. If you do that, also downgrade to the Xcode 15.2 version of the command line tools to maintain a matched set.

The gtk2 build fails; digging into the log reveals this error:

:info:build gtkscale.c:1474:50: error: incompatible function pointer types passing 'GCompareFunc' (aka 'int (*)(const void *, const void *)') to parameter of type 'GCompareDataFunc' (aka 'int (*)(const void *, const void *, void *)') [-Wincompatible-function-pointer-types]
:info:build                                                  (GCompareFunc) compare_marks,
:info:build                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/include/glib-2.0/glib/gslist.h:76:26: note: passing argument to parameter 'func' here
:info:build                                           GCompareDataFunc  func,

Full build log attached.

Absolutely nothing to be found about this (but maybe that's just because Google is useless nowadays). I can't be the first trying to install gtk2 +quartz in Sonoma?

We have had successful automated builds of gtk2 without +quartz on all macOS versions including Sonoma but we don't do automated builds of non-default variants and we're not using Xcode 15.3 on our build machines yet. This error may be new in the version of clang included in Xcode 15.3.

comment:5 Changed 8 months ago by DrLex0 (Alexander Thomas)

I have managed to get it to build, by manually editing 2 files inside the gtk2/work/gtk+-2.24.33 dir:

  1. I compared what macports tries to build, against the latest gtk2 source, and dropped the (GCompareFunc) in line 1474 of gtk/gtkscale.c
  2. Fixed tests/testmenubars.c: add missing int type to depth parameter, drop superfluous TRUE arguments from invocations of this function. This file can never have compiled, except maybe with some really ancient lenient compiler. No idea why it is now being compiled, the latest gtk2 source no longer has this file anyhow, so the proper fix is probably to just delete it…

After this, gimp2 build succeeded. But, gutenprint build failed because of this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269972 So, I also manually patched it, and now I have a working GIMP again.

comment:6 Changed 8 months ago by DrLex0 (Alexander Thomas)

I didn't have to fix anything about the m4 message, it only seems to be a nuisance but it doesn't interfere with the builds.

comment:7 in reply to:  5 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to DrLex0:

But, gutenprint build failed because of this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269972

I filed #69472 for this.

comment:8 Changed 8 months ago by kencu (Ken)

would you be able to point to the branch where you are finding the newer commits to gtk2?

macports is building the latest release, and I'm having trouble spotting the development branch of gtk2 on the gnome website anywhere to look at what they have done since the release..

I also patched gtk2 with some slightly different patches than what you describe, to the same end result. (And I see the m4 nuisance as well).

comment:9 in reply to:  8 ; Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

(And I see the m4 nuisance as well).

Does the change I proposed in comment:ticket:69467:2 make that problem go away?

comment:10 in reply to:  8 Changed 8 months ago by DrLex0 (Alexander Thomas)

Replying to kencu:

would you be able to point to the branch where you are finding the newer commits to gtk2?

macports is building the latest release, and I'm having trouble spotting the development branch of gtk2 on the gnome website anywhere to look at what they have done since the release..

I also patched gtk2 with some slightly different patches than what you describe, to the same end result. (And I see the m4 nuisance as well).

I wildly googled around and stumbled upon this: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkscale.c Curiously, the commit that removed the (GCompareFunc) cast was 12 years ago. Line numbers are also totally different. I guess this is gtk3 source, and this change may not have been applied in gtk2.

comment:11 in reply to:  9 ; Changed 8 months ago by kencu (Ken)

Replying to ryandesign:

Replying to kencu:

(And I see the m4 nuisance as well).

Does the change I proposed in comment:ticket:69467:2 make that problem go away?

It appears that Apple forgot to put "m4" in the CommandLineTools:

% ls /Library/Developer/CommandLineTools/usr/bin | grep m4                                         
gm4

but did put it in Xcode:

% ls /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin | grep m4
bm4
gm4
m4

so when the DevloperDir is set to the CLTs, it triggers the installation prompt:

 % DEVELOPER_DIR=/Library/Developer/CommandLineTools m4
xcode-select: Failed to locate 'm4', requesting installation of command line developer tools.

comment:12 Changed 8 months ago by kencu (Ken)

I'm trying this out:

% sudo ln -s /Library/Developer/CommandLineTools/usr/bin/gm4 /Library/Developer/CommandLineTools/usr/bin/m4

comment:13 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

In 48589c81916ab6bd8fa2d696a8b7a49d8c751dd6/macports-ports (master):

libtool: Use MacPorts m4

Fixes build of many ports that use libtool when using Xcode 15.3 in
which m4 is not included.

Closes: #69467
Closes: #69481
Closes: #69493
See: #69471

Reverses a previous decision not to use MacPorts m4 except on Tiger:

See: #47545

as it was already reversed in autoconf:

See: #62411

comment:14 Changed 7 months ago by jp-hoehmann (Jean-Pierre Höhmann)

Not sure if this is helpful, but I just downgraded XCode and the command line tools to 15.2 and the error stays the same.

comment:15 Changed 7 months ago by Christopher Nielsen <mascguy@…>

In a9bce4f091b3d87b5b031bc5437c068e6214e78a/macports-ports (master):

gtk2-devel: patch source issues

  • Drop experimental variant 'bit_depth_1'
  • Disable silent rules
  • Reduce warnings

See: #69471

comment:16 in reply to:  14 ; Changed 7 months ago by mascguy (Christopher Nielsen)

Cc: jp-hoehmann added

Replying to jp-hoehmann:

Not sure if this is helpful, but I just downgraded XCode and the command line tools to 15.2 and the error stays the same.

Jean-Pierre, are you referring to the issues related to m4? Or the other build errors?

comment:17 Changed 7 months ago by Christopher Nielsen <mascguy@…>

In ffd9c6e4be106d3922c69d9c81afaa12111767fa/macports-ports (master):

gtk2: patch source issues

  • Disable silent rules
  • Reduce warnings

See: #69471

comment:18 in reply to:  16 ; Changed 6 months ago by jp-hoehmann (Jean-Pierre Höhmann)

Replying to mascguy:

Jean-Pierre, are you referring to the issues related to m4? Or the other build errors?

Sorry, I should have specified. I am getting the same build error. I see the issue with m4 as well, but that one shows up only under 15.3.

comment:19 in reply to:  18 Changed 6 months ago by mascguy (Christopher Nielsen)

Replying to jp-hoehmann:

Replying to mascguy:

Jean-Pierre, are you referring to the issues related to m4? Or the other build errors?

Sorry, I should have specified. I am getting the same build error. I see the issue with m4 as well, but that one shows up only under 15.3.

Makes sense, thanks for clarifying. And a fix was made for the issue you're experiencing.

Can you re-sync your ports with sudo port selfupdate, and then try the installation again?

comment:20 Changed 6 months ago by jp-hoehmann (Jean-Pierre Höhmann)

Jup, works now! Thanks for the work you do :-)

comment:21 in reply to:  20 Changed 6 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Replying to jp-hoehmann:

Jup, works now! Thanks for the work you do :-)

Great, glad the issue is resolved!

comment:22 in reply to:  11 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

It appears that Apple forgot to put "m4" in the CommandLineTools:

Apple notified me that they fixed it in Xcode CLT 16 beta 3 and I verified it seems to be fixed in 16 beta, 16 beta 2, and 16 beta 3.

Note: See TracTickets for help on using tickets.