Bug 280694 - databases/mysql81-server: fix build with libc++ 19
Summary: databases/mysql81-server: fix build with libc++ 19
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-08-08 18:24 UTC by Dimitry Andric
Modified: 2024-08-31 15:49 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments
databases/mysql81-client: fix build with libc++ 19 (5.04 KB, patch)
2024-08-08 18:25 UTC, Dimitry Andric
no flags Details | Diff
databases/mysql81-server: fix build with libc++ 19 (v2) (15.10 KB, patch)
2024-08-18 19:32 UTC, Dimitry Andric
no flags Details | Diff
databases/mysql81-server: fix build with libc++ 19 (v3) (16.95 KB, patch)
2024-08-22 09:32 UTC, Dimitry Andric
no flags Details | Diff
databases/mysql81-server: fix build with libc++ 19 (v4) (16.94 KB, patch)
2024-08-25 20:00 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-08-08 18:24:50 UTC
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/mysql81-server 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/mysql81-client/work/mysql-8.1.0/sql/rpl_log_encryption.h:820:14: note: in instantiation of template class 'std::basic_string<unsigned char>' requested here
      820 |   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
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-08-08 18:25:57 UTC
Created attachment 252616 [details]
databases/mysql81-client: fix build with libc++ 19
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2024-08-18 19:32:30 UTC
Created attachment 252896 [details]
databases/mysql81-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.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2024-08-22 09:32:21 UTC
Created attachment 253006 [details]
databases/mysql81-server: fix build with libc++ 19 (v3)

Added two additional files to the patch to also ensure the "make test" target succeeds.
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2024-08-25 11:43:33 UTC
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.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2024-08-25 20:00:32 UTC
Created attachment 253093 [details]
databases/mysql81-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.
Comment 6 Jochen Neumeister freebsd_committer freebsd_triage 2024-08-27 11:11:47 UTC
Unfortunately I have a build error on all i386 versions.
MySQL 8.1 will be deleted from the ports on 1.9.2024. The version is EOL.
I would suggest not to invest any more time here if the port will be deleted next week.
Comment 7 Jochen Neumeister freebsd_committer freebsd_triage 2024-08-31 15:49:51 UTC
Port will be removed 1.9.2024 - so i closed here without commit :)