Apache OpenOffice (AOO) Bugzilla – Issue 88845
testshl2 doesn't load library from given path
Last modified: 2013-08-07 15:34:52 UTC
when calling testshl2 with a relative path to the library to check (e.g. "testshl2 ../unxmacxi/lib/libtests..dylib") it seems to prefer the library found in solver with the same name. there is a workaround to add the local directory to the DYLD_LIBRARY_PATH variable. but no, that's no fix. if testshl2 is given a path, it should use it.
Please start the test again with parameter -verbose testshl2 -verbose ../unxmacxi/lib/libtests..dylib This will show you, which "absolute" path is taken. If the Path is wrong then, this could be a problem in sal module. The relative path '../unxmacxi/lib/libtests..dylib' is _suSysPath and I'm doing the follows: // takes the current absolute path rtl::OUString curDirPth; osl_getProcessWorkingDir( &curDirPth.pData ); // add the current path and the relative path together, removes the '..' and convert the path to a file url. osl::FileBase::getAbsoluteFileURL( curDirPth, _suSysPath, fURL );
Hmmm... testshl2 use module.c (load() function to load dynamic libraries.) Please have a look into this URL. http://developer.apple.com/documentation/DeveloperTools/Reference/MachOReference/Reference/reference.html#//apple_ref/c/func/dlopen As you can read, the given library name to testshl2 is a 'pathname' due to the fact it contains '/' so first is looked into DYLD_LIBRARY_PATH and if the library is found by this path it will be taken. You have to change the DYLD_LIBRARY_PATH first. BTW: I couldn't change this variable this way for me in my env (with set DYLD_LIBRARY_PATH=...) maybe this is one of the 'security' features of macos. Therefore I will check if a 'simple fix' like the follows will help here. 1. Get the absolute path of the library 2. change to the absolute path by chdir() 3. remove any '/' from the library name 4. dlopen the library by sal::Module::load() 5. chdir back to the old path 6. run the rest.
Interesting :)
fixed as described above.
works for me now
mac is fine now but linux is broken. now testshl2 on linux fetches the library from solver instead of the given path...
fixed. I have redesigned the load library, now: Linux, Solaris & Windows will load the test libraries with absolute path (relative path will convert to absolute path) BTW: Linux and Windows will fail with local path, Solaris work right with both. MacOSX will load the test libraries with local path (chdir() to the path, then load without any path) MacOSX will fail with absolute path. Other OS are unknown(FreeBSD, NetBSD, AIX, OS/2) the default behaviour is here to load with absolute path, as before. As second there exists 2 more parameters like -localpath to force testshl2 to load a library by chdir() to the given path then load the library without path. -absolutepath to force testshl2 to load a library with absolute path. As third, there exists a simple selftest in 'workben/selftest' directory. To run the test, call dmake, to build the test libraries, call deliver, to copy a test library into the solver directory, call dmake test to run the test. More you can find in the README.txt in this directory also. HTH
.
verified
integrated, will be closed.