[104521] trunk/dports/databases/oracle-instantclient/Portfile

Daniel J. Luke dluke at geeklair.net
Sat Mar 30 13:10:37 PDT 2013


On Mar 30, 2013, at 12:03 AM, Ryan Schmidt <ryandesign at macports.org> wrote:
> On Mar 28, 2013, at 19:28, Daniel J. Luke wrote:
>> On Mar 27, 2013, at 9:47 AM, Daniel J. Luke wrote:
>>> On Mar 27, 2013, at 9:40 AM, Daniel J. Luke wrote:
>>>> On Mar 26, 2013, at 10:02 PM, Ryan Schmidt wrote:
>>>>> On Mar 26, 2013, at 20:55, Daniel J. Luke wrote:
>>>>>> On Mar 26, 2013, at 8:28 PM, ryandesign at macports.org wrote:
>>>>>>> 
>>>>>>> +    # Oracle builds the libraries with strange install_names, which we fix, for
>>>>>>> +    # neatness. Unfortunately users must still set DYLD_LIBRARY_PATH in their
>>>>>>> +    # environment because one of the libraries, libociei, is dynamically loaded
>>>>>>> +    # at runtime rather than being linked to.
>>>>>> 
>>>>>> can't we just add an rpath to applications that use oracle-instantclient? (it works with sqlplus, at least in my testing).
>>>>> 
>>>>> I'd love to find a better solution but I'm not sure what you mean.
>>>> 
>>>> On the binary that would need DYLD_LIBRARY_PATH set in order to run, you can run install_name_tool -add_rpath /path/to/oracle/libs binary instead and it will be able to find them when it tries to load them at runtime.
>>>> 
>>>> I've only tested this on the sqlplus command line oracle client (from instantclient-sqlplus-macos.x64-11.2.0.3.0.zip), but it seems to work ok.
>>>> 
>>>> If the dependent library is always loaded from one of the other libs, setting rpath there might fix it without having to do it on any binary that is loading it at runtime (but I haven't investigated to see if that is true). I'm going to see if I need to set rpath on my local build of DBD::Oracle today...
>>> 
>>> setting an rpath on libclntsh.dylib.11.1 (and nothing else) makes sqlplus and DBD::Oracle happy. I imagine it will work for other things as well (and enable use of the libs without setting DYLD_* variable(s)).
>> 
>> Ryan - have you tried this at all on any of the ports you maintain that use oracle-instantclient? I think just adding the rpath to libclntsh.dylib.11.1 should work for most apps that use the oracle libs.
> 
> No, I haven't tried it. I also don't use Oracle and don't know if I even know how to reproduce the problem that this would fix, but I haven't tried to do that yet either.


Well, the problem is having to set DYLD_LIBRARY_PATH (which is dumb, but Oracle always tells you to set the equivalent on every platform).

I know that this fixes it for both the 'sqlplus' command line oracle client (which otherwise needs DYLD_LIBRARY_PATH set) and for runtime use of DBD::Oracle. Having the search path localized to the library makes more sense to me anyway... I haven't used this port in the past, but I'd be happy to test any ports you'd like me to test to verify.

The only thing I'm not sure of is which library (or libraries) should get the rpath to cover every use (and I'm not sure if we know all of the places where the libs are depending on having DYLD_LIBRARY_PATH set).

--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+                        
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+


More information about the macports-dev mailing list