Why does #saveHeadless: create a .cha file???

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

Why does #saveHeadless: create a .cha file???

Thomas Gagné-2
5.x, 7.2.x didn't create .cha files for headless images.  Why does 7.4.1
create one?

--
Visit <http://tggagne.blogspot.com/>,<http://gagne.homedns.org/> or
      <http://gagne.homedns.org/~tgagne/> for more great reading.

Reply | Threaded
Open this post in threaded view
|

Re: Why does #saveHeadless: create a .cha file???

Alan Knight-2
Probably because in 7.4.x saving headless is just setting a variable (HeadlessImage shouldSaveHeadless:) and doing a save. I don't think that was a particularly conscious change - I didn't realize it omitted the change log in earlier versions. But I'm not sure that saving headless automatically should have the implication of making a runtime, which is what the absence of a change file suggests. It seems like calling #removeAllSources is reasonable as a separate step. Or for that matter, just delete the .cha file if you don't want it. The image should still start up fine if it's not there, and if headless, won't try to prompt you for where to find it.

In passing, I note that there's less need to  explicitly save headless, because you can start any image headless or headful via command-line options.

At 09:15 PM 9/7/2006, Thomas Gagné wrote:
>5.x, 7.2.x didn't create .cha files for headless images.  Why does 7.4.1 create one?
>--
>Visit <http://tggagne.blogspot.com/>,<http://gagne.homedns.org/> or
>     <http://gagne.homedns.org/~tgagne/> for more great reading.

--
Alan Knight [|], Cincom Smalltalk Development
[hidden email]
[hidden email]
http://www.cincom.com/smalltalk

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross

Reply | Threaded
Open this post in threaded view
|

Re: Why does #saveHeadless: create a .cha file???

Thomas Gagné-2
Our image has within it multiple stand-alone applications that work much
like standard linux programs.  When we save an image in Linux as
executables that can be executed by "running" the image from the command
line.

For instance, I've written example programs called cat and echo that do
the same thing as the commands "cat" and "echo".  They can be run from
the command line simply by entering cat.im and echo.im.  Obviously, our
programs do more than this but they must coexist with the rest of Linux
and so we don't use scripts because that wouldn't be very natural.

I just didn't expect to see the changes file, and when behavior like
that shows up it makes one wonder what other behaviors inside might have
changed, why wasn't that change noticed, and if it was noticed was it
thought to be a good thing?

--
Visit <http://tggagne.blogspot.com/>,<http://gagne.homedns.org/> or
      <http://gagne.homedns.org/~tgagne/> for more great reading.

Reply | Threaded
Open this post in threaded view
|

Re: Why does #saveHeadless: create a .cha file???

Alan Knight-2
If you want to create stand-alone executables this way, it might be worth doing something like
   DeploymentOptionsSystem current startInRuntime: true.
   SourceFileManager default removeAllSources.
before saving, which would make them thoroughly ignore change logs and other source files.

Recent versions have seen a great deal of change to the code around system startup and headlessness, so it's quite possible that there are other changed behaviours. We haven't seen too many show up, but that doesn't mean they aren't there.

Unfortunately, it appears that this behaviour is worse than I initially thought. Since it behaves for most purposes like a snapshot, that means that it is not only copying the change log, but it is switching the running image to use that change log. I've created AR 51186 for this. There is an as-yet-unreviewed set of changes, but the simplest workaround is that if you use the save headless as... option, save the development image first, and quit without saving afterwards.

As to why it wasn't noticed, I wasn't even aware of the old behaviour, and unfortunately the older parts of the system don't have much in the way of regression tests. Apparently no one else noticed it either, as it's a somewhat subtle change. Now that I've been alerted to it, I do think on the whole that it's a good thing (except for the part about the saving image using the new change log). Being a headless image does not necessarily imply being a runtime, and automatically losing all sources that were in the change log when saving headless doesn't seem desirable.

At 10:49 AM 9/8/2006, Thomas Gagné wrote:
>Our image has within it multiple stand-alone applications that work much like standard linux programs.  When we save an image in Linux as executables that can be executed by "running" the image from the command line.
>For instance, I've written example programs called cat and echo that do the same thing as the commands "cat" and "echo".  They can be run from the command line simply by entering cat.im and echo.im.  Obviously, our programs do more than this but they must coexist with the rest of Linux and so we don't use scripts because that wouldn't be very natural.
>
>I just didn't expect to see the changes file, and when behavior like that shows up it makes one wonder what other behaviors inside might have changed, why wasn't that change noticed, and if it was noticed was it thought to be a good thing?
>
>--
>Visit <http://tggagne.blogspot.com/>,<http://gagne.homedns.org/> or
>     <http://gagne.homedns.org/~tgagne/> for more great reading.

--
Alan Knight [|], Cincom Smalltalk Development
[hidden email]
[hidden email]
http://www.cincom.com/smalltalk

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross

Reply | Threaded
Open this post in threaded view
|

R: Why does #saveHeadless: create a .cha file???

Giorgio Ferraris
Hi,

For what I know, saving headless create an .ch at least from 7.3. I never
did headless apps before.
I don't know if the .ch is just there and the image still point to the old
one (I always do a saveHeadlessAs, because I took for granted that it was a
full snapshot), but if I save, I have both a .im and a .ch with the new
name.

Ciao

Giorgio

-----Messaggio originale-----
Da: Alan Knight [mailto:[hidden email]]
Inviato: venerdì 8 settembre 2006 22.50
A: Thomas Gagné; vwnc
Oggetto: Re: Why does #saveHeadless: create a .cha file???

If you want to create stand-alone executables this way, it might be worth
doing something like
   DeploymentOptionsSystem current startInRuntime: true.
   SourceFileManager default removeAllSources.
before saving, which would make them thoroughly ignore change logs and other
source files.

Recent versions have seen a great deal of change to the code around system
startup and headlessness, so it's quite possible that there are other
changed behaviours. We haven't seen too many show up, but that doesn't mean
they aren't there.

Unfortunately, it appears that this behaviour is worse than I initially
thought. Since it behaves for most purposes like a snapshot, that means that
it is not only copying the change log, but it is switching the running image
to use that change log. I've created AR 51186 for this. There is an
as-yet-unreviewed set of changes, but the simplest workaround is that if you
use the save headless as... option, save the development image first, and
quit without saving afterwards.

As to why it wasn't noticed, I wasn't even aware of the old behaviour, and
unfortunately the older parts of the system don't have much in the way of
regression tests. Apparently no one else noticed it either, as it's a
somewhat subtle change. Now that I've been alerted to it, I do think on the
whole that it's a good thing (except for the part about the saving image
using the new change log). Being a headless image does not necessarily imply
being a runtime, and automatically losing all sources that were in the
change log when saving headless doesn't seem desirable.

At 10:49 AM 9/8/2006, Thomas Gagné wrote:
>Our image has within it multiple stand-alone applications that work much
like standard linux programs.  When we save an image in Linux as executables
that can be executed by "running" the image from the command line.
>For instance, I've written example programs called cat and echo that do the
same thing as the commands "cat" and "echo".  They can be run from the
command line simply by entering cat.im and echo.im.  Obviously, our programs
do more than this but they must coexist with the rest of Linux and so we
don't use scripts because that wouldn't be very natural.
>
>I just didn't expect to see the changes file, and when behavior like that
shows up it makes one wonder what other behaviors inside might have changed,
why wasn't that change noticed, and if it was noticed was it thought to be a
good thing?
>
>--
>Visit <http://tggagne.blogspot.com/>,<http://gagne.homedns.org/> or
>     <http://gagne.homedns.org/~tgagne/> for more great reading.

--
Alan Knight [|], Cincom Smalltalk Development
[hidden email]
[hidden email]
http://www.cincom.com/smalltalk

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." -
Niall Ross