Opened 8 weeks ago

Closed 7 weeks ago

#69467 closed defect (fixed)

graphviz @9.0.0: libtool: Version mismatch error

Reported by: astrofitz (Michael Fitzgerald) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: haspatch Cc: mascguy (Christopher Nielsen), maxim-zakharov-seetreat, arielp
Port: graphviz

Description

After upgrading to Sonoma, the build of graphviz @9.0.0 fails with the following libtool version mismatch errors. I have tried on Sonoma 14.3.1 and 14.4. I am using Xcode 15.3. Incidentally, during the build a pop-up appears noting that m4 requires command-line tools, but I have those installed (corresponding to Xcode 15.3).

The relevant build messages look like:

:info:build libtool: Version mismatch error.  This is libtool 2.4.6 Debian-2.4.6-14, but the
:info:build libtool: definition of this LT_INIT comes from libtool 2.4.7.
:info:build libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 Debian-2.4.6-14
:info:build libtool: and run autoconf again.

Full log file attached.

This may be related to #67996.

Attachments (1)

graphviz-main.log (192.1 KB) - added by astrofitz (Michael Fitzgerald) 8 weeks ago.
build log

Download all attachments as: .zip

Change History (12)

Changed 8 weeks ago by astrofitz (Michael Fitzgerald)

Attachment: graphviz-main.log added

build log

comment:1 Changed 8 weeks ago by ryandesign (Ryan Carsten Schmidt)

Summary: graphviz @9.0.0 build fails on Sonoma, libtool version mismatchgraphviz @9.0.0: libtool: Version mismatch error

We are running autoreconf in the graphviz port which should be regenerating aclocal.m4 and everything else about the autotools build system with new copies from MacPorts; MacPorts libtool is at version 2.4.7.

It looks like graphviz has two aclocal.m4 files—one at the root level and one in the libltdl directory—but when I run configure, both of them get updated.

This is not a general macOS Sonoma problem. We had successful builds of graphviz on every OS version on our buildbot system, most recently on macOS Sonoma in January 2024. We are not yet using Xcode 15.3 yet however so it is possible that something new has broken there. libtool has been at 2.4.7 since April 2022 so that hasn't been a problem before.

Here's the response one of the developers of Graphviz received on the libtool mailing list when this happened to them 15 years ago:

https://lists.gnu.org/archive/html/bug-libtool/2009-01/msg00023.html

I'm not certain yet whether any of the suggestions there apply in this case. Does the problem persist if you sudo port clean graphviz and then try again?

The message you mentioned about m4 requiring the command-line tools, despite those being installed, is also very strange. Such messages should only be coming from Apple's wrapper programs like /usr/bin/m4 but the build shouldn't be using that; it should be using /opt/local/bin/gm4. And even if /usr/bin/m4 were used, it shouldn't say to install something that's already installed. (And the fact that it says that would be out of our control to fix, since that's Apple software.) It might be worth trying to reinstall the command line tools manually using the installer even though they appear already to be installed.

comment:2 in reply to:  1 ; Changed 8 weeks ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

Such messages should only be coming from Apple's wrapper programs like /usr/bin/m4 but the build shouldn't be using that; it should be using /opt/local/bin/gm4.

I am surprised that I appear to be partly wrong about this. autoconf does use MacPorts m4:

% port deps autoconf
Full Name: autoconf @2.72_0
Extract Dependencies: xz
Library Dependencies: m4
% port -q contents autoconf | xargs grep -E 'bin/g?m4'
/opt/local/bin/autom4te:my $m4 = $ENV{"M4"} || '/opt/local/bin/gm4';
/opt/local/bin/autoupdate:my $m4 = $ENV{"M4"} || '/opt/local/bin/gm4';

But libtool uses Apple's m4:

% port deps libtool                              
libtool @2.4.7_1 has no dependencies.
% port -q contents libtool | xargs grep -E 'bin/g?m4'
/opt/local/bin/glibtool:M4="/usr/bin/m4"$
/opt/local/bin/glibtoolize:: ${M4="/usr/bin/m4"}
/opt/local/libexec/gnubin/libtool:M4="/usr/bin/m4"$
/opt/local/libexec/gnubin/libtoolize:: ${M4="/usr/bin/m4"}

And this is apparently intentional, per #47545. libtool only uses MacPorts m4 on Tiger because the m4 Tiger shipped with is too old. You could try making libtool use MacPorts m4 on your system: edit the libtool Portfile to make this change:

  • devel/libtool/Portfile

    a b post-patch { 
    4242# 1.4.2 does not (#47545).
    4343#   - https://lists.gnu.org/archive/html/libtool/2014-12/msg00002.html
    4444#   - https://lists.gnu.org/archive/html/libtool/2015-01/msg00004.html
    45 if {${os.platform} eq "darwin" && ${os.major} >= 9} {
     45if {false} {
    4646    configure.env   M4=/usr/bin/m4
    4747} else {
    4848    depends_lib     port:m4

Then rebuild libtool with:

sudo port -ns upgrade --force libtool

That should at least eliminate Apple's message about installing the command line tools, but whether it will help with the version mismatch error I don't know.

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

It looks like the problem is that ltmain.sh is not getting updated correctly.

:info:configure glibtoolize: putting auxiliary files in '.'.
:info:configure glibtoolize: copying file './ltmain.sh'

But the existing one, which clearly ends up getting used, is in the config subdir.

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

Replying to jmroot:

It looks like the problem is that ltmain.sh is not getting updated correctly.

:info:configure glibtoolize: putting auxiliary files in '.'.
:info:configure glibtoolize: copying file './ltmain.sh'

But the existing one, which clearly ends up getting used, is in the config subdir.

I did notice that difference between Michael's log and mine. In mine, those files do go into the config directory.

Replying to astrofitz:

Incidentally, during the build a pop-up appears noting that m4 requires command-line tools, but I have those installed (corresponding to Xcode 15.3).

We received another report of this in #69471.

comment:5 in reply to:  2 Changed 8 weeks ago by astrofitz (Michael Fitzgerald)

I tried the patch to libtool as suggested, and graphviz successfully compiled (and runs). The build of the patched libtool did have some of the m4 pop-up messages.

comment:6 Changed 8 weeks ago by kencu (Ken)

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:7 in reply to:  2 Changed 8 weeks ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

Replying to ryandesign:

You could try making libtool use MacPorts m4 on your system:

https://github.com/macports/macports-ports/pull/22984 makes this change.

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

Replying to kencu:

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

I've filed bug FB13684598 with Apple about this.

comment:9 Changed 7 weeks ago by maxim-zakharov-seetreat

Cc: maxim-zakharov-seetreat added

comment:10 Changed 7 weeks ago by ryandesign (Ryan Carsten Schmidt)

Cc: arielp added

Has duplicate #69500.

comment:11 Changed 7 weeks ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.