The problem is that REQUIRE in the new executable doesn't know where
to look for modules.
It looks for the Unix environment variable SBCL_HOME to tell where to look.
The Unix environment is not part of the Lisp core and will not be
saved by S-L-A-D
The sbcl start-up code will set this variable if it isn't already, to
the directory where it finds the core file. However, when you make a
stand-alone executable, this will not be done.
Making a traditional non-executable core is not a solution, unless you
put in sbcl's standard directory.
You can, however, set the environment variable yourself, either from
the Unix shell:
$ SBCL_HOME=/usr/lib/sbcl/ ./tst
...
Or from your application start-up code
...
(sb-posix:putenv "SBCL_HOME=/usr/lib/sbcl/")
...
Either way, REQUIRE will now know where to look.
Stig Hemmer
On 3/25/10, Michael Lucy <MichaelGLucy@...> wrote:
> System (output of uname -a): Linux efreata 2.6.28-15-generic
> #52-Ubuntu SMP Wed Sep 9 10:49:34 UTC 2009 i686 GNU/Linux
> Sbcl version: 1.0.36
>
> Problem:
> (require 'asdf-install) works fine, but if I dump an executable core
> image, launch it, and try from there it breaks.
>
> Example of (require 'asdf-install) working fine normally:
>
> zededarian@...$ sbcl
> This is SBCL 1.0.36, an implementation of ANSI Common Lisp.
> More information about SBCL is available at <http://www.sbcl.org/>.
>
> SBCL is free software, provided as is, with absolutely no warranty.
> It is mostly in the public domain; some portions are provided under
> BSD-style licenses. See the CREDITS and COPYING files in the
> distribution for more information.
> * (require 'asdf-install)
>
> ; loading system definition from
> ; /usr/local/lib/sbcl/sb-bsd-sockets/sb-bsd-sockets.asd into #<PACKAGE
> "ASDF0">
> ; registering #<SYSTEM SB-BSD-SOCKETS {B62CD81}> as SB-BSD-SOCKETS
> ; registering #<SYSTEM SB-BSD-SOCKETS-TESTS {ACF9A99}> as
> SB-BSD-SOCKETS-TESTS
> ; loading system definition from /usr/local/lib/sbcl/sb-posix/sb-posix.asd
> into
> ; #<PACKAGE "ASDF0">
> ; registering #<SYSTEM SB-POSIX {AEA2F19}> as SB-POSIX
> ; registering #<SYSTEM SB-POSIX-TESTS {AFD6F39}> as SB-POSIX-TESTS
> ("ASDF-INSTALL" "SB-POSIX" "SB-BSD-SOCKETS" "SB-GROVEL" "ASDF")
> *
>
> Example of (require 'asdf-install) not working after dumping an executable
> core:
>
> zededarian@...$ sbcl
> This is SBCL 1.0.36, an implementation of ANSI Common Lisp.
> More information about SBCL is available at <http://www.sbcl.org/>.
>
> SBCL is free software, provided as is, with absolutely no warranty.
> It is mostly in the public domain; some portions are provided under
> BSD-style licenses. See the CREDITS and COPYING files in the
> distribution for more information.
> * (sb-ext:save-lisp-and-die "tst" :executable t)
> [undoing binding stack and other enclosing state... done]
> [saving current Lisp image into tst:
> writing 3504 bytes from the read-only space at 0x01000000
> writing 2256 bytes from the static space at 0x01100000
> writing 27275264 bytes from the dynamic space at 0x09000000
> done]
> zededarian@...$ ./tst
> * (require 'asdf-install)
>
> debugger invoked on a SB-INT:EXTENSION-FAILURE in thread #<THREAD
> "initial
> thread" RUNNING
> {AA037B1}>:
> Don't know how to REQUIRE ASDF-INSTALL.
> See also:
> The SBCL Manual, Variable *MODULE-PROVIDER-FUNCTIONS*
> The SBCL Manual, Function REQUIRE
>
> Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
>
> restarts (invokable by number or by possibly-abbreviated name):
> 0: [ABORT] Exit debugger, returning to top level.
>
> (SB-IMPL::REQUIRE-ERROR "Don't know how to ~S ~A.")[:EXTERNAL]
> 0]
> *
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Sbcl-bugs mailing list
> Sbcl-bugs@...
> https://lists.sourceforge.net/lists/listinfo/sbcl-bugs
>
|