Bug 256618 - databases/mariadb10[345]-server: patch and unbreak on riscv64
Summary: databases/mariadb10[345]-server: patch and unbreak on riscv64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: riscv Any
: --- Affects Some People
Assignee: Bernard Spil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-15 11:51 UTC by Robert Clausecker
Modified: 2021-07-22 14:16 UTC (History)
2 users (show)

See Also:
brnrd: maintainer-feedback+
koobs: merge-quarterly?


Attachments
databases/mariadb103-server: patch and unbreak on riscv64 (2.72 KB, patch)
2021-06-15 11:51 UTC, Robert Clausecker
no flags Details | Diff
databases/mariadb104-server: patch and unbreak on riscv64 and i386 (3.01 KB, patch)
2021-06-15 11:51 UTC, Robert Clausecker
no flags Details | Diff
databases/mariadb105-server: patch and unbreak on riscv64 (2.30 KB, patch)
2021-06-15 11:51 UTC, Robert Clausecker
no flags Details | Diff
databases/mariadb104-server: fix plist issues on non-amd64 (1.44 KB, patch)
2021-06-29 13:42 UTC, Robert Clausecker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker 2021-06-15 11:51:07 UTC
Created attachment 225824 [details]
databases/mariadb103-server: patch and unbreak on riscv64

RISC-V does not have FP exceptions and nobody has bothered to stub out
the fpsetmask() calls.  Remove these calls on platforms that don't
support them to unbreak the build.

These patches fix

    databases/mariadb103-server
    databases/mariadb104-server
    databases/mariadb105-server

