Opened 4 years ago

Closed 4 years ago

#59563 closed defect (fixed)

mariadb-10.2: configure.cxxflags-append -std=c++11 # plus `port bump`

Reported by: vike2000 Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: haspatch Cc: vike2000
Port: mariadb-10.2

Description

Adding

    configure.cxxflags-append \
                        -std=c++11

(after configure.args-append but Portfile is basically declarative, right),

solving build warnings like

  • deleted function definitions are a C++11 extension [-Wc++11-extensions],
  • but most important
    /opt/local/include/libxml2/unicode/localpointer.h:224:34: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
        LocalPointer(LocalPointer<T> &&src) U_NOEXCEPT : LocalPointerBase<T>(src.ptr) {
                                     ^
    
    resulting in build errors like
    /opt/local/include/libxml2/unicode/localpointer.h:224:40: error: expected ';' at end of declaration list
        LocalPointer(LocalPointer<T> &&src) U_NOEXCEPT : LocalPointerBase<T>(src.ptr) {
                                           ^
    

Notes

  • I have force-updated xcode between this ticket and previous working port install mariadb-10.2-server.
  • I was actually working with either of port {} mariadb-10.2{,-server}.

Attachments (1)

Portfile-mariadb-10.2.diff (1.3 KB) - added by vike2000 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by vike2000

Attachment: Portfile-mariadb-10.2.diff added

comment:1 Changed 4 years ago by vike2000

Cc: vike2000 added

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added
Summary: configure.cxxflags-append -std=c++11 # plus `port bump`mariadb-10.2: configure.cxxflags-append -std=c++11 # plus `port bump`

Yes, we've seen this with other ports too. Anything that uses libxml2 (or at least, uses specific libxml2 headers; I don't know which ones.) See for example #59565. It would also need compiler.cxx_standard 2011.

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: michaelld removed
Owner: set to michaelld
Status: newassigned
Version: 2.6.2

Your patch also changes the checksums, which does not seem related to this ticket.

comment:4 Changed 4 years ago by michaelld (Michael Dickens)

@ryandesign : I can certainly move the MariadB ports to use C++11 ... not the worst idea overall & simple to change.

But it's just 1 port & there are tons of ports that are effected by this update / issue.

Hence, wondering for advice on how to proceed ... Do you know the status of us trying to fix the meta-issue (libxml2 chaining ICU through its API and thus ABI required as per the libxml2 pkgconfig file) : #59499 ?

comment:5 in reply to:  3 Changed 4 years ago by vike2000

Replying to ryandesign:

Your patch also changes the checksums, which does not seem related to this ticket.

Without bumping checksums it wouldn't build regardless of the other patch hunk.
Cause this port is ahead of its main non-version-named port mariadb (latest sync @5.5.65),
I sort of assumed this port had some implicit unstable dev/beta status. However bad a defense,
this is not the first time i've had to bump checksums (non-semver-ish upstream updates a reason?),
albeit in so blindly trusting any sources...

Filing the ticket I mainly looked at https://guide.macports.org/#project.contributing.updates,
but also …#development.patches.portfile, and reading on under the next subheading …#development.patches.portfile,
I remember the point that one “should create one patch file for each logical change that needs to be applied”.
Am I amiss still considering this a border case?

Would you suggest to make two different patch files in future similar cases?

comment:6 Changed 4 years ago by michaelld (Michael Dickens)

I fixed this port over the weekend after being alerted by a user of the issue. Hopefully it takes care of the checksum issues.

comment:7 Changed 4 years ago by michaelld (Michael Dickens)

MariaDB 10.2 core itself does not formally require C++11, but, as with many projects, we can build it using C++11 ... which can be advantageous such as for this issue.

We need to change the Portfile, both to tell MP to use a C++ 2011 compliant compiler as well as to set the CMAKE_CXX_STANDARD to 11 & then let CMake determine how to do that in the build (rather than changing a CXX variable such as suggested; this might work, but letting CMake do the work is more reliable).

comment:8 Changed 4 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In bfd9a1776f09c20a7b9bcf7d31762a5ebef6182f/macports-ports (master):

mariadb-10.2: add non-default-variant connect_with_libxml2

This is the only part of MariaDB 10.2 that requires libxml2, which in turn will require C++11. So the MariaDB core will now be buildable without C++11 or libxml2.

Closes: #59505
Closes: #59563

Note: See TracTickets for help on using tickets.