[squeak-dev] Has anyone gotten FFI working on squeak on a Mac lately?

LawsonEnglish LEnglish5 at cox.net
Sat Aug 15 20:35:41 UTC 2020


Thanks.I checked, and inded my dylib was pointing back to the directory it was created in. I’ll look at how the bundled libraries’ paths are set up and try to recreate that.

Should I get it working, I foresee  several new “From the very start” videos in the works, but I think I’ll need a new title for the series at this level.

L

> On Aug 14, 2020, at 9:19 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> Hi Lawson,
> 
>> On Aug 14, 2020, at 6:21 PM, LawsonEnglish <LEnglish5 at cox.net> wrote:
>> 
>> I’m not saying it isn’t stable.
> 
> I know.  I was just saying I don’t think anything has been broken recently, so the issue is not in the FFI per se.
> 
>> However, the test functions are in the FFI plugin, which is a .bundle. I’ve been trying to use a .dylib.
> 
> There’s a SqueakFFIPlugin dylib (a dylib in all but name) in SqueakFFIPlugin.bundle/Contents/MacOS/SqueakFFIPlugin.  That’s what the FFI actually loads.
> 
>> I realize that this should. make no difference, and yet, as I said, Craig Latta watched me do the whole thing from scratch via skype screensharing and he didn’t see an error.
>> 
>> SO again: has anyone used a non-Squeak distribution/non-bundle with FFI lately?
> 
> Yes.
> 
>> I tested it on both Catlaina and Mojave and I get teh External module not found error, even with my own .dylib that isn’t hardcoded to sit in a specific directory.
>> 
>> WHich leads to a suggestion: if it really is a Mac OS x issue, rather than my own stupidity, it may be necessary to start testing against a library that is merely sitting in the Resource directory, rather than inside a .bundle.
>> 
>> WHich is why I’m still asking: has anyone used their own library (outside a .bundle) with FFI lately on Mac OS X, Catalina OR Mojave?
> 
> Yes, and it is extremely tricky.  I’ve been using libav and libffmpeg and others.  I’ve found one has to examine carefully the output of otool -L and use install_name_tool to change the hard-coded paths of any other non-system Dublin’s a Bykov depends on and make sure one understands and uses @rpath.  If your dylib uses any other dylib you’re going to have to do the same exploration.
> 
>> 
>> I’m still trying to figure out how to PUT a library into a .bundle, or I’d test my theory.
> 
> Look at the vm build makefiles for macos; they do this and they can be configured to generate dylibs in a directory, etc.
> 
> So first question, what’s the output of
>     otool -L mylib
> 
> (You can omit all the /System/Library ones)
> 
>> L
>> 
>>> On Aug 14, 2020, at 6:14 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>>> 
>>> Hi Lawson,
>>> 
>>>>> On Aug 14, 2020, at 6:04 PM, LawsonEnglish <LEnglish5 at cox.net> wrote:
>>>> 
>>>> I realize that the test library works, but I can’t use ANY kind of library user specified/user made library for FFI with Squeak on Catalina OR Mojave, and I can’t tell what I am doing wrong.
>>>> 
>>>> I let Craig Latta watch me, via screen sharing on skype, set up the whole thing from scratch, and his response was to start to coach me in how to create and use the VM with a c-debugger.
>>>> 
>>>> So I don’t think I’m doing anything obviously wrong or at least Craig didn’t catch it while he watched.
>>>> 
>>>> Still don’t have the VM working, so I thought I ask if anyone has actually done it lately? The FFIPrim libray is in a .bundle, which may or may not be signficiant to this issue.
>>> 
>>> The FFI tests work out if the biz for me on MacOS 64-bit. The test functions are included in the FFI plugin.  I haven’t tried x86/32-bit in a while but I’d be surprised if this was broken.  The code is stable.
>>> 
>>>> 
>>>> 
>>>> L
>>>> 
>>> 
>> 
>> 
> 



More information about the Squeak-dev mailing list