[MacPorts] #60853: port mysql8 @8.0.21 fails to build on less than macOS 10.12 due to system libc++ being too old

MacPorts noreply at macports.org
Mon Feb 22 01:02:26 UTC 2021


#60853: port mysql8 @8.0.21 fails to build on less than macOS 10.12 due to system
libc++ being too old
----------------------------+-------------------------
  Reporter:  wadjei         |      Owner:  herbygillot
      Type:  defect         |     Status:  assigned
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.6.2
Resolution:                 |   Keywords:  mavericks
      Port:  mysql8 libcxx  |
----------------------------+-------------------------

Comment (by kencu):

 Replying to [comment:17 BjarneDMat]:
 > Having done that, mysql8 @8.0.23 fails to compile
 > log here :
 https://macports.mathiesen.info/logs/databases/mysql8/main.log3
 >
 > According to https://mariadb.org/wp-
 content/uploads/2020/09/migration_serverfest2020.pdf slide #9, there's no
 current mariadb equivalent to mysql8

 your build error is:
 {{{
 :info:build
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mysql8/mysql8/work/mysql-8.0.23/storage/temptable/include/temptable/kv_store.h:76:50:
 error: 'shared_timed_mutex' is unavailable: introduced in macOS 10.12
 }}}

 Here is the reason, and the solution:

 On macOS, Apple and their llvm-related engineers believe you would never
 change the libc++.dylib that comes with the system. That's pretty fair,
 most everyone would not change it. But -- we're not everyone, are we? We
 have installed a version of libc++.dylib on 10.6.8 that is *newer* than
 the one that comes with 10.12. Apple never thought we would do that.

 Apple has helpfully listed certain functions, such as
 {{{shared_timed_mutex}}} as not existing until macOS 10.12, and will give
 you an error (as you see) if you try to use those functions on systems
 older than that. They don't do a functional test for them -- they own the
 OS after all -- they do a system version test for them. But -- we have a
 newer libc++.dylib, and that doesn't apply to us.

 For clang-8.0 and clang-9.0, I patched out that test like this
 <https://github.com/macports/macports-
 ports/blob/master/lang/llvm-9.0/files/5005-MacPorts-only-patch-libcxx-
 includes-disable-availability-tests.diff>. But -- clang-7.0 is old, and I
 didn't do that patch in clang-7.0. My Bad.

 Now here comes the perfect storm -- we (I) forced mysql8 to build with
 clang-7.0 because (back then) clang-8+ failed to build it.  Then after I
 did that, mysql8 added the new function, which clang-7.0 says is not
 available (but really it is ). Ergo build error on 10.6.8.

 SHORT story:

 Do this <https://github.com/macports/macports-
 ports/blob/master/lang/llvm-9.0/files/5005-MacPorts-only-patch-libcxx-
 includes-disable-availability-tests.diff> in your clang-7.0 headers and it
 will build.

-- 
Ticket URL: <https://trac.macports.org/ticket/60853#comment:19>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list