#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)
Change History (23)
comment:1 Changed 9 months ago by DrLex0 (Alexander Thomas)
Cc: | DrLex0 added |
---|---|
Port: | gtk2 gimp added |
Version: | → 2.9.1 |
comment:2 Changed 9 months ago by DrLex0 (Alexander Thomas)
Description: | modified (diff) |
---|
Changed 9 months ago by jmroot (Joshua Root)
Attachment: | main.log.bz2 added |
---|
comment:3 Changed 9 months ago by jmroot (Joshua Root)
Owner: | set to mascguy |
---|---|
Status: | new → assigned |
comment:4 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)
comment:5 follow-up: 7 Changed 9 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:
- I compared what macports tries to build, against the latest gtk2 source, and dropped the
(GCompareFunc)
in line 1474 of gtk/gtkscale.c - Fixed tests/testmenubars.c: add missing
int
type todepth
parameter, drop superfluousTRUE
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 9 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 Changed 9 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 follow-ups: 9 10 Changed 9 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 follow-up: 11 Changed 9 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 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 follow-up: 22 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)
comment:14 follow-up: 16 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@…>
comment:16 follow-up: 18 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@…>
comment:18 follow-up: 19 Changed 7 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 Changed 7 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 follow-up: 21 Changed 7 months ago by jp-hoehmann (Jean-Pierre Höhmann)
Jup, works now! Thanks for the work you do :-)
comment:21 Changed 7 months ago by mascguy (Christopher Nielsen)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to jp-hoehmann:
Jup, works now! Thanks for the work you do :-)
Great, glad the issue is resolved!
comment:22 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.
Replying to DrLex0:
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.
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.