Opened 7 months ago

Closed 4 weeks ago

Last modified 4 weeks ago

#69428 closed defect (fixed)

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), Mikedafish, jasimon9
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) 7 months ago.
gzipped log file when trying to install

Download all attachments as: .zip

Change History (34)

Changed 7 months ago by amstilp (Adrienne Stilp)

Attachment: main.log.gz added

gzipped log file when trying to install

comment:1 Changed 7 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 7 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

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

Owner: set to michaelld
Status: newassigned

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

Port: libxml2 added

comment:4 Changed 7 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 7 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 7 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 7 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 7 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 7 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 7 months ago by kencu (Ken) (previous) (diff)

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

Cc: markuz added

comment:10 in reply to:  6 Changed 6 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 5 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: hbsimon added

Has duplicate #69708.

comment:12 Changed 4 months 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 4 months 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).

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

Cc: Mikedafish added

Has duplicate #70448.

comment:15 Changed 5 weeks ago by jasimon9

I have oepned #70582 which has been closed as a duplicate of this ticket.

What is the plan for a workaround to this issue? Abandon mariadb from Macports?

comment:16 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

Cc: jasimon9 added

The ticket is assigned to the ports' maintainer. The hope is that the maintainer would update those ports that have updates and backport the fix to those that don't, but that hasn't happened. Anyone else can contribute these improvements by filing a pull request.

comment:17 Changed 5 weeks ago by jasimon9

Another idea: is there are version of mariadb that is known to install without issues?

comment:18 Changed 5 weeks ago by jmroot (Joshua Root)

I had a look at updating these and gave up before long because it became clear I didn't have the time to do it that day, as I suspect others have done before me. Unfortunately these ports are daunting even for experienced port authors. Just as one example, it looks like they could be simplified by using the official release tarballs instead of GitHub generated archives, but I don't know if the original author had a good reason for doing it that way.

Last edited 5 weeks ago by jmroot (Joshua Root) (previous) (diff)

comment:19 Changed 5 weeks ago by jmroot (Joshua Root)

In 85498b117eb616f3a6aa7d1e1a5588fadd7e4e28/macports-ports (master):

mariadb-10.11: update to 10.11.9

Maintainer timeout.

Fixes compatibility with latest libxml2. Also switch to building from
the official release tarball.

See: #69428

comment:20 Changed 5 weeks ago by jmroot (Joshua Root)

So that's 10.11 updated, which is the latest LTS version we have in MacPorts. I might get to the others at some point, but no promises. Please feel more than welcome to beat me to it.

Michael, if there are any issues introduced by the update, please let me know.

comment:21 Changed 4 weeks ago by jmroot (Joshua Root)

In 5d1059c2aa6b186afc0eda17070f8e813f463aae/macports-ports (master):

mariadb-10.6: update to 10.6.19

Maintainer timeout.

Fixes compatibility with latest libxml2. Also switch to building from
the official release tarball.

See: #69428

comment:22 Changed 4 weeks ago by jmroot (Joshua Root)

In 2b5435d5c56867aa9d95e1427556995056252302/macports-ports (master):

mariadb-10.5: update to 10.5.26

Fixes compatibility with latest libxml2. Also switch to building from
the official release tarball.

See: #69428

comment:23 Changed 4 weeks ago by jmroot (Joshua Root)

In 90e01c2bf3e594bbea39dd95ed9772fa5f016ebb/macports-ports (master):

mariadb-10.4: update to 10.4.34, apply libxml2 fix

Also switch to building from the official release tarball.

See: #69428

comment:24 Changed 4 weeks ago by jasimon9

Unfortunately this install still fails for me. Is there something I need to do to "switch from the official release tarball"?

Here is what I still get:

sudo port install mariadb-10.6-server
Password:
--->  Computing dependencies for mariadb-10.6-server
The following dependencies will be installed:  mariadb-10.6
Continue? [Y/n]: Y
--->  Fetching archive for mariadb-10.6
--->  Attempting to fetch mariadb-10.6-10.6.11_0.darwin_22.x86_64.tbz2 from http://mirror.fcix.net/macports/packages/mariadb-10.6
--->  Attempting to fetch mariadb-10.6-10.6.11_0.darwin_22.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/mariadb-10.6
--->  Attempting to fetch mariadb-10.6-10.6.11_0.darwin_22.x86_64.tbz2 from https://mirrors.mit.edu/macports/packages/mariadb-10.6
--->  Building mariadb-10.6
Error: Failed to build mariadb-10.6: 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.6/mariadb-10.6/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.6-server failed
iMac3:~ jas$ 

comment:25 Changed 4 weeks ago by jmroot (Joshua Root)

You're still installing mariadb 10.6.11, so you need to update your ports with port selfupdate or port sync. When your ports tree is updated you will be installing 10.6.19.

comment:26 Changed 4 weeks ago by jmroot (Joshua Root)

In f195e8cd12ea1c6755289991c4f4ad9ce3183c01/macports-ports (master):

mariadb-10.10: update to 10.10.7, apply libxml2 fix

Also switch to building from the official release tarball.

See: #69428

comment:27 Changed 4 weeks ago by jmroot (Joshua Root)

In d14276035aeaa534bf9e12ed4aa7711082af9d6a/macports-ports (master):

mariadb-10.9: update to 10.9.8, apply libxml2 fix

Also switch to building from the official release tarball.

See: #69428

comment:28 Changed 4 weeks ago by jasimon9

mariadb-10.6 now builds!

I updated the ports tree. After the update, the rebuild was now looking for 10.6.19 as you can see below. Plus there was an interesting message at the start of the install about the portfile having changed:

sudo port install mariadb-10.6-server
Portfile for mariadb-10.6-server changed since last build; discarding previous state.
--->  Computing dependencies for mariadb-10.6-server
The following dependencies will be installed:  mariadb-10.6
Continue? [Y/n]: Y
Portfile for mariadb-10.6 changed since last build; discarding previous state.
--->  Fetching archive for mariadb-10.6
--->  Attempting to fetch mariadb-10.6-10.6.19_0.darwin_22.x86_64.tbz2 from https://packages.macports.org/mariadb-10.6

The build completed normally afterwards.

Thanks to the maintainers!

Last edited 4 weeks ago by jasimon9 (previous) (diff)

comment:29 Changed 4 weeks ago by amstilp (Adrienne Stilp)

mariadb-10.6 also builds for me after port selfupdate. Thank you!

comment:30 Changed 4 weeks ago by jmroot (Joshua Root)

In 26d3baeae82f3ef552406bf1dfb42e74f2ca0fc4/macports-ports (master):

mariadb-10.3: update to 10.3.39, apply libxml2 fix

Also switch to building from the official release tarball.

See: #69428

comment:31 Changed 4 weeks ago by jmroot (Joshua Root)

In 4a3f2b83fa6751efc134802d8648fd6d404ae82c/macports-ports (master):

mariadb-10.8: update to 10.8.8, apply libxml2 fix

Also switch to building from the official release tarball.

See: #69428

comment:32 Changed 4 weeks ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

In d3bf49cf9d0a7226a93f2acb026c801abb1c5e38/macports-ports (master):

mariadb-10.7: update to 10.7.8, apply libxml2 fix

Also switch to building from the official release tarball.

Closes: #69428

comment:33 Changed 4 weeks ago by jmroot (Joshua Root)

The remaining versions have been EOL for at least two years and should probably just be marked as obsolete.

Note: See TracTickets for help on using tickets.