[Vm-dev] Problems with Mac VM 5.7 and 5.8 on the command-line

Igor Stasenko siguctua at gmail.com
Thu May 19 11:59:24 UTC 2011


On 19 May 2011 13:49, Stefan Marr <squeak at stefan-marr.de> wrote:
>
> Hi Esteban:
>
> I debugged a bit what is going on.
>
> The main issue seems to be that the VM changes its working directory.
> The reason seems to be that the loading mechanism for plugin depends on the wrong directory.
> At least, disabling the chdir leads to warnings like this: squeak: could not load plugin `FilePlugin'.
>

The plugin search algorithm IMO is over-engineered.
I think we should leave only few locations where VM searching for
plugins: some canonical VM 'plugins' dir, which is relative to VM
module. And current dir. Rest is up to OS defaults.
This would simplify things.

> I don't really understand why that is the way to go. Actually I would expect that the application respects the current working directory and uses it as its own. At least as a command-line user, that's my expectation.
>

+1

> So, the question is, how to fix it?
>
> On the upside, removing chdir seems to restore the expected behavior: at least it parses the arguments fine and accepts the image after a -headless even with a relative path. So, all necessary functionality is there, only the plugin loading would need adaptation.
>
> Best regards
> Stefan
>
> PS:
>
> The code is in sqMacMain.c around line 370:
>
> {
>        // Change working directory, this works under os-x, previous logic worked pre os-x 10.4
>
>        char target[4097],temp[4097];
>        getVMPathWithEncoding(target,gCurrentVMEncoding);
>        sqFilenameFromStringOpen(temp,(sqInt) target, strlen(target));
>        chdir(temp);
> }
>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list