Bug 276749 - databases/mysql80-server: fix build with clang 16
Summary: databases/mysql80-server: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks: 276104
  Show dependency treegraph
 
Reported: 2024-01-31 18:51 UTC by Dimitry Andric
Modified: 2024-02-01 19:28 UTC (History)
1 user (show)

See Also:
joneum: maintainer-feedback+


Attachments
databases/mysql80-server: fix build with clang 16 (2.82 KB, patch)
2024-01-31 18:54 UTC, Dimitry Andric
joneum: maintainer-approval+
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-01-31 18:51:37 UTC
Similar to bug 272295, building databases/mysql80-server with clang 16
or higher can result in an error:

  /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.35/boost/boost_1_77_0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
     73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
        |                               ^
  /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.35/boost/boost_1_77_0/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
     24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
        |                                               ^

This is because the vendored copy of boost in mysql80-server is using
undefined behavior in a possibly constexpr context.

Fix this by unconditionally enabling the "boost workaround" for aux
wrapper value types in integral_wrapper.hpp.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-01-31 18:54:49 UTC
Created attachment 248100 [details]
databases/mysql80-server: fix build with clang 16
Comment 2 Jochen Neumeister freebsd_committer freebsd_triage 2024-02-01 07:01:33 UTC
Moin Dimitry,

when the patch work, feel free to ship it :-)
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2024-02-01 19:04:19 UTC
(In reply to Jochen Neumeister from comment #2)
It's the same fix that has already been used for bug bug 272295. The actual problem is that these ports carry an old copy of boost, while in the mean time boost has already fixed this issue.

In any case, I built it with clang 18 and it works.
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-02-01 19:05:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bfdc368a6edddc2c8c305e60dd89c96d7ecb7fc2

commit bfdc368a6edddc2c8c305e60dd89c96d7ecb7fc2
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-01-16 11:45:17 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-02-01 19:02:03 +0000

    databases/mysql80-server: fix build with clang 16

    Similar to bug 272295, building databases/mysql80-server with clang 16
    or higher can result in an error:

      /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.35/boost/boost_1_77_0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
         73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
            |                               ^
      /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.35/boost/boost_1_77_0/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
         24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
            |                                               ^

    This is because the vendored copy of boost in mysql80-server is using
    undefined behavior in a possibly constexpr context.

    Fix this by unconditionally enabling the "boost workaround" for aux
    wrapper value types in integral_wrapper.hpp.

    PR:             276749
    Approved by:    joneum (maintainer)
    MFH:            2024Q1

 databases/mysql80-server/Makefile                             |  2 +-
 ...oost__1__77__0_boost_mpl_aux___integral__wrapper.hpp (new) | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-02-01 19:07:24 UTC
A commit in branch 2024Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c64e355e6226d1dd403874a0bc73ada0f13f8ca3

commit c64e355e6226d1dd403874a0bc73ada0f13f8ca3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-01-16 11:45:17 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-02-01 19:06:06 +0000

    databases/mysql80-server: fix build with clang 16

    Similar to bug 272295, building databases/mysql80-server with clang 16
    or higher can result in an error:

      /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.35/boost/boost_1_77_0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
         73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
            |                               ^
      /wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.35/boost/boost_1_77_0/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
         24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
            |                                               ^

    This is because the vendored copy of boost in mysql80-server is using
    undefined behavior in a possibly constexpr context.

    Fix this by unconditionally enabling the "boost workaround" for aux
    wrapper value types in integral_wrapper.hpp.

    PR:             276749
    Approved by:    joneum (maintainer)
    MFH:            2024Q1

    (cherry picked from commit bfdc368a6edddc2c8c305e60dd89c96d7ecb7fc2)

 databases/mysql80-server/Makefile                             |  2 +-
 ...oost__1__77__0_boost_mpl_aux___integral__wrapper.hpp (new) | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)