Page MenuHomeFreeBSD

Simplify and improve the mysql/mariadb ports and packages.
AcceptedPublic

Authored by tcberner on Feb 16 2024, 11:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 3:29 AM
Unknown Object (File)
Mon, Apr 8, 10:37 PM
Unknown Object (File)
Mar 25 2024, 10:41 PM
Unknown Object (File)
Mar 25 2024, 8:49 PM
Unknown Object (File)
Mar 22 2024, 5:54 AM
Unknown Object (File)
Mar 4 2024, 2:27 PM
Unknown Object (File)
Feb 21 2024, 1:05 AM
Unknown Object (File)
Feb 18 2024, 12:14 AM
Subscribers

Details

Reviewers
joneum
brnrd
Group Reviewers
portmgr
Summary

Changes:

  • only one client port for each provider:
    • databases/mysql-client
    • databases/mariadb-client
  • servers install to ${LOCALBASE}/${provider}${version}
  • new default version MYSQL_CLIENT_DEFAULT=mysql|mariadb
  • mysql.mk only adds run or build depends on ${MYSQL_CLIENT_DEFAULT}

The greatest benefit of this is, that one can have multiple
mysql/mariadb servers installed at once; which makes migrations
to never server versions finally easier.

The respective client ports should be kept at the version of the latest
provided server package. So if there is a databases/mysql82-server port
in the future, databases/mysql-client should be updated to use that one.

Note: the clients are backwards compatible.

This is following the idea proposed back in 2015 [1] for the postgresql ports.
I plan to implement the same "one client-port, multiple-server ports in prefix"
for them as well after this change is finished.

[1] https://lists.freebsd.org/pipermail/freebsd-ports/2015-July/099842.html

TODO:

  1. Test the change ;-) -- ideally by someone who has actually some DBs
  2. Remove IGNORE_WITH_MYSQL -- as the packages no longer pull in a server this becomse meaning less. You just installl the package and a compatible server backend.
  3. Cleanup dependencies -- there are ports that have specific server options. They should be removed, as servers should be chosen by the administrators.
  4. Double-check the RC scripts that they make sense this way.
  5. Fix up plists in the server ports (they stage, but maybe could need some love :D) [...] n) Bump revision of all ports with USES=mysql

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 56071
Build 52960: arc lint + arc unit

Event Timeline

tcberner created this revision.

Made a first round of review, looking great!
I'll try to apply this to one of my machines running MySQL server to see how transition works.

databases/mariadb1011-server/files/mariadb1011-server.in
30

Is this a typo (mysql1011 != mariadb1011) ?

databases/mariadb1011-server/pkg-plist
2

Why comment these files?

Anyways, they should be placed at appropriate lines, to make future make makeplist easier to merge.

247

I'm a bit confused that -server package installs client libraries. Is this because this port is reused for client too?

databases/mysql-client/Makefile
13

This one should also be ?= to allow user to override.

  • Fix mariadb1011-server.in
databases/mariadb1011-server/pkg-plist
2

I have no clue :) -- they come from line 273 from the original plist

247

afair there was a sed call in the Makefie to @comment the files from the client port in the server plist... but it does not seem to be present in all versions :D

${SED} '/%%/d;/^@comment /d;s/^/@comment /' ${PORTSDIR}/${CATEGORIES:[1]}/${PORTNAME}-client/pkg-plist \
        >> ${TMPPLIST}
tcberner added inline comments.
databases/mysql-client/Makefile
13

that wouldn't work as then PREFIX would be set from the -server port.

@joneum and @brnrd -- what are your opinions? :)

@joneum and @brnrd -- what are your opinions? :)

okay for me, even if I have to rewrite MySQL 82 and 83 :-)

This revision is now accepted and ready to land.Mar 4 2024, 8:28 PM