working directory under Mac OS X

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

working directory under Mac OS X

Eliot Miranda-2
 
Hi Andreas, Matthew, John, (Hi All),

    I'm getting my house in order, merging the Newspeak VM into the OSCog platforms hierarchy.  One big difference between trunk vms (and Newspeak) and Qwaq VMs on Mac OS X is that in the Qwaq VM there is an early chdir to the directory containing the .app, whereas in the non-Qwaq VMs the directory is left as is.  If you look at http://squeakvm.org/svn/squeak/trunk/platforms/Mac OS/vm/sqMacMain.c you'll see that this chdir has been commented-out, so there was a point when it was in standard VMs.  Andreas, Matthew, do you think the Qwaq behavour is important to preserve?  John, what's the history of this?  Should I even bother trying to maintain the Qwaq behaviour and instead disable it in all builds (Qwaq, OSCog, Newspeak)?

best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

johnmci

Well I think this is a discussion point for the squeak & pharo list.
The comment is quite clear:
"LETS NOT DO THIS, SEE what happens for people wanting to do
./Squeak.app foobar.image  zingger.st"

At 3.8.19b1     I did
sqMacMain.c                             drop cwd to VM directory at
startup time to help script writers use ../ or ./
Mmm spring 2008


Historically, John Maloney's original code did the chdir in o-s 7.5.x
 that was ported forward into os-x when it ran as pre-mach-o app and
at the time there was some confusing signals from Apple about should
apps change to the home directory etc... So it sat until I added in
sufficent unix cmd options/parms awarness for people to complain about
the behaviour.


On Wed, May 25, 2011 at 4:55 PM, Eliot Miranda <[hidden email]> wrote:

> Hi Andreas, Matthew, John, (Hi All),
>     I'm getting my house in order, merging the Newspeak VM into the OSCog
> platforms hierarchy.  One big difference between trunk vms (and Newspeak)
> and Qwaq VMs on Mac OS X is that in the Qwaq VM there is an early chdir to
> the directory containing the .app, whereas in the non-Qwaq VMs the directory
> is left as is.  If you look
> at http://squeakvm.org/svn/squeak/trunk/platforms/Mac OS/vm/sqMacMain.c
> you'll see that this chdir has been commented-out, so there was a point when
> it was in standard VMs.  Andreas, Matthew, do you think the Qwaq behavour is
> important to preserve?  John, what's the history of this?  Should I even
> bother trying to maintain the Qwaq behaviour and instead disable it in all
> builds (Qwaq, OSCog, Newspeak)?
> best,
> Eliot



--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

Andreas.Raab
 
FWIW, I'm completely neutral on this just as long as we ensure that
"FileDirectory default" points to the image directory. Whether the OS'
cwd is the image, the vm, or some random directory is completely
irrelevant from my POV.

Cheers,
   - Andreas

On 5/26/2011 1:10, John McIntosh wrote:

> Well I think this is a discussion point for the squeak&  pharo list.
> The comment is quite clear:
> "LETS NOT DO THIS, SEE what happens for people wanting to do
> ./Squeak.app foobar.image  zingger.st"
>
> At 3.8.19b1     I did
> sqMacMain.c                             drop cwd to VM directory at
> startup time to help script writers use ../ or ./
> Mmm spring 2008
>
>
> Historically, John Maloney's original code did the chdir in o-s 7.5.x
>   that was ported forward into os-x when it ran as pre-mach-o app and
> at the time there was some confusing signals from Apple about should
> apps change to the home directory etc... So it sat until I added in
> sufficent unix cmd options/parms awarness for people to complain about
> the behaviour.
>
>
> On Wed, May 25, 2011 at 4:55 PM, Eliot Miranda<[hidden email]>  wrote:
>> Hi Andreas, Matthew, John, (Hi All),
>>      I'm getting my house in order, merging the Newspeak VM into the OSCog
>> platforms hierarchy.  One big difference between trunk vms (and Newspeak)
>> and Qwaq VMs on Mac OS X is that in the Qwaq VM there is an early chdir to
>> the directory containing the .app, whereas in the non-Qwaq VMs the directory
>> is left as is.  If you look
>> at http://squeakvm.org/svn/squeak/trunk/platforms/Mac OS/vm/sqMacMain.c
>> you'll see that this chdir has been commented-out, so there was a point when
>> it was in standard VMs.  Andreas, Matthew, do you think the Qwaq behavour is
>> important to preserve?  John, what's the history of this?  Should I even
>> bother trying to maintain the Qwaq behaviour and instead disable it in all
>> builds (Qwaq, OSCog, Newspeak)?
>> best,
>> Eliot
>
>
Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

