[Cuis-dev] Cuis on macOS - Dynamic loading of Homebrew libraries

Jon Raiford raiford at labware.com
Fri Apr 5 05:49:10 PDT 2024


Please ignore. I’ll work with Juan offline about this. It’s obviously his call if anything gets published. I am perhaps being a bit eager to engage with the community. If something gets decided I’m sure it will be shared. Of course it could be that nothing happens. 😊

*waves hands* You did not see anything here!

Cheers,
Jon

From: Cuis-dev <cuis-dev-bounces at lists.cuis.st> on behalf of Jon Raiford via Cuis-dev <cuis-dev at lists.cuis.st>
Date: Friday, April 5, 2024 at 7:52 AM
To: Discussion of Cuis Smalltalk <cuis-dev at lists.cuis.st>
Cc: Jon Raiford <raiford at labware.com>
Subject: Re: [Cuis-dev] Cuis on macOS - Dynamic loading of Homebrew libraries
As a quick follow up to this, I think we may have come up with a good compromise. I’m going to look into adding Cuis to homebrew so it can be installed like “brew install cuis” or “brew install cuis-smalltalk”. As part of the installation I’ll add the DYLD_LIBRARY_PATH reference. This way if everything is installed with Homebrew then it should all “just work” but won’t impose on the upstream Cuis project. Right now I’m just playing with this idea. If anyone has any comments or suggestions there will be plenty of time to consider them before publishing anything.

Jon

From: Cuis-dev <cuis-dev-bounces at lists.cuis.st> on behalf of Jon Raiford via Cuis-dev <cuis-dev at lists.cuis.st>
Date: Thursday, April 4, 2024 at 10:36 AM
To: Discussion of Cuis Smalltalk <cuis-dev at lists.cuis.st>
Cc: Jon Raiford <raiford at labware.com>
Subject: [Cuis-dev] Cuis on macOS - Dynamic loading of Homebrew libraries
Our group has tiptoed around this problem for a little bit but it would be nice to actually address it.  I’m curious what you all think.

If you want to use FFI calls on a Mac to libraries installed via Homebrew (or other ways that don’t use the standard library path, really) then you have to set a library path just before launching Cuis. As I understand it, the environment variable DYLIB_LIBRARY_PATH is used to specify this path, however Apple wipes this at each startup as a security mechanism.

Here is an old discussion of a similar problem: https://forums.developer.apple.com/forums/thread/13161<https://forums.developer.apple.com/forums/thread/13161>

So the question is, should the Open Smalltalk VM reference the homebrew library paths to make digesting these libraries easier? Should Cuis add something like this to the launch script for Mac?

                export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/homebrew/lib

Or should this fall to application developers to do it themselves? I don’t think Homebrew folks have any intention of switching to the Apple standard library folders.

Ultimately I think it should be possible to launch a Cuis app from Launchpad and I don’t think it lets you launch from a script, but honestly I’m not very familiar with that.

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240405/722025de/attachment-0001.htm>


More information about the Cuis-dev mailing list