4 ms·
We have a makefile and: sudo make it creates an executable. Its slightly tricky in that the whole make process can only happen on a single thread, so you hav
by gibsonf1 5y ago
We have a makefile and: sudo make it creates an executable.
Its slightly tricky in that the whole make process can only happen on a single thread, so you have to turn off all parallel threads during make - so we have a key on many functions :make that turns off parallel for using make. Ultimatel the make file uses (asdf:make :package-name) to compile to an exe. The other tricky part is to get a web server in the exe to work, and thats handled like this:
(handler-case (bt:join-thread (find-if (lambda (th)
#+os-unix (search "clack-handler-woo" (bt:thread-name th))
#+os-windows (search "hunchentoot" (bt:thread-name th))
)
(bt:all-threads)))
;; Catch a user's C-c
(#+sbcl sb-sys:interactive-interrupt
#+ccl ccl:interrupt-signal-condition
#+clisp system::simple-interrupt-condition
#+ecl ext:interactive-interrupt
#+allegro excl:interrupt-signal
() (progn
(format *error-output* "Aborting.~&")
(stop)
(uiop:quit)))
(error (c) (progn (format t "Woops, an unknown error occured:~&~a~& - restarting service..." c)
#+os-unix (trivial-shell:shell-command "service trinity restart"))
))