mysql2
mysql2 copied to clipboard
Please don't set DT_RPATH by default
Currently, unless set explicitly otherwise, DT_RPATH is set to /usr/lib64/
. This was deemed undesired in Fedora:
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
Unless no options is present, it's autodetected by default: https://github.com/brianmario/mysql2/blob/ca883e1a359a10f48ac5d0ce649827b424110cd7/ext/mysql2/extconf.rb#L253
Bugzilla reference: https://bugzilla.redhat.com/show_bug.cgi?id=1987743
I remember spending a LOT of time on this years ago. Not the details, just that it was a pain to get all the cases right.
The issue Fedora is describing is when an rpath is set to a value that is already in the system path. This makes sense to me to avoid.
The cases that I recall creeping up most often were someone building against a non-system-path mysql installation (like /opt/local/mysql-x.yz) and then without rpath at runtime they'd get a system-path mysql that was a different version and it would result in unexpected behavior.
I remember spending a LOT of time on this years ago. Not the details, just that it was a pain to get all the cases right.
The issue Fedora is describing is when an rpath is set to a value that is already in the system path. This makes sense to me to avoid.
Thanks for confirmation!
The cases that I recall creeping up most often were someone building against a non-system-path mysql installation (like /opt/local/mysql-x.yz) and then without rpath at runtime they'd get a system-path mysql that was a different version and it would result in unexpected behavior.
So if i understood that correctly, that would mean it needs to be set for all the non-standard build cases, and only the standard system path is an exception? That sounds like a safe default, then.
One more question- could the standard system path be somehow detected, and does it make sense to implement it in extconf.rb
? Or should we rather just add the option for our build? (I'm not sure how many distributions will need to handle it the same way.)