Stefan Marr

Hi Eliot,
Hi Esteban:


On 26 May 2011, at 09:02, Andreas Raab wrote:

> FWIW, I'm completely neutral on this just as long as we ensure that "FileDirectory default" points to the image directory. Whether the OS' cwd is the image, the vm, or some random directory is completely irrelevant from my POV.

I would be really happy if you could consistently remove the chdir.

From my point of view, it is very relevant.

However, "FileDirectory default" seems to be very underspecified. (The comment in the method does not tell me what it is supposed to mean.)
A "FileDirectory current", that reflects the current working directory of the shell the VM was started in, would certainly help all the people who use Smalltalk for automation on the command-line.

Thanks
Stefan

--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525

Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

Andreas.Raab
 
On 5/26/2011 9:16, Stefan Marr wrote:

>
> Hi Eliot,
> Hi Esteban:
>
>
> On 26 May 2011, at 09:02, Andreas Raab wrote:
>
>> FWIW, I'm completely neutral on this just as long as we ensure that "FileDirectory default" points to the image directory. Whether the OS' cwd is the image, the vm, or some random directory is completely irrelevant from my POV.
> I would be really happy if you could consistently remove the chdir.
>
>  From my point of view, it is very relevant.
>
> However, "FileDirectory default" seems to be very underspecified. (The comment in the method does not tell me what it is supposed to mean.)

Please let's not confuse matters here: What Eliot has been mentioning is
a chdir() call in the VM which I have no opinion about. What I do have
an opinion about is the notion of FileDirectory default which has always
been set to the image directory (see FileDirectory class startUp). This
should remain the same because there's lots of code which assumes
precisely that and if changes in the VM would cause this to be a
different directory, a lot of code would needlessly break. There could
very well be some other way of querying the startup directory but that
is not the question that was asked in this thread,

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

Stefan Marr

Hi Andreas:

On 26 May 2011, at 09:30, Andreas Raab wrote:

> On 5/26/2011 9:16, Stefan Marr wrote:
>>
>>
>> However, "FileDirectory default" seems to be very underspecified. (The comment in the method does not tell me what it is supposed to mean.)
>
> Please let's not confuse matters here: What Eliot has been mentioning is a chdir() call in the VM which I have no opinion about.
Yes, that was clear for me, and that is would I like to see changed.



> What I do have an opinion about is the notion of FileDirectory default which has always been set to the image directory (see FileDirectory class startUp).
The only thing I wanted to mention is, that it deserves to be included in the comment. At least from my perspective.
That is what I meant by being underspecified, thus, perhaps under-commented ;)

Anyway, once the VMs consistently omit the chdir, then a `FileDirectory current` or some other standard way to obtain the current working directory would be helpful. (And a more verbose comment in FileDirectory default would help to distinguish the two).
But perhaps something similar to `FileDirectory current` is already hidden somewhere in the image?

Thanks
Stefan


--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525

Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

Igor Stasenko
In reply to this post by johnmci

On 26 May 2011 01:10, John McIntosh <[hidden email]> wrote:
>
> Well I think this is a discussion point for the squeak & pharo list.
> The comment is quite clear:
> "LETS NOT DO THIS, SEE what happens for people wanting to do
> ./Squeak.app foobar.image  zingger.st"
>

+1. chdir is evil.
I would understand if it would have some benefit.. but its not.. it is
there only to make command-line harder.

> At 3.8.19b1     I did
> sqMacMain.c                             drop cwd to VM directory at
> startup time to help script writers use ../ or ./
> Mmm spring 2008
>
>
> Historically, John Maloney's original code did the chdir in o-s 7.5.x
>  that was ported forward into os-x when it ran as pre-mach-o app and
> at the time there was some confusing signals from Apple about should
> apps change to the home directory etc... So it sat until I added in
> sufficent unix cmd options/parms awarness for people to complain about
> the behaviour.
>
>
> On Wed, May 25, 2011 at 4:55 PM, Eliot Miranda <[hidden email]> wrote:
>> Hi Andreas, Matthew, John, (Hi All),
>>     I'm getting my house in order, merging the Newspeak VM into the OSCog
>> platforms hierarchy.  One big difference between trunk vms (and Newspeak)
>> and Qwaq VMs on Mac OS X is that in the Qwaq VM there is an early chdir to
>> the directory containing the .app, whereas in the non-Qwaq VMs the directory
>> is left as is.  If you look
>> at http://squeakvm.org/svn/squeak/trunk/platforms/Mac OS/vm/sqMacMain.c
>> you'll see that this chdir has been commented-out, so there was a point when
>> it was in standard VMs.  Andreas, Matthew, do you think the Qwaq behavour is
>> important to preserve?  John, what's the history of this?  Should I even
>> bother trying to maintain the Qwaq behaviour and instead disable it in all
>> builds (Qwaq, OSCog, Newspeak)?
>> best,
>> Eliot
>
>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

David T. Lewis
In reply to this post by Andreas.Raab
 
On Thu, May 26, 2011 at 09:02:24AM +0200, Andreas Raab wrote:
>
> FWIW, I'm completely neutral on this just as long as we ensure that
> "FileDirectory default" points to the image directory. Whether the OS'
> cwd is the image, the vm, or some random directory is completely
> irrelevant from my POV.
>
> Cheers,
>   - Andreas

+1

Dave

>
> On 5/26/2011 1:10, John McIntosh wrote:
> >Well I think this is a discussion point for the squeak&  pharo list.
> >The comment is quite clear:
> >"LETS NOT DO THIS, SEE what happens for people wanting to do
> >./Squeak.app foobar.image  zingger.st"
> >
> >At 3.8.19b1     I did
> >sqMacMain.c                             drop cwd to VM directory at
> >startup time to help script writers use ../ or ./
> >Mmm spring 2008
> >
> >
> >Historically, John Maloney's original code did the chdir in o-s 7.5.x
> >  that was ported forward into os-x when it ran as pre-mach-o app and
> >at the time there was some confusing signals from Apple about should
> >apps change to the home directory etc... So it sat until I added in
> >sufficent unix cmd options/parms awarness for people to complain about
> >the behaviour.
> >
> >
> >On Wed, May 25, 2011 at 4:55 PM, Eliot Miranda<[hidden email]>  
> >wrote:
> >>Hi Andreas, Matthew, John, (Hi All),
> >>     I'm getting my house in order, merging the Newspeak VM into the OSCog
> >>platforms hierarchy.  One big difference between trunk vms (and Newspeak)
> >>and Qwaq VMs on Mac OS X is that in the Qwaq VM there is an early chdir to
> >>the directory containing the .app, whereas in the non-Qwaq VMs the
> >>directory
> >>is left as is.  If you look
> >>at http://squeakvm.org/svn/squeak/trunk/platforms/Mac OS/vm/sqMacMain.c
> >>you'll see that this chdir has been commented-out, so there was a point
> >>when
> >>it was in standard VMs.  Andreas, Matthew, do you think the Qwaq behavour
> >>is
> >>important to preserve?  John, what's the history of this?  Should I even
> >>bother trying to maintain the Qwaq behaviour and instead disable it in all
> >>builds (Qwaq, OSCog, Newspeak)?
> >>best,
> >>Eliot
> >
> >
Reply | Threaded
Open this post in threaded view
|

Re: working directory under Mac OS X

Eliot Miranda-2
In reply to this post by Eliot Miranda-2
 
Thanks all.  It's getting nuked :)

On Wed, May 25, 2011 at 1:55 PM, Eliot Miranda <[hidden email]> wrote:
Hi Andreas, Matthew, John, (Hi All),

    I'm getting my house in order, merging the Newspeak VM into the OSCog platforms hierarchy.  One big difference between trunk vms (and Newspeak) and Qwaq VMs on Mac OS X is that in the Qwaq VM there is an early chdir to the directory containing the .app, whereas in the non-Qwaq VMs the directory is left as is.  If you look at http://squeakvm.org/svn/squeak/trunk/platforms/Mac OS/vm/sqMacMain.c you'll see that this chdir has been commented-out, so there was a point when it was in standard VMs.  Andreas, Matthew, do you think the Qwaq behavour is important to preserve?  John, what's the history of this?  Should I even bother trying to maintain the Qwaq behaviour and instead disable it in all builds (Qwaq, OSCog, Newspeak)?

best,
Eliot