On Thu, Sep 17, 2026 at 06:33:35PM +0100, Stuart Henderson wrote:
> On 2026/09/17 10:15, Andrew Hewus Fresh wrote:
> > On Wed, Sep 16, 2026 at 05:20:28PM -0700, Andrew Hewus Fresh wrote:
> > > In databases/p5-DBIx-Class (and similar) I have added
> > > MODULES += databases/mariadb
> > > 
> > > https://cvsweb.openbsd.org/ports/databases/p5-DBIx-Class
> > > 
> > > Last time I updated the port, it worked fine, but something has changed
> > > in the way this should be set up and now mariadb fails to initialize. 
> > 
> > This seems to fix the startup.
> > 
> > What's the right way to find this file?
> 
> I think I'd have the module write it to e.g. ${WRKDIR}/module-server-my.cnf,
> perhaps by copying from ${FILESDIR}/module-server-my.cnf if it present
> (i.e. coming from the port which includes the module, allowing per-port
> overrides) and otherwise just printf'ing the default values if not to
> avoid awkward constructs to find the path to mariadb?


That seems reasonable enough, although a bit harder to find.

How about allowing them to just override the config?
MODMARIADB_DEFAULTS_FILE =      ${FILESDIR}/my.cnf

Any preference on the name?

> > What are good values?
> 
> Your proposed 512m seems reasonable. The default datasize-cur for
> pbuild class is at least 1G on all archs except m88k and landisk
> (where I don't think anyone is likely to run these anyway, if
> mariadb can even compile).
> 
> > (the open_files_limit is just to avoid the warning)
> 
> I'd go a bit higher, if some test uses a bunch of tables it might
> need it, 400 would fit in datasize-cur with some spare (pbuild
> defers to default for this, which sets it to 512).

I'll just leave it out, it works without and the warning isn't that
annoying.

Index: mariadb.port.mk
===================================================================
RCS file: /cvs/ports/databases/mariadb/mariadb.port.mk,v
diff -u -p -r1.6 mariadb.port.mk
--- mariadb.port.mk     11 Mar 2022 18:31:22 -0000      1.6
+++ mariadb.port.mk     17 Sep 2026 18:09:37 -0000
@@ -6,16 +6,18 @@ MODMARIADB_TEST_CMD ?= \
 MODMARIADB_TEST_DBNAME ?=
 MODMARIADB_TEST_SOCKET =       ${WRKDIR}/mariadb.sock
 _MODMARIADB_TEST_DATA_DIR =    ${WRKDIR}/testdb-mariadb
+_MODMARIADB_DEFAULTS_FILE =    ${WRKDIR}/mariadb-default-my.cnf
+MODMARIADB_DEFAULTS_FILE ?=    ${_MODMARIADB_DEFAULTS_FILE}
 
 MODMARIADB_SERVER_ARGS = \
-       --no-defaults \
+       --defaults-file=${MODMARIADB_DEFAULTS_FILE} \
        --datadir=${_MODMARIADB_TEST_DATA_DIR} \
        --skip-grant-tables \
        --skip-networking \
        --socket=${MODMARIADB_TEST_SOCKET}
 
 MODMARIADB_ADMIN_ARGS = \
-       --no-defaults \
+       --defaults-file=${MODMARIADB_DEFAULTS_FILE} \
        --host=localhost \
        --protocol=socket \
        --socket=${MODMARIADB_TEST_SOCKET}
@@ -34,6 +36,8 @@ TEST_ENV += \
 
 MODMARIADB_TEST_TARGET = \
        rm -Rf ${_MODMARIADB_TEST_DATA_DIR}; \
+       printf "[mysqld]\ninnodb_buffer_pool_size_max=512m\n" \
+           > ${_MODMARIADB_DEFAULTS_FILE}; \
        export ${ALL_TEST_ENV}; \
        ${LOCALBASE}/bin/mariadb-install-db \
                --skip-name-resolve \

Reply via email to