Opened 3 months ago

Last modified 3 weeks ago

#69428 assigned defect

mariadb*: fails to build with libxml2 2.12.x

Reported by: amstilp (Adrienne Stilp) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: markuz (Marco Antonio Islas Cruz), hbsimon (Horst Simon), Kirkman (Josh Renaud)
Port: mariadb mariadb-10.0 mariadb-10.1 mariadb-10.2 mariadb-10.3 mariadb-10.4 mariadb-10.5 mariadb-10.6 mariadb-10.7 mariadb-10.8 mariadb-10.9 mariadb-10.10 mariadb-10.11

Description

When attempting to install on a clean install of Macports, I get this error:

--->  Building mariadb-10.4                              
Error: Failed to build mariadb-10.4: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.4/mariadb-10.4/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port mariadb-10.4 failed

I have an m1x macbook pro. I got the same error in both MacOS 10.13 (Ventura) and 10.14 (Sonoma). Previous installs of the port in Ventura worked fine (~1 year ago). I'm attaching the full log - possibly an error with libxml2?

I've also tried MariaDB 10.5, 10.6, and 10.11, and all fail to build with similar errors.

Attachments (1)

main.log.gz (220.1 KB) - added by amstilp (Adrienne Stilp) 3 months ago.
gzipped log file when trying to install

Download all attachments as: .zip

Change History (14)

Changed 3 months ago by amstilp (Adrienne Stilp)

Attachment: main.log.gz added

gzipped log file when trying to install

comment:1 Changed 3 months ago by kencu (Ken)

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.4/mariadb-10.4/work/server-mariadb-10.4.27/storage/connect/libdoc.cpp:1094:17: error: assigning to 'xmlErrorPtr' (aka '_xmlError *') from 'const xmlError *' (aka 'const _xmlError *') discards qualifiers
:info:build     if ((xerr = xmlGetLastError()))
:info:build                 ^~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.4/mariadb-10.4/work/server-mariadb-10.4.27/storage/connect/libdoc.cpp:1099:17: error: assigning to 'xmlErrorPtr' (aka '_xmlError *') from 'const xmlError *' (aka 'const _xmlError *') discards qualifiers
:info:build     if ((xerr = xmlGetLastError()))
:info:build                 ^~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.4/mariadb-10.4/work/server-mariadb-10.4.27/storage/connect/libdoc.cpp:1106:15: error: assigning to 'xmlErrorPtr' (aka '_xmlError *') from 'const xmlError *' (aka 'const _xmlError *') discards qualifiers
:info:build   if ((xerr = xmlGetLastError()))
:info:build               ^~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.4/mariadb-10.4/work/server-mariadb-10.4.27/storage/connect/libdoc.cpp:1111:15: error: assigning to 'xmlErrorPtr' (aka '_xmlError *') from 'const xmlError *' (aka 'const _xmlError *') discards qualifiers
:info:build   if ((xerr = xmlGetLastError()))
:info:build               ^~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.4/mariadb-10.4/work/server-mariadb-10.4.27/storage/connect/libdoc.cpp:1116:15: error: assigning to 'xmlErrorPtr' (aka '_xmlError *') from 'const xmlError *' (aka 'const _xmlError *') discards qualifiers
:info:build   if ((xerr = xmlGetLastError()))
:info:build               ^~~~~~~~~~~~~~~~~
:info:build 2 warnings and 12 errors generated.

yes, there was an unfortunate API change with libxml2 2.12+.

Unfortunately it is going to be likely that a whole lot of things are now broken.

See for example:

[915fbf4e3d488321c05f7ff2123282979bb9af46/macports-ports]

Last edited 3 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

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

Owner: set to michaelld
Status: newassigned

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

Port: libxml2 added

comment:4 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

Port: mariadb mariadb-10.0 mariadb-10.1 mariadb-10.2 mariadb-10.3 mariadb-10.6 mariadb-10.7 mariadb-10.8 mariadb-10.9 mariadb-10.10 added; libxml2 removed
Summary: Mariadb fails to build on MacOS Ventura/Sonomamariadb-10.*: fails to build with libxml2 2.12.x

Adding all mariadb ports to the port field since it's likely all are affected. Removing libxml2 because I presume this is not a libxml2 bug but an intended change.

comment:5 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: mariadb-10.*: fails to build with libxml2 2.12.xmariadb*: fails to build with libxml2 2.12.x

comment:6 Changed 3 months ago by blair (Blair Zajac)

Looking at the previous libxml2 2.11.5 the --with-legacy configure flag already existed, so I'm guessing it wouldn't help in the 2.12.5 upgrade. Doing a recursive diff between 2.11.5 and 2.12.5 doesn't show any additional places where LIBXML_LEGACY_ENABLED is used, although there could be new code added between an #ifdef LIBXML_LEGACY_ENABLED and #endif pair (I didn't check).

In include/libxml/xmlerror.h the diff is this and it's not protected by LIBXML_LEGACY_ENABLED so it seems all callbacks will need to do a patch similar to webkit2-gtk's in [915fbf4e3d488321c05f7ff2123282979bb9af46/macports-ports]

@@ -855,7 +856,28 @@
  * Signature of the function to use when there is an error and
  * the module handles the new error reporting mechanism.
  */
-typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
+typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
+

There's this upstream bug https://github.com/MariaDB/server/pull/2983 and PR: https://github.com/MariaDB/server/pull/2983 would could be pulled into MacPorts.

Last edited 3 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 3 months ago by kencu (Ken)

All ports that use libxml2 will likely be affected.

However many that is.

So that is why libxml2 was added here.

Eventually all the hundreds of ports that use libxml2 will have to individually adapt (there are currently 615 of them listed).

Yuk.

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

OK -- well clearly things are going to be widely broken for port rebuilds for a long, long time to come.

How many of those ports that use libxml2 use the changed error API time will tell.

I think -- I will roll back to libxml2 2.11.x and let the dust settle for a year or so.

Last edited 3 months ago by kencu (Ken) (previous) (diff)

comment:9 Changed 3 months ago by markuz (Marco Antonio Islas Cruz)

Cc: markuz added

comment:10 in reply to:  6 Changed 3 months ago by barracuda156

There's this upstream bug https://github.com/MariaDB/server/pull/2983 and PR: https://github.com/MariaDB/server/pull/2983 would could be pulled into MacPorts.

I guess we just need to update the port, since it has been merged.

comment:11 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: hbsimon added

Has duplicate #69708.

comment:12 Changed 3 weeks ago by Kirkman (Josh Renaud)

I am new to MacPorts and trying to understand how to work around this issue until it is fixed. (It's preventing me from installing a bunch of key things). The ProblemHotlist doesn't mention the libxml2 issue, so that's no help.

*Is* there a way for users to work around it? Is there a way to install an older version, maybe?

comment:13 Changed 3 weeks ago by ryandesign (Ryan Carsten Schmidt)

Cc: Kirkman added

If tickets are not already filed for the other "key things" that are not building (aside from mariadb* and the ports that depend on mariadb*) please file new tickets.

Users can install older ports following wiki:howto/InstallingOlderPort however what you're proposing is installing an older libxml2 prior to 2.12.x which will probably lead you to other problems since other ports have already been fixed to build with libxml2 2.12.x (but not necessarily pre-2.12.x libxml2 anymore).

The better solution is for someone to update the mariadb* ports to fixed versions where upstream has already fixed it (mariadb-10.5 needs to be updated to 10.5.25, for example) and backport the upstream fix to the earlier mariadb* ports that won't receive the upstream fix (mariadb-10.4 and earlier).

Note: See TracTickets for help on using tickets.