<br><br><div class="gmail_quote">On Thu, May 19, 2011 at 5:06 AM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
<br>
On 19.05.2011, at 13:49, Stefan Marr wrote:<br>
<br>
><br>
> Hi Esteban:<br>
><br>
> I debugged a bit what is going on.<br>
><br>
> The main issue seems to be that the VM changes its working directory.<br>
> The reason seems to be that the loading mechanism for plugin depends on the wrong directory.<br>
> At least, disabling the chdir leads to warnings like this: squeak: could not load plugin `FilePlugin'.<br>
><br>
> 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.<br>
<br>
</div>But a Mac OS X .app bundle is not a command line application. It expects the Resources directory to be the current directory. That is so that you can use relative paths to specify resources. I guess this is just a convention, though.<br>
</blockquote><div><br></div><div>I don't think so. If one launches a .app with the open command (and indeed by clicking on a document which opens its associated app, or clicking on the app) then the current working directory is the root directory /. One can find the Resources directory from the path of the executable which will be in Application.app/Contents/MacOS/theexe and so the Resources directory is parent(fullpath(theexe))/Resources.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I would expect more things to break if you change this. E.g., the SqueakImageName in Info.plist needs to be given as a relative path so that an "all-in-one" bundle works everywhere. It is relative to the Resources directory. I'm not sure if the implementation relies on the cwd or if it actually expands the path relative to Resources.<br>
</blockquote><div><br></div><div>I think this can be fixed. Just yesterday with the Newspeak VM I'm working on I found that the chdir breaks a particular use of mercurial. So at least in the Newspeak VM the chdir has been eliminated.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Removing the chdir seems like a good idea, I'm just saying that there may be more places relying on cwd == Resources.<br></blockquote><div><br></div><div>Agreed on both.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
- Bert -<br>
</font><div><div></div><div class="h5"><br>
> So, the question is, how to fix it?<br>
><br>
> 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.<br>
><br>
> Best regards<br>
> Stefan<br>
><br>
> PS:<br>
><br>
> The code is in sqMacMain.c around line 370:<br>
><br>
> {<br>
> // Change working directory, this works under os-x, previous logic worked pre os-x 10.4<br>
><br>
> char target[4097],temp[4097];<br>
> getVMPathWithEncoding(target,gCurrentVMEncoding);<br>
> sqFilenameFromStringOpen(temp,(sqInt) target, strlen(target));<br>
> chdir(temp);<br>
> }<br>
><br>
><br>
><br>
><br>
> On 19 May 2011, at 01:24, Esteban Lorenzano wrote:<br>
><br>
>><br>
>> Hi,<br>
>> Sorry for the delayed answer.<br>
>> Yes, there are problems with command line and osx vms. Yes... the cocoa versions are experimenting a lot of problems with it (well... more specifically, they are different than what users expect, and not all of them are present).<br>
>> I would like to unify the command line between osx, windows and linux vms... but I don't know where to start.<br>
>> If someone can point me in the right direction (which options should be present... maybe linux version should rule?), I will add this job to the "infinite todo" :)<br>
>><br>
>> cheers,<br>
>> Esteban<br>
>><br>
>> El 16/05/2011, a las 1:40p.m., Stefan Marr escribió:<br>
>><br>
>>><br>
>>> Hi:<br>
>>><br>
>>> On 16 May 2011, at 18:19, Mariano Martinez Peck wrote:<br>
>>><br>
>>>> You have the .surces and .changes properly locacted, haven't you? because otherwise you have a nice popup waiting for you ;) but your are headless hheheh<br>
>>><br>
>>> There is always room for me doing something stupid, but since the following works just fine with Eliot's Cog build, I assume it is a bug in the Mac VMs:<br>
>>><br>
>>> smarr@minerva:~/tmp/pharo$ /Applications/Cog.app/Contents/MacOS/Croquet -headless ~/tmp/pharo/Pharo-1.2.image HelloWorld<br>
>>> Hello World!<br>
>>> HelloWorld<br>
>>> smarr@minerva:~/tmp/pharo$<br>
>>><br>
>>><br>
>>> Bye the way, it would be awesome if there would be a platform independent way to produce newlines on the console...<br>
>>><br>
>>><br>
>>> Best regards<br>
>>> Stefan<br>
>>><br>
>>><br>
>>> --<br>
>>> Stefan Marr<br>
>>> Software Languages Lab<br>
>>> Vrije Universiteit Brussel<br>
>>> Pleinlaan 2 / B-1050 Brussels / Belgium<br>
>>> <a href="http://soft.vub.ac.be/~smarr" target="_blank">http://soft.vub.ac.be/~smarr</a><br>
>>> Phone: <a href="tel:%2B32%202%20629%202974" value="+3226292974">+32 2 629 2974</a><br>
>>> Fax: <a href="tel:%2B32%202%20629%203525" value="+3226293525">+32 2 629 3525</a><br>
>>><br>
>><br>
><br>
> --<br>
> Stefan Marr<br>
> Software Languages Lab<br>
> Vrije Universiteit Brussel<br>
> Pleinlaan 2 / B-1050 Brussels / Belgium<br>
> <a href="http://soft.vub.ac.be/~smarr" target="_blank">http://soft.vub.ac.be/~smarr</a><br>
> Phone: <a href="tel:%2B32%202%20629%202974" value="+3226292974">+32 2 629 2974</a><br>
> Fax: <a href="tel:%2B32%202%20629%203525" value="+3226293525">+32 2 629 3525</a><br>
><br>
<br>
<br>
</div></div></blockquote></div><br>