[squeak-dev] Squeak 4.4 Question

David T. Lewis lewis at mail.msen.com
Thu Jan 17 00:01:22 UTC 2013


I don't know anything about buildpacks or Heroku, but the image knows the
name of the sources file it wants to use, so if your shell script is able
to run Squeak you can just ask the image what it wants. Example script
attached.

<OT>
That reminds me, we really should have a way to just feed a start script
directly to the image through stdin rather than messing around with
files on disk. Maybe a VM command line parameter " - " that means "read
further input from stdin", similar to the way it is done with unix utilities
such as tar.
</OT>

Dave

On Thu, Jan 17, 2013 at 12:43:44AM +0100, Bernhard Pieber wrote:
> Hi Frank,
> 
> Couldn't you just add another environment variable SQUEAK_SOURCES_VERSION to your buildpack?
> 
> Cheers,
> Bernhard
> 
> Am 16.01.2013 um 23:50 schrieb Frank Shearar:
> 
> > On 16 January 2013 22:31, Bert Freudenberg <bert at freudenbergs.de> wrote:
> >> 
> >> On 16.01.2013, at 06:24, Frank Shearar <frank.shearar at gmail.com> wrote:
> >> 
> >>> On 16 January 2013 14:02, Yanni Chiu <yanni at rogers.com> wrote:
> >>>> On 16/01/13 4:40 AM, Frank Shearar wrote:
> >>>>> 
> >>>>> 
> >>>>> I have _also_ put files called SqueakV44.sources(.gz|zip). These are
> >>>>> identical to the V41 sources, but I've realised that for automating
> >>>>> things you REALLY REALLY want to have the sources file name derivable
> >>>>> from the Squeak version. At some point I will need to make Squeak 4.4
> >>>>> look for a SqueakV44.sources file, and I've added an item to the todo
> >>>>> list to have Squeak 4.5 do this automatically as part of the release
> >>>>> cycle.
> >>>> 
> >>>> 
> >>>> Won't that cause further confusion - the same file named differently. I
> >>>> don't understand how a file name that never changes, can be a problem for
> >>>> automating a build.
> >>> 
> >>> How can I derive "SqueakV41.sources" from "4.4"?
> >> 
> >> If we're doing the non-destructive source condensing resulting in a SqueakV44.sources file, then the same file linked or renamed to SqueakV41.sources can be used by a 4.1/4.2/4.3 image. Is that what you're asking?
> > 
> > Maybe I'm getting misunderstood because it's not clear that I'm
> > talking about the _names_ of files, not the contents.
> > 
> > If I want to write a buildpack to deploy a Smalltalk application to
> > Heroku, I'll have an environment variable called SQUEAK_VERSION and
> > another called BUILDPACK_SQUEAK_BASE_URL. That will contain the string
> > "4.4-12327". With that I can find out where exactly to find an image
> > tarball - http://ftp.squeak.org/4.4/Squeak4.4-12327.zip - with a
> > simple string manipulation. But there is no easy, simple, reliable way
> > for me to say "oh, and the sources that corresponds to that is of
> > course called "SqueakV44.sources.gz" because my release process had a
> > bug in it. I really don't care whether the sources file for 4.4 is
> > condensed. I care that it _has_ a sources file, and I care that its
> > _name_ is trivially derivable/calculable from the version _name_.
> > 
> > This isn't a hypothetical question about a maybe thing. I have the
> > buildpack right now. I just can't finish it because I can't write a
> > script to find the sources file. (Scraping http://ftp.squeak.org/4.4/
> > for URLs is so made of fail that I'm not going to contemplate it.)
> > 
> > frank
> > 
> >> - Bert -
> >> 
> >>> If I can't derive it,
> >>> how can a script? It was an error (on my part) to not produce a
> >>> SqueakV44.sources. I'll be fixing that in the 4.4 update stream in due
> >>> course, but I need to leave the SqueakV41.sources there for the moment
> >>> because the current 4.4 looks for such a file. James Robertson
> >>> correctly pointed out that one usually has a .sources file, so we
> >>> should have such a thing.
> >>> 
> >>>> IMHO, it should be left alone, unless the plan described by Bert is
> >>>> implemented. A "temporary" solution, often becomes permanent.
> >>> 
> >>> The "temporary" part is keeping the SqueakV41.sources there until we
> >>> can be sure that 4.4 images won't look for that file, but for
> >>> SqueakV44.sources instead.
> >>> 
> >>> frank
> >> 
> >> 
> >> 
> >> 
> >> 
> > 
> 
-------------- next part --------------
#!/usr/bin/sh

# Specify VM (headless mode), image, and start script
SQUEAK="/usr/local/bin/squeak -vm-display-null"
IMAGE=myImageFile
SCRIPT=sourceName.st

# Write a script file to run with headless Squeak
cat > $SCRIPT << EOF
FileStream stdout nextPutAll: Smalltalk sourceFileVersionString; lf.
Smalltalk snapshot: false andQuit: true.
EOF

# Run Squeak in headless mode and give it the script file to execute.
# Use /usr/bin/tail to get rid of that annoying "Checking ..." message
# that we forgot to remove from /usr/local/bin/squeak.
sourceVersion=`$SQUEAK $IMAGE $SCRIPT | tail -1`

# And here is the result
echo the source file name is $sourceVersion.sources


More information about the Squeak-dev mailing list