on riscv64.  Additional, version 104 is also unbroken on i386 as I couldn't reproduce the build failure.
Comment 1 Robert Clausecker 2021-06-15 11:51:33 UTC
Created attachment 225825 [details]
databases/mariadb104-server: patch and unbreak on riscv64 and i386
Comment 2 Robert Clausecker 2021-06-15 11:51:55 UTC
Created attachment 225826 [details]
databases/mariadb105-server: patch and unbreak on riscv64
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2021-06-15 11:53:41 UTC
(In reply to Robert Clausecker from comment #0)

Is a separate referent issue to stub out those syscalls useful? Note: Resolving this issue would not block on that issue.
Comment 4 Robert Clausecker 2021-06-15 11:59:30 UTC
(In reply to Kubilay Kocak from comment #3)

It would certainly be useful.  The functions seem to exist already; what is missing are the various macros associated with it.  Some dummy values would need to be set up.
Comment 5 Robert Clausecker 2021-06-15 12:18:39 UTC
As for QA, databases/mariadb104-server appears to have plist issues on i386 and riscv64.  These need to be looked at separately from the build issues:

====> Running Q/A tests (stage-qa)
Warning: setuid files in the stage directory (are these necessary?):
49782 -rwsr-xr-x  1 nobody  wheel  8664 Jun 15 09:12:50 2021
+/wrkdirs/usr/ports/databases/mariadb104-server/work/stage/usr/local/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%DATADIR%%/wsrep.cnf
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1
Comment 6 Mitchell Horne freebsd_committer 2021-06-15 13:23:43 UTC
(In reply to Robert Clausecker from comment #4)

Hi,

I'm happy to provide a patch for the base system to define the missing values on riscv. However, it is worth noting that the reason we have not done so thus far is because the unstandardized ieeefp.h has long been deprecated in favor of fenv.h, which is part of the C99 standard.

It seems the better fix would be to remove this outdated and FreeBSD-specific code block from MariaDB, and make use of the fenv(3) functions like other platforms do. It looks like there are existing feature flags for this, HAVE_FEDISABLEEXCEPT, and HAVE_FESETROUND.
Comment 7 Mitchell Horne freebsd_committer 2021-06-15 13:26:16 UTC
(In reply to Mitchell Horne from comment #6)

In fact, the fenv(3) functions should be in use already, since they are detected by configure.cmake in the MariaDB server source.
Comment 8 Robert Clausecker 2021-06-15 20:26:44 UTC
(In reply to Mitchell Horne from comment #6)

Hi Mitchell,

While you are right in principle, ieeefp.h is an official FreeBSD interface.  So unless a decision is made to remove it from the system, it should still be supported on all platforms.

That said, I am in favour of changing the code over to fenv in the long term.  The patch I submitted is a minimal fix for the issue at hand and should be followed up by a more thorough fix upstream.
Comment 9 Robert Clausecker 2021-06-29 08:04:57 UTC
Maintainer timeout.
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2021-06-29 12:14:36 UTC
Thank you Robert. Just to note, while the build only fix (not fixing plist issues) can technically be committed on its own, it is unusual for that to occur (in ports), in the presence of other issues, in particular for packaging failures, which will continue not to be produced for users.

Given the build fix should be merged, it would be great to resolve the plist and any other known issues/bugs, as that should be merged as well.
Comment 11 Robert Clausecker 2021-06-29 12:37:54 UTC
(In reply to Kubilay Kocak from comment #10)

I'll go ahead and try to fix the plist issue with databases/mariadb104-server.  Since it's an orphaned file (looks like a candidate for @sample), it does not prevent packages from being built, but should indeed still be cleaned up.
Comment 12 Robert Clausecker 2021-06-29 13:42:56 UTC
Created attachment 226110 [details]
databases/mariadb104-server: fix plist issues on non-amd64

This patch fixes the plist issues by always attempting to move wsrep.cnf into the place pkg-plist expects it in, regardless of whether the WSREP option is set or not.  if the file does not exist, the error is ignored.

There may be a deeper underlying issue for this symptom: WSREP is only available as an option on amd64, so the configuration file should not be installed on other architectures.  However, it is unexpectedly present.  I presume that the absence of the option means that the wsrep feature is unconditionally built on platforms other than amd64 that support it.

This is something that needs to be looked into, but I am not sufficiently familiar with mariadb to make an informed judgement here.  Also, I was unable to determine why the WSREP option exists on amd64 only.
Comment 13 Bernard Spil freebsd_committer 2021-06-30 08:28:01 UTC
Pls hang on, I'm about to commit point updates for all 3 server ports
Comment 14 commit-hook freebsd_committer 2021-06-30 08:39:38 UTC
A commit in branch main references this bug:

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

commit 8d286ea3810d18103dafe59e38cf8d8878f1625f
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2021-06-30 08:30:18 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2021-06-30 08:39:05 +0000

    databases/mariadb103-server: Update to 10.3.30

    PR:             256827 [1], 256618 [2]
    Reported by:    <vincent jancso outlook com> [1], Robert Clausecker <fuz fuz su> [2]

 databases/mariadb103-server/Makefile               |  4 +---
 databases/mariadb103-server/distinfo               |  6 +++---
 .../files/patch-scripts_wsrep__sst__mariabackup.sh | 20 ++++++++++----------
 .../mariadb103-server/files/patch-sql_mysqld.cc    | 22 ++++++++++++++++++++--
 4 files changed, 34 insertions(+), 18 deletions(-)
Comment 15 commit-hook freebsd_committer 2021-06-30 14:25:49 UTC
A commit in branch main references this bug:

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

commit c930ca58ddbb4e9e86c2cba0ff30a4c31bfdfc56
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2021-06-30 14:23:30 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2021-06-30 14:23:30 +0000

    databases/mariadb105-server: Update to 10.5.11

     * Fix build with RISC-V [1]

    PR:             256618 [1]
    Submitted by:   Robert Clausecker [1]

 databases/mariadb105-client/Makefile                 |  1 -
 databases/mariadb105-server/Makefile                 |  4 +---
 databases/mariadb105-server/distinfo                 |  6 +++---
 .../files/patch-scripts_wsrep__sst__mariabackup.sh   | 20 ++++++++++----------
 .../files/patch-scripts_wsrep__sst__rsync.sh (gone)  | 18 ------------------
 .../files/patch-sql_mysqld.cc (new)                  | 20 ++++++++++++++++++++
 6 files changed, 34 insertions(+), 35 deletions(-)
Comment 16 Bernard Spil freebsd_committer 2021-06-30 16:44:55 UTC
Seems this triggers an error for 10.4 on FreeBSD 11.4-i386

See https://brnrd.eu/poudriere/data/114i386-git/2021-06-30_15h58m15s/logs/errors/mariadb104-client-10.4.20.log

> ../mysys/libmysys.a(my_open.c.o): In function `my_register_filename':
> my_open.c:(.text+0x107): undefined reference to `my_atomic_add32'

OK on 12.2 though.
Comment 17 commit-hook freebsd_committer 2021-06-30 16:51:15 UTC
A commit in branch main references this bug:

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

commit 89b30bb9de066abf8e3710b8f5f37bbe0489b549
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2021-06-30 16:48:56 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2021-06-30 16:48:56 +0000

    databases/mariadb104-server: Update to 10.4.20

     * Fix build on RISC-V and i386 [1]
     * Fix plist issue with WSREP on i386 [1]

    PR:             256618
    Submitted by:   Robert Clausecker <fuz fuz su>

 databases/mariadb104-server/Makefile               | 12 +++---------
 databases/mariadb104-server/distinfo               |  6 +++---
 .../files/patch-scripts_wsrep__sst__mariabackup.sh | 20 ++++++++++----------
 .../patch-scripts_wsrep__sst__rsync.sh (gone)      | 18 ------------------
 .../mariadb104-server/files/patch-sql_mysqld.cc    | 22 ++++++++++++++++++++--
 5 files changed, 36 insertions(+), 42 deletions(-)
Comment 18 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-03 00:53:49 UTC
^Triage: Pending 103,105 commits and merges
Comment 19 Robert Clausecker 2021-07-05 14:38:30 UTC
(In reply to Kubilay Kocak from comment #18)

Is there anything left to do with this one?  All three ports have been patched.
Comment 20 Robert Clausecker 2021-07-22 14:16:31 UTC
It seems like there's nothing left to do with this one.  All three ports have been patched.  Closing this one.