mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

Please don't set DT_RPATH by default

Open pvalena opened this issue 3 years ago • 2 comments

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

pvalena avatar Jul 30 '21 16:07 pvalena

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.

sodabrew avatar Jul 30 '21 18:07 sodabrew

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.)

pvalena avatar Jul 31 '21 07:07 pvalena