Installing Weblocks on Ubuntu and hunchentoot-mp

12 views
Skip to first unread message

Divia

unread,
Feb 24, 2009, 9:11:46 AM2/24/09
to weblocks
So far, I've been doing my Weblocks development on OS X, and my setup
has been working great. However, today I tried to install Weblocks on
Ubuntu, and I'm running into some problems. First, I installed
weblocks and prevalence, updated clsql for clsql-fluid, and installed
bordeaux threads, just as I had done on my Mac. Then I got the error
component :USOCKET not found, and installed usocket too. After having
done that, a lot more packages compiled successfully, but I still got
this error:

; SB-INT:SIMPLE-READER-PACKAGE-ERROR at 437 (line 14, column 28)
on #<SB-SYS:FD-STREAM for "file /home/smee/clbuild/source/weblocks/src/
debug-mode.lisp" {100437C231}>:
; package "HUNCHENTOOT-MP" not found
; compilation aborted after 0:00:00

WARNING:
COMPILE-FILE warned while performing #<COMPILE-OP NIL {1002CF3021}>
on
#<CL-SOURCE-FILE "debug-mode" {10029E26C1}>.

debugger invoked on a ASDF:COMPILE-FAILED in thread #<THREAD "initial
thread" RUNNING {100266B2E1}>:
erred while invoking #<COMPILE-OP NIL {1002CF3021}> on
#<CL-SOURCE-FILE "debug-mode" {10029E26C1}>

II'm pretty stuck trying to figure this out, so I'd be extremely
grateful for any insights anyone might have as to why this is
happening. I've been searching for stuff about hunchentoot-mp, but I
haven't found anything that made sense to me yet, so I'm worried I'm
on the wrong track. Thanks very much,

Divia

Leslie P. Polzer

unread,
Feb 24, 2009, 11:08:39 AM2/24/09
to webl...@googlegroups.com

> II'm pretty stuck trying to figure this out, so I'd be extremely
> grateful for any insights anyone might have as to why this is
> happening. I've been searching for stuff about hunchentoot-mp, but I
> haven't found anything that made sense to me yet, so I'm worried I'm
> on the wrong track. Thanks very much,

A few days ago Hunchentoot 1.0.0 was released. This release introduced
some incompatibilities. Either use the older Hunchentoot (0.15.x series)
or try the latest weblocks-dev, where I've done an experimental
migration to 1.0.0.

Saikat Chakrabarti

unread,
Feb 24, 2009, 2:23:26 PM2/24/09
to webl...@googlegroups.com
you tried installing weblocks on ubuntu?? where?

Ian Eslick

unread,
Feb 24, 2009, 2:42:05 PM2/24/09
to webl...@googlegroups.com
Sounds like you've got a version of weblocks that depends on
hunchentoot 0.15.x but have 1.0 installed.

Ian

Divia

unread,
Feb 24, 2009, 5:24:09 PM2/24/09
to weblocks
Thanks very much. I downgraded my hunchentoot and that completely
solved my problem!

On Feb 24, 8:08 am, "Leslie P. Polzer" <s...@viridian-project.de>
wrote:

Ian Eslick

unread,
Feb 24, 2009, 5:53:25 PM2/24/09
to webl...@googlegroups.com
I noticed that some of the common functionality (http response
backtraces, *catch-errors-p* etc no longer work). We probably need to
do our own call to *debugger-hook* in debug mode rather than relying
on hunchentoot to do that for us.

I added a simple version of this to the dispatcher, and also have some
minor patches for clozure-cl and updates that broke the elephant
backend. Let me know if there is a better way to send this, it seems
a bit of overkill to make a clone just for a small patch... :)

Who is maintaining the cl-json version we're using with weblocks? I
have fixes for that also.

Ian



diff -r cd83809dfadc src/snippets/menu.lisp
--- a/src/store/elephant/elephant.lisp Mon Feb 23 13:38:21 2009 +0100
+++ b/src/store/elephant/elephant.lisp Tue Feb 24 17:51:52 2009 -0500
@@ -85,7 +85,7 @@
(defmethod dynamic-transaction ((store elephant-store) proc)
"This dynamic hook wraps an elephant transaction macro around the
body hooks.
This allows us to gain the benefits of the stable transaction
system in elephant"
- (ensure-transaction (:store-controller store)
+ (ensure-transaction (:store-controller (elephant-controller store))
(funcall proc)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -144,7 +144,7 @@
(catch 'finish-map
(cond (filter-fn
(range-objects-in-memory
- (weblocks-memory::advanced-order-objects-in-memory
+ (advanced-order-objects-in-memory
(filter-objects-in-memory
(get-instances-by-class class-name)
filter-fn)
@@ -167,7 +167,7 @@
:collect t)))
((consp order-by)
(range-objects-in-memory
- (weblocks-memory::advanced-order-objects-in-memory
+ (advanced-order-objects-in-memory
(get-instances-by-class class-name)
order-by)
range))
@@ -187,6 +187,31 @@
(push object results))))
(mapc #'filter-if objects)
(nreverse results)))
+
+(defun advanced-order-objects-in-memory (seq order-by)
+ "Orders objects in 'seq' according to 'order-by'."
+ (cond ((not order-by)
+ seq)
+ ((not (consp (first order-by)))
+ (weblocks-memory::order-objects-in-memory seq order-by))
+ (t
+ (stable-sort seq (multi-value-sort-predicate-asc order-by)))))
+
+(defun multi-value-sort-predicate-asc (order-by)
+ (let ((query-records
+ (mapcar #'(lambda (rec)
+ (destructuring-bind (slot-fn . dir) rec
+ (cons (curry-after #'slot-value-by-path slot-fn)
+ dir)))
+ order-by)))
+ (lambda (a b)
+ (loop for (accessor . dir) in query-records do
+ (let ((a-value (funcall accessor a))
+ (b-value (funcall accessor b)))
+ (if (eq dir :asc)
+ (weblocks-memory::strictly-less-p a-value b-value)
+ (and (not (weblocks-memory::strictly-less-p a-value b-value))
+ (not (weblocks-memory::equivalentp a-value b-value)))))))))

(defmethod count-persistent-objects ((store elephant-store) class-name
&key filter-fn &allow-other-keys)
diff -r cd83809dfadc src/utils/misc.lisp
--- a/src/utils/misc.lisp Mon Feb 23 13:38:21 2009 +0100
+++ b/src/utils/misc.lisp Tue Feb 24 17:51:52 2009 -0500
@@ -238,19 +238,19 @@
"Constructs a relative path to a public file from the \"/pub\"
directory.

'type' - currently either :stylesheet or :script
-'filename' the name of the file
+'filename' the name of the file or 'reldir/filename'

Ex:
\(public-file-relative-path :stylesheet \"navigation\")
=> #P\"stylesheets/navigation.css\""
- (make-pathname :directory `(:relative
- ,(ecase type
- (:stylesheet "stylesheets")
- (:script "scripts")))
- :name filename
- :type (ecase type
- (:stylesheet "css")
- (:script "js"))))
+ (merge-pathnames (make-pathname :defaults filename)
+ (make-pathname :directory `(:relative
+ ,(ecase type
+ (:stylesheet "stylesheets")
+ (:script "scripts")))
+ :type (ecase type
+ (:stylesheet "css")
+ (:script "js")))))

(defun public-files-relative-paths (&rest args)
"A helper function that returns a list of paths for files provided

Leslie P. Polzer

unread,
Feb 25, 2009, 7:47:35 AM2/25/09
to weblocks
On Feb 24, 11:53 pm, Ian Eslick <esl...@media.mit.edu> wrote:
> I noticed that some of the common functionality (http response  
> backtraces, *catch-errors-p* etc no longer work).  We probably need to  
> do our own call to *debugger-hook* in debug mode rather than relying  
> on hunchentoot to do that for us.

Edi Weitz said that he would add back support for this soon.

Not sure how reliable this is though, and considering the usefulness
of this (and tickets [9] and [27]) we should indeed contemplate
adding it ourselves.

[9] http://weblocks.lighthouseapp.com/projects/18897/tickets/9-pretty-backtraces
[27] http://weblocks.lighthouseapp.com/projects/18897/tickets/27-optionally-send-email-on-backtrace


> I added a simple version of this to the dispatcher, and also have some  
> minor patches for clozure-cl and updates that broke the elephant  
> backend.  Let me know if there is a better way to send this, it seems  
> a bit of overkill to make a clone just for a small patch... :)

Put the file up somewhere, or paste it to paste.lisp.org
-- Google groups can mess up patches quite well.


> Who is maintaining thecl-jsonversion we're using with weblocks?  I  
> have fixes for that also.

We're using the latest from the official Git repo. Henrik Hjelte is
responsible for that IIRC.
Reply all
Reply to author
Forward
0 new messages