Skip to content

Instantly share code, notes, and snippets.

/build-core.lisp
Created Dec 13, 2012

Embed
What would you like to do?
A simple workaround for sbcl clsql-based cores deployment. Solving libraries paths problem by unloading/loading libraries.
(let ((library-list (cffi:list-foreign-libraries)))
(setf cffi:*foreign-library-directories* (list #p"lib/"))
(setf clsql-sys:*foreign-library-search-paths* (list #p"lib/"))
#+sbcl
(progn
(pushnew (alexandria:named-lambda load-libraries ()
(mapcar #'(lambda (x)
(cffi:load-foreign-library x))
(mapcar #'(lambda (x)
(pathname (file-namestring (slot-value x 'pathname))))
library-list)))
sb-ext:*init-hooks*)
(mapcar #'cffi:close-foreign-library library-list))
(save-lisp-and-die "image.core" :purify t :executable t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.