[Openmcl-devel] Create a CCL image that can quickly load Cocoa using a command-line workflow

Gary Byers gb at clozure.com
Wed Jun 12 15:09:56 PDT 2013

You can run any bundled application from the command line via:

$ /path/to/application.app/Contents/MacOS/executable-name


$ /path/to/ClozureCL\ 64.app/Contents/MacOS/dx86cl64


What happens in that case is very similar to what happens when you double-click
on the application's icon; the primary difference is that the process-wide
standard I/O fds remain attached to the terminal/shell buffer/whatever.  I don't
know if that actually helps you, because I don't really understand what you're
trying to do; do you plan on having the application run an event loop, or do
you plan on having it run your tests ?

That may or may not be a fair question.  Another such question: is what you're
trying to do the sort of thing that could/should be done via AppleScript/Automator ?

Whatever the answers to these questions, you may find it worthwhile to try
to understand what happens when (REQUIRE "COCOA") is called and when a bundled
CCL application starts up.  (Just guessing clearly doesn't work ...)

On Wed, 12 Jun 2013, Clayton Stanley wrote:

> I am running a suite of testing code that uses Cocoa in CCL. To make sure each test is
> isolated from the others, I would like to launch a CCL instance for each test, which
> means I'll need to launch CCL about 15 times to run all tests.
> A (require :cocoa) call on my machine takes about 15 seconds to compile and load all
> Cocoa code. This is fine when running a development instance of CCL through Slime for
> an entire day, but is too slow when having to do this 15 times to run through the test
> suite (especially since the time required for most of the tests to run is less than a
> second; and I'd like to run the test suite more often than once a day).
> I would like a CCL .image file that has :cocoa loaded in it that I can launch from the
> command line when running the tests.?
> I tried commenting out (gui::start-cocoa-ide) in cocoa-ide/cocoa.lisp. Then (require
> :cocoa), then (save-application ...). The idea was to get all Cocoa lisp code compiled
> and loaded into the saved core. Then when launching the modified image, I'd type
> (gui::start-cocoa-ide), and the Cocoa window would quickly boot up. But this didn't
> work. The Cocoa window doesn't appear on my machine, and CCL becomes unresponsive
> after calling (gui::start-cocoa-ide).
> Any other ideas?
> I can't use the CCL App from the App Store or a double-clickable CCL GUI Application
> because I need to be able to launch the ccl image from the command line. This is so
> that I can run the test suite from the command line (so that it can be automated and
> incorporated into the build scripts), and also so that the workflow to run the test
> suite matches a Slime development workflow, where Slime is simply pointed to a lisp
> image (and not a GUI app) when booting up.
> Thanks for the help,
> -Clayton

More information about the Openmcl-devel mailing list