[Vm-dev] Plugins Directory

tim Rowledge tim at rowledge.org
Wed Apr 2 18:40:05 UTC 2014

On 02-04-2014, at 11:33 AM, gettimothy <gettimothy at zoho.com> wrote:

> Hi Colin,
> >I've been working on a custom build of Cog (rev 2886) on Linux. I notice that the VM always looks  for plugins in the same directory as the VM binary, and thus we need a wrapper script to set SQUEAK_PLUGINS and LD_LIBRARY_PATH correctly. 
> >I'd like to do away with the wrapper script in my specific case, since I know in advance where everything will be installed. Is there a way to specify the plugin directory at compile time?
> At the bottom of the class comment of VMMaker is a discussion of plugins.
> In there is this little snippet:
> Known problems:-
> a) since Squeak has really poor filename handling, you can't simply change the directory names to '/foo/bar/myEvilCodeBase' and expect it to work. You fix file names and I'll fix VMMaker :-)
> My guess on hacking it would be on the class side of VMMaker under the accessing protocol: coreVMDirName, machinesDirName, etc...
> That's just  conjecture on my part.

That’s the bit about dealing with plugins at generate time rather than compile time.

Colin, look into platforms/unix/vm/sqUnixExternalPrims.c->ioLoadModule() where there is 
  if ((   handle= tryLoading(    "./",			pluginName))
      || (handle= tryLoadingPath("SQUEAK_PLUGIN_PATH",	pluginName))
      || (handle= tryLoadingPath("LD_LIBRARY_PATH",	pluginName))
      || (handle= tryLoading(    "",			pluginName))
#    if defined(VM_X11DIR)
      || (handle= tryLoading(VM_X11DIR"/",		pluginName))
#    endif

Add path to test, remove other checks, search database, whatever.

Actually, adding ability to check across the net for a newer-than-local version might be interesting….

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Sanitary landfill

More information about the Vm-dev mailing list