mysql 5.7 changes lib_r from mysqlclient_r to mysqlclient which causes badly created packages to fail due to missing -lmysqlclient_r One such port is qt4-mysql-plugin but I expect there are more. This could be fixed with cleaver workarounds in each port or upstream changes so they use mysql_config to determine correct link settings, but that's quite invasive and time consuming, so it may be better to patch mysql57-client to create a symlink between libmysqlclient_r.so and libmysqlclient.so.
Created attachment 166367 [details] Add symlinks for lib_r's
(In reply to Steven Hartland from comment #1) Hi. Thanks for your feedback on mysql57 ports :) from mysql-devs-guys point of view 'qt4-mysql-plugin' is using mysql57-lib-devel. so it should use mysql_config --cflags to build itself (and there shouldn't be problem then :) In another issue (issue#206119) i had a discussion with someone and i've asked mysql-dev-guys' opinion in such cases. Maybe i can talk with qt-dev-guys and convince them yo change their way :) because in this case MySQL is considered their upstream :D What's your opinion ? i personally think quality is more important than time :D, so we have to use better way ignoring its time :D
It doesn't and I'm assuming others don't if you see the percona port they had the same issue and did the same as I've done here, as the impact to get all the upstreams to fix their build is too high.
+1 on a temporary symlink until more permanent upstream changes can be made. Is there any reason MySQL can't create these symlinks for compatibility, or at least create an option at build time to do so? @Steven, could you confirm this change passes QA (poudriere) please. I'm assuming its been build tested against consumer ports, and they find the library once the links are in place. Also, would you like to commit this change? I'm happy (approve) it to go in, once QA is confirmed here and if Mahdi approves. If so, please assign this issue to yourself :) @Mahdi, can you approve the attachment once Steven provides QA confirmation please? You can create a separate issue for yourself to "Get upstreams to fix/provide compatibility for new library name" to track the permanent fix
@Kubilay, @Steven: sure ill approve if something like this happened before :D @Steven, could you confirm this change passes QA (poudriere) please ? also ill try to contact Qt guys to make'em aware of it :) so comment on added-lines is good idea IMO :) Also as ive submitted two other patches solving 2-3 problems for mysql ports please commit it after those, to avoid conflicts (and make my work easier ;D) Thanks.
(In reply to Mahdi Mokhtari from comment #5) Also i think patch should be generated against head :D
Confirmed it passed testport and I then could successfully build qt4-mysql-plugin including again testport.
(In reply to Steven Hartland from comment #7) > Confirmed it passed testport Then okay from my side, except I think patch should be generated against HEAD, no? Just another question (Only for my knowledge :D), couldn't we put these on post-stage target instead of post-install? And/Or put this link's name inside pkg-plist too? (I know post-install is correct as I saw many uses of it by googling. i'm just, "curious", about post-stage :D) BTW, I'll generate this (currently submitted) patch against HEAD ;), thanks.
It was created from head ;-)
(In reply to Steven Hartland from comment #9) I mean also from ports/ dir. But seems it created with 'diff' inside 'mysql57-client/' dir. :)
Comment on attachment 166367 [details] Add symlinks for lib_r's I approved it '+' :D Thanks for your helps :)
Comment on attachment 166367 [details] Add symlinks for lib_r's port committer approval
Over to you Steven This patch is an MFH candidate, please include MFH: 2016Q1 in your commit log message including (along with a PR: 206805 reference), to obtain ports-secteam approval for the merge to quarterly. You may merge using PORTSDIR/Tools/scripts/mfh
Sorry koobs, I only have src commit bit not ports :(
Comment on attachment 166367 [details] Add symlinks for lib_r's >--- Makefile.pre-lib_r 2016-01-31 21:34:05.019245752 +0000 >+++ Makefile 2016-01-31 21:44:40.761202143 +0000 >@@ -3,7 +3,7 @@ > > PORTNAME= mysql > PKGNAMESUFFIX= 57-client >-PORTREVISION= 3 >+PORTREVISION= 4 > > COMMENT= Multithreaded SQL database (client) > >@@ -32,4 +32,11 @@ MMAN1= comp_err.1 msql2mysql.1 mysql.1 > > CLIENT_ONLY= yes > >+# MySQL 5.7 uses the same lib for libs as for libs_r, so for now we just create a symlink >+# to prevent breaking installed ports. >+post-install: >+ @${LN} -s libmysqlclient.a ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.a >+ @${LN} -s libmysqlclient.so ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.so >+ @${LN} -s libmysqlclient.so.20 ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.so.20 >+ > .include "${MASTERDIR}/Makefile"
(In reply to Mahdi Mokhtari from comment #15) I think using @${CMD} is better than ${CMD}. So i've edited patch. ** previous one was correct too :D *** it's choosing between better and MOAR better Thanks.
(In reply to Steven Hartland from comment #14) I've provided you with approval to commit this change to ports :) Please add Approved by: koobs (ports) to the commit log along with the other references provided in my comment 13
Mahdi will be providing an updated patch (and QA confirmation, regenerated against the port once it's been updated when bug 206998 is committed.
Actually, ignore that. The version update (in bug 206998) needs to come last.
Created attachment 166982 [details] patch for supporting lib_r regenerated for being committed before other mysql issues. Up to you @Steven :D
(In reply to Mahdi Mokhtari from comment #20) Passes QA Portlint : okay poudriere okay (93.0 10.1 11.0)
Created attachment 166988 [details] patch for supporting lib_r Previous patch + PORTREVISION bump @mokhi64 if you can just confirm you're happy with this version I'll commit under koobs approval
(In reply to Steven Hartland from comment #22) is it necessary for using PORTREVISION for a slave port (mysql57-client) ?
in server port (master port) we have PORTREVISION defined in a way to be shared between Master and slave ports
If you don't the change will not picked up by pkg upgrade mysql57-client as the full version will be the same, so yes if you make any change which doesn't change port version you need to bump the port revision; at least that's my understanding of it.
(In reply to Steven Hartland from comment #25) So what about PORTREVISION?= 4 instead of PORTREVISION= 4 ? also portlint QA failed, i think we have extra newlines in our patch :D
(In reply to Mahdi Mokhtari from comment #24) Yes but this change doesn't effect server only client hence its the client which needs the bump. This is why PORTREVISON in the parent is set with =? so it can be overridden by the client. Its a little messy if the parent then gets bumped twice as it then needs both ports to be edited, I don't believe theirs any way to avoid that.
Created attachment 166991 [details] patch for this issue solves QA issue (and bumps PORTREVISION) 2 fatal portlint errors fixed FATAL: Makefile: order must be 'BLAH BLAH' FATAL: extra new lines
Created attachment 166992 [details] patch for supporting lib_r Removed extra blank lines introduced by patch -2
(In reply to Mahdi Mokhtari from comment #28) Yer looks like you introduced those in your edit of my original patch, I've just uploaded a fixed version.
(In reply to Steven Hartland from comment #30) oh both of us attached in same time :)
(In reply to Steven Hartland from comment #30) PORTREVISION Should be before PKGNAMESUFFIX. portlint errors in fatal way. i solved it in patch :D
@Steven: are you okay with this ? :)
A commit references this bug: Author: smh Date: Sun Feb 14 18:28:35 UTC 2016 New revision: 408878 URL: https://svnweb.freebsd.org/changeset/ports/408878 Log: Add MySQL 5.7 symlinks for mysqlclient_r libs MySQL 5.7 changes lib_r from mysqlclient_r to mysqlclient which causes packages which don't correctly use mysql_config to determine library locations to fail due to missing -lmysqlclient_r. As there are quite a few ports, most of which will require upstream fixes for now we create symlinks so said ports build without issue. PR: 206805 Reviewed by: Mahdi Mokhtari (maintainer) Approved by: koobs (ports) MFH: 2016Q1 Sponsored by: Multiplay Changes: head/databases/mysql57-client/Makefile head/databases/mysql57-client/pkg-plist
@Steven: Thanks mate :D
(In reply to Mahdi Mokhtari from comment #35) Any progress on MFH ing ? Can we close this issue?
(In reply to Mahdi Mokhtari from comment #36) Closing. The MFH at this point is irrelevant as the referenced commit was already in the current 2016Q2 branch.
(In reply to Jason Unovitch from comment #37) Thanks ;)