As noted in the libc++ 19 release notes [1], std::char_traits<> is now only provided for char, char8_t, char16_t, char32_t and wchar_t, and any instantiation for other types will fail. This causes databases/mysql80-client to fail to compile with clang 19 and libc++ 19, resulting in errors similar to: /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>' 820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, | ^ /wrkdirs/usr/ports/databases/mysql80-client/work/mysql-8.0.39/sql/rpl_log_encryption.h:821:14: note: in instantiation of template class 'std::basic_string<unsigned char>' requested here 821 | Key_string m_encrypted_password; | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ `Key_string` is defined as `std::basic_string<unsigned char>`, which is no longer possible. So redefine it as a `std::vector<unsigned char>` instead. This requires only a few small adjustments in other places: replacing the `length()` method with the equivalent `size()` method, and adjusting the arguments for the `assign()` method, which for `std::vector` takes a begin and end iterator, instead of a begin iterator and a size. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals
Created attachment 252615 [details] databases/mysql80-client: fix build with libc++ 19
Created attachment 252897 [details] databases/mysql80-server: fix build with libc++ 19 (v2) (In reply to Jochen Neumeister from comment #2) Sorry, this was a screw-up from my side. I missed that the client port is really a slave of the server port, and that the server port compiles quite bit _more_ code, some of which also needs fixing! I updated the patch to fix the rest of the errors that occur.
Created attachment 253005 [details] databases/mysql80-server: fix build with libc++ 19 (v3) Added two additional files to the patch to also ensure the "make test" target succeeds.
If it's possible I would like to get these mysql fixes in relatively soon, so I can request another exp-run for bug 280562.
Created attachment 253094 [details] databases/mysql80-server: fix build with libc++ 19 (v4) (In reply to Jochen Neumeister from comment #8) Okay, this was due to the diff line that deleted "#include <string>" from sql/stream_cipher.h. Apparently some other files do rely on this, but it depends on the underlying C++ headers whether it leads to an error or not. I have put back the <string> include, it should compile now. I also updated the patches for the other mysql ports.
there are some problems with i386: http://joneumbox.org/build.html?mastername=133i386-ports&build=2024-08-27_14h29m09s http://joneumbox.org/build.html?mastername=140i386-ports&build=2024-08-27_17h03m49s http://joneumbox.org/build.html?mastername=141i386-ports&build=2024-08-27_17h54m58s http://joneumbox.org/build.html?mastername=15i386-ports&build=2024-08-27_20h32m23s
(In reply to Jochen Neumeister from comment #6) Hm, all the same problem, something with an allocator alignment: /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.39/storage/innobase/include/detail/ut/aligned_alloc.h:289:17: error: static assertion failed due to requirement 'allocator_metadata_size <= max_metadata_size': Aligned_alloc_impl provides a strong guarantee of only up to Aligned_alloc_impl::metadata_size bytes. 289 | static_assert(allocator_metadata_size <= max_metadata_size, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.39/storage/innobase/include/detail/ut/aligned_alloc.h:451:17: note: in instantiation of template class 'ut::detail::Aligned_alloc_metadata<unsigned int, unsigned int>' requested here 451 | static inline allocator_metadata::meta_2_t datalen( | ^ /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.39/storage/innobase/include/detail/ut/aligned_alloc.h:289:41: note: expression evaluates to '8 <= 4' 289 | static_assert(allocator_metadata_size <= max_metadata_size, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ I'm currently doing a poudriere run on a i386 jail, when it is finished I can do a mysql80 build there. I will probably look how mysql84 does this, since I understand that mysql84 has no issues building on i386 with these clang 19 specific patches?
(In reply to Dimitry Andric from comment #7) Looks like this was already reported in bug 280541, I will see if the patch proposed there works.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=4e862d56da47f4a6fed220dbf53e1099d7d64277 commit 4e862d56da47f4a6fed220dbf53e1099d7d64277 Author: Jochen Neumeister <joneum@FreeBSD.org> AuthorDate: 2024-08-31 15:44:28 +0000 Commit: Jochen Neumeister <joneum@FreeBSD.org> CommitDate: 2024-08-31 15:45:19 +0000 databases/mysql80-server: fix build with libc++ 19 As noted in the libc++ 19 release notes [1], std::char_traits<> is now only provided for char, char8_t, char16_t, char32_t and wchar_t, and any instantiation for other types will fail. This causes databases/mysql80-client to fail to compile with clang 19 and libc++ 19, resulting in errors similar to: /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>' 820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, | ^ /wrkdirs/usr/ports/databases/mysql80-client/work/mysql-8.0.39/sql/rpl_log_encryption.h:821:14: note: in instantiation of template class 'std::basic_string<unsigned char>' requested here 821 | Key_string m_encrypted_password; | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ `Key_string` is defined as `std::basic_string<unsigned char>`, which is no longer possible. So redefine it as a `std::vector<unsigned char>` instead. This requires only a few small adjustments in other places: replacing the `length()` method with the equivalent `size()` method, and adjusting the arguments for the `assign()` method, which for `std::vector` takes a begin and end iterator, instead of a begin iterator and a size. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals PR: 280693 Sponsored by: Netzkommune GmbH .../files/patch-sql_binlog__ostream.cc (new) | 11 ++ .../files/patch-sql_mdl__context__backup.cc (new) | 36 ++++++ .../files/patch-sql_mdl__context__backup.h (new) | 11 ++ ...ge__optimizer_index__range__scan__plan.cc (new) | 39 ++++++ .../files/patch-sql_rpl__log__encryption.cc (new) | 134 +++++++++++++++++++++ .../files/patch-sql_stream__cipher.cc (new) | 11 ++ .../files/patch-sql_stream__cipher.h (new) | 19 +++ ...inlogevents_transaction__compression-t.cc (new) | 11 ++ .../patch-unittest_gunit_stream__cipher-t.cc (new) | 15 +++ 9 files changed, 287 insertions(+)