uFFI: Debugging "External module not found" Error
I was trying to get Pharo-LibVLC working on Mac. The following is copied from a GH issue[1]:
I have VLC installed via Homebrew cask, the formula for which simply installs the dmg. I first tried supplying a full path to the dylib that the VLC app uses (/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib), which resulted in "Error: External module not found". I then remembered some trouble people have had in the past with FFI lookup locations and tried copying into the VM's plugin folder both a link and the actual dylib, with the same error. I read the uFFI booklet, but didn't learn anything more.
I also checked that the VLC lib was 64-bit via:
lipo -info .../Pharo.app/Contents/MacOS/Plugins/libvlc.5.dylib which returned: Non-fat file: .../Plugins/libvlc.5.dylib is architecture: x86_64
[1] https://github.com/badetitou/Pharo-LibVLC/issues/1 ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
On Wed, 4 Dec 2019 at 00:26, Sean P. DeNigris <sean@clipperadams.com> wrote:
I was trying to get Pharo-LibVLC working on Mac. The following is copied from a GH issue[1]:
I have VLC installed via Homebrew cask, the formula for which simply installs the dmg. I first tried supplying a full path to the dylib that the VLC app uses (/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib), which resulted in "Error: External module not found". I then remembered some trouble people have had in the past with FFI lookup locations and tried copying into the VM's plugin folder
One catch that has confused me in the past, is when the system caches that it couldn't find the external module, so even when I copyied it to the VM folder or got the path correct, it continued to fail until I restarted the Image. cheers -ben
both a link and the actual dylib, with the same error. I read the uFFI booklet, but didn't learn anything more.
I also checked that the VLC lib was 64-bit via:
lipo -info .../Pharo.app/Contents/MacOS/Plugins/libvlc.5.dylib which returned: Non-fat file: .../Plugins/libvlc.5.dylib is architecture: x86_64
[1] https://github.com/badetitou/Pharo-LibVLC/issues/1
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Ben Coman wrote
One catch that has confused me in the past, is when the system caches that it couldn't find the external module, so even when I copyied it to the VM folder or got the path correct, it continued to fail until I restarted the Image.
Great gotcha! We should add that to the docs. I'll have a go after I figure this error out. In my case, restarting did not help :/ ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Hi Sean, On Tue, 3 Dec 2019 at 17:26, Sean P. DeNigris <sean@clipperadams.com> wrote:
I was trying to get Pharo-LibVLC working on Mac. The following is copied from a GH issue[1]:
I have VLC installed via Homebrew cask, the formula for which simply installs the dmg. I first tried supplying a full path to the dylib that the VLC app uses (/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib), which resulted in "Error: External module not found". I then remembered some trouble people have had in the past with FFI lookup locations and tried copying into the VM's plugin folder both a link and the actual dylib, with the same error. I read the uFFI booklet, but didn't learn anything more.
I also checked that the VLC lib was 64-bit via:
lipo -info .../Pharo.app/Contents/MacOS/Plugins/libvlc.5.dylib which returned: Non-fat file: .../Plugins/libvlc.5.dylib is architecture: x86_64
The same message is returned whether the module itself isn't found, or if one of its dependencies can't be found. On linux you can check dependencies with `ldd file.so`, I don't know what the Mac equivalent is. HTH, Alistair
Alistair Grant wrote
The same message is returned whether the module itself isn't found, or if one of its dependencies can't be found.
Good to know. I wonder if we can't provide more detailed error messages here... Alistair Grant wrote
On linux you can check dependencies with `ldd file.so`, I don't know what the Mac equivalent is.
Apparently, it's `otool -L whatever.dylib`, which returns: @rpath/libvlc.dylib (compatibility version 12.0.0, current version 12.0.0) @rpath/libvlccore.dylib (compatibility version 10.0.0, current version 10.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) Still investigating... ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
This is the most annoying thing about UFFI - the library search seems to opaque and I don't understand how it works. So far I am finding best practice is to find the library yourself and then provide the exact file path you want. That way, you can actually prompt the user to find it if you don't and they get a decent experience.
On Dec 3, 2019, at 11:34 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Alistair Grant wrote
The same message is returned whether the module itself isn't found, or if one of its dependencies can't be found.
Good to know. I wonder if we can't provide more detailed error messages here...
Alistair Grant wrote
On linux you can check dependencies with `ldd file.so`, I don't know what the Mac equivalent is.
Apparently, it's `otool -L whatever.dylib`, which returns: @rpath/libvlc.dylib (compatibility version 12.0.0, current version 12.0.0) @rpath/libvlccore.dylib (compatibility version 10.0.0, current version 10.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
Still investigating...
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
participants (4)
-
Alistair Grant -
Ben Coman -
Sean P. DeNigris -
Todd Blanchard