The attached seems to help. With that, the stdout no longer shows errors, and I see a sensible-looking web UI at http://localhost:8080 and http://localhost:8080/admin.

On 06/04/17 22:52, Neil Jerram wrote:
Hey Andy,

I'm just trying to get started with tekuti, but am hitting problems which look like they're associated with having no content yet. I've appended a transcript below - can you see what's wrong?

Thanks - Neil


neil@neil-laptop:~/SW/tekuti$ ./env src/tekuti
;;; note: source file /home/neil/SW/tekuti/tekuti/git.scm
;;;       newer than compiled /home/neil/SW/tekuti/tekuti/git.go
;;; found fresh local cache at /home/neil/.cache/guile/ccache/2.2-LE-8-3.9/home/neil/SW/tekuti/tekuti/git.scm.go
;;; note: source file /home/neil/SW/tekuti/tekuti/util.scm
;;;       newer than compiled /home/neil/SW/tekuti/tekuti/util.go
;;; found fresh local cache at /home/neil/.cache/guile/ccache/2.2-LE-8-3.9/home/neil/SW/tekuti/tekuti/util.scm.go
;;; note: source file /home/neil/SW/tekuti/tekuti/web.scm
;;;       newer than compiled /home/neil/SW/tekuti/tekuti/web.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/neil/SW/tekuti/tekuti/web.scm
;;; note: source file /home/neil/SW/tekuti/tekuti/post.scm
;;;       newer than compiled /home/neil/SW/tekuti/tekuti/post.go
;;; found fresh local cache at /home/neil/.cache/guile/ccache/2.2-LE-8-3.9/home/neil/SW/tekuti/tekuti/post.scm.go ;;; compiled /home/neil/.cache/guile/ccache/2.2-LE-8-3.9/home/neil/SW/tekuti/tekuti/web.scm.go

;;; (reading-index)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "rev-parse" "refs/heads/index"))
fatal: ambiguous argument 'refs/heads/index': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

;;; (start-clock)

;;; (start-clock)

;;; (posts)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (stop-clock 0.005752)

;;; (start-clock)

;;; (posts-by-date)

;;; (stop-clock 4.4999999999999996e-5)

;;; (start-clock)

;;; (tags)

;;; (latest-posts ((posts-by-date) (posts . #<hash-table 563b0667eba0 0/31>) (master . "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd")))

;;; (filter-mapn ())

;;; (stop-clock 1.75e-4)

;;; (start-clock)

;;; (legit-comments)

;;; (computing-legit)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (done #<hash-table 563b0667ea40 0/31>)

;;; (stop-clock 0.0056549999999999994)

;;; (start-clock)

;;; (bogus-comments)

;;; (computing-bogus)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "cat-file" "commit" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd"))

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "rev-parse" #f))
In tekuti/index.scm:
   113:28 10 (_)
In tekuti/util.scm:
187:5 9 (with-time-debugging* #<procedure 563b06776740 at tekuti/index.s…>)
In srfi/srfi-1.scm:
466:18 8 (fold #<procedure 563b06776700 at tekuti/index.scm:55:9 (spec i…> …)
In tekuti/index.scm:
58:25 7 (_ _ ((legit-comments . #<hash-table 563b0667ea40 0/31>) (. #) …))
In tekuti/util.scm:
187:5 6 (with-time-debugging* #<procedure 563b06777de0 at tekuti/index.s…>)
In tekuti/comment.scm:
    206:2  5 (compute-bogus-comments _ _)
In tekuti/git.scm:
339:16 4 (fold-commits #<procedure 563b06777db0 at tekuti/comment.scm:20…> …)
   174:24  3 (git-rev-parse #f)
    92:15  2 (run _ _ _)
In ice-9/popen.scm:
    64:22  1 (open-pipe* "r" _ . _)
In unknown file:
           0 (open-process "r" "git" "--bare" "rev-parse" #f)
ERROR: Wrong type (expecting string): #f

;;; (stop-clock 0.05782799999999999)

;;; (stop-clock 0.06981599999999999)

;;; (handler ())

;;; (start-clock)

;;; (start-clock)

;;; (posts)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (stop-clock 0.026757)

;;; (start-clock)

;;; (posts-by-date)

;;; (stop-clock 3.6e-5)

;;; (start-clock)

;;; (tags)

;;; (latest-posts ((posts-by-date) (posts . #<hash-table 563b064787a0 0/31>) (master . "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd")))

;;; (filter-mapn ())

;;; (stop-clock 3.59e-4)

;;; (start-clock)

;;; (legit-comments)

;;; (computing-legit)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (done #<hash-table 563b06478640 0/31>)

;;; (stop-clock 0.006625)

;;; (start-clock)

;;; (bogus-comments)

;;; (computing-bogus)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "cat-file" "commit" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd"))

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "rev-parse" #f))
In tekuti/index.scm:
   113:28 10 (_)
In tekuti/util.scm:
187:5 9 (with-time-debugging* #<procedure 563b0642fc20 at tekuti/index.s…>)
In srfi/srfi-1.scm:
466:18 8 (fold #<procedure 563b0642fbe0 at tekuti/index.scm:55:9 (spec i…> …)
In tekuti/index.scm:
58:25 7 (_ _ ((legit-comments . #<hash-table 563b06478640 0/31>) (. #) …))
In tekuti/util.scm:
187:5 6 (with-time-debugging* #<procedure 563b0667fcc0 at tekuti/index.s…>)
In tekuti/comment.scm:
    206:2  5 (compute-bogus-comments _ _)
In tekuti/git.scm:
339:16 4 (fold-commits #<procedure 563b0667fc90 at tekuti/comment.scm:20…> …)
   174:24  3 (git-rev-parse #f)
    92:15  2 (run _ _ _)
In ice-9/popen.scm:
    64:22  1 (open-pipe* "r" _ . _)
In unknown file:
           0 (open-process "r" "git" "--bare" "rev-parse" #f)
ERROR: Wrong type (expecting string): #f

;;; (stop-clock 0.044223)

;;; (stop-clock 0.078508)

;;; (latest-posts ())

;;; (filter-mapn #f)
In tekuti/web.scm:
82:26 2 (handler #<<request> method: GET uri: #<<uri> scheme: http user…> …)
In tekuti/page.scm:
   192:20  1 (page-index _ _ ())
In tekuti/util.scm:
166:25 0 (filter-mapn #<procedure 563b0648dfc0 at tekuti/post.scm:233:3 …> …) ERROR: In procedure car: Wrong type argument in position 1 (expecting pair): #f

;;; (handler ())

;;; (start-clock)

;;; (start-clock)

;;; (posts)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (stop-clock 0.007265)

;;; (start-clock)

;;; (posts-by-date)

;;; (stop-clock 3.9e-5)

;;; (start-clock)

;;; (tags)

;;; (latest-posts ((posts-by-date) (posts . #<hash-table 563b05f398a0 0/31>) (master . "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd")))

;;; (filter-mapn ())

;;; (stop-clock 3.84e-4)

;;; (start-clock)

;;; (legit-comments)

;;; (computing-legit)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (done #<hash-table 563b05f395e0 0/31>)

;;; (stop-clock 0.0073279999999999994)

;;; (start-clock)

;;; (bogus-comments)

;;; (computing-bogus)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "cat-file" "commit" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd"))

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "rev-parse" #f))
In tekuti/index.scm:
   113:28 10 (_)
In tekuti/util.scm:
187:5 9 (with-time-debugging* #<procedure 563b05f38cc0 at tekuti/index.s…>)
In srfi/srfi-1.scm:
466:18 8 (fold #<procedure 563b05f38c80 at tekuti/index.scm:55:9 (spec i…> …)
In tekuti/index.scm:
58:25 7 (_ _ ((legit-comments . #<hash-table 563b05f395e0 0/31>) (. #) …))
In tekuti/util.scm:
187:5 6 (with-time-debugging* #<procedure 563b066aeab0 at tekuti/index.s…>)
In tekuti/comment.scm:
    206:2  5 (compute-bogus-comments _ _)
In tekuti/git.scm:
339:16 4 (fold-commits #<procedure 563b066aea80 at tekuti/comment.scm:20…> …)
   174:24  3 (git-rev-parse #f)
    92:15  2 (run _ _ _)
In ice-9/popen.scm:
    64:22  1 (open-pipe* "r" _ . _)
In unknown file:
           0 (open-process "r" "git" "--bare" "rev-parse" #f)
ERROR: Wrong type (expecting string): #f

;;; (stop-clock 0.038446999999999995)

;;; (stop-clock 0.054012)

;;; (start-clock)

;;; (start-clock)

;;; (posts)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (stop-clock 0.006633999999999999)

;;; (start-clock)

;;; (posts-by-date)

;;; (stop-clock 3.7e-5)

;;; (start-clock)

;;; (tags)

;;; (latest-posts ((posts-by-date) (posts . #<hash-table 563b06642600 0/31>) (master . "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd")))

;;; (filter-mapn ())

;;; (stop-clock 3.55e-4)

;;; (start-clock)

;;; (legit-comments)

;;; (computing-legit)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (done #<hash-table 563b066424a0 0/31>)

;;; (stop-clock 0.006411)

;;; (start-clock)

;;; (bogus-comments)

;;; (computing-bogus)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "cat-file" "commit" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd"))

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "rev-parse" #f))
In tekuti/index.scm:
   113:28 10 (_)
In tekuti/util.scm:
187:5 9 (with-time-debugging* #<procedure 563b0691e8c0 at tekuti/index.s…>)
In srfi/srfi-1.scm:
466:18 8 (fold #<procedure 563b0691e880 at tekuti/index.scm:55:9 (spec i…> …)
In tekuti/index.scm:
58:25 7 (_ _ ((legit-comments . #<hash-table 563b066424a0 0/31>) (. #) …))
In tekuti/util.scm:
187:5 6 (with-time-debugging* #<procedure 563b06923ea0 at tekuti/index.s…>)
In tekuti/comment.scm:
    206:2  5 (compute-bogus-comments _ _)
In tekuti/git.scm:
339:16 4 (fold-commits #<procedure 563b06923e70 at tekuti/comment.scm:20…> …)
   174:24  3 (git-rev-parse #f)
    92:15  2 (run _ _ _)
In ice-9/popen.scm:
    64:22  1 (open-pipe* "r" _ . _)
In unknown file:
           0 (open-process "r" "git" "--bare" "rev-parse" #f)
ERROR: Wrong type (expecting string): #f

;;; (stop-clock 0.052416)

;;; (stop-clock 0.066341)

;;; (handler ((cache)))

;;; (start-clock)

;;; (start-clock)

;;; (posts)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (stop-clock 0.01015)

;;; (start-clock)

;;; (posts-by-date)

;;; (stop-clock 3.6e-5)

;;; (start-clock)

;;; (tags)

;;; (latest-posts ((posts-by-date) (posts . #<hash-table 563b064767e0 0/31>) (master . "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd")))

;;; (filter-mapn ())

;;; (stop-clock 3.57e-4)

;;; (start-clock)

;;; (legit-comments)

;;; (computing-legit)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "ls-tree" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd" "."))

;;; (done #<hash-table 563b06476680 0/31>)

;;; (stop-clock 0.00756)

;;; (start-clock)

;;; (bogus-comments)

;;; (computing-bogus)

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "cat-file" "commit" "7e5d0ddb26c73c0602e8fdf24c1fd90eb9e35efd"))

;;; (pwd "/home/neil/blog.git")

;;; (run (() #f "git" "--bare" "rev-parse" #f))
In tekuti/index.scm:
   113:28 10 (_)
In tekuti/util.scm:
187:5 9 (with-time-debugging* #<procedure 563b06478d40 at tekuti/index.s…>)
In srfi/srfi-1.scm:
466:18 8 (fold #<procedure 563b06478d00 at tekuti/index.scm:55:9 (spec i…> …)
In tekuti/index.scm:
58:25 7 (_ _ ((legit-comments . #<hash-table 563b06476680 0/31>) (. #) …))
In tekuti/util.scm:
187:5 6 (with-time-debugging* #<procedure 563b06167a20 at tekuti/index.s…>)
In tekuti/comment.scm:
    206:2  5 (compute-bogus-comments _ _)
In tekuti/git.scm:
339:16 4 (fold-commits #<procedure 563b061679f0 at tekuti/comment.scm:20…> …)
   174:24  3 (git-rev-parse #f)
    92:15  2 (run _ _ _)
In ice-9/popen.scm:
    64:22  1 (open-pipe* "r" _ . _)
In unknown file:
           0 (open-process "r" "git" "--bare" "rev-parse" #f)
ERROR: Wrong type (expecting string): #f

;;; (stop-clock 0.038342999999999995)

;;; (stop-clock 0.056891)

;;; (latest-posts ((cache)))

;;; (filter-mapn #f)
In tekuti/web.scm:
82:26 2 (handler #<<request> method: GET uri: #<<uri> scheme: http user…> …)
In tekuti/page.scm:
    81:12  1 (_)
In tekuti/util.scm:
166:25 0 (filter-mapn #<procedure 563b062f9840 at tekuti/post.scm:233:3 …> …) ERROR: In procedure car: Wrong type argument in position 1 (expecting pair): #f



>From 2ca6e21d80e2d9986093babcd0999af00dea0504 Mon Sep 17 00:00:00 2001
From: Neil Jerram <n...@tigera.io>
Date: Thu, 6 Apr 2017 23:15:03 +0100
Subject: [PATCH] Fix first bootstrap of compute-bogus-comments

---
 tekuti/comment.scm | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/tekuti/comment.scm b/tekuti/comment.scm
index db3e3e8..52e5370 100644
--- a/tekuti/comment.scm
+++ b/tekuti/comment.scm
@@ -203,24 +203,27 @@
   (define visited-trees (make-hash-table))
   (define bogus (make-hash-table))
   (pk 'computing-bogus)
-  (fold-commits
-   (lambda (rev commit _)
-     (pk 'computing-bogus rev)
-     (for-each
-      (match-lambda
-        ((post-name post-sha1 'tree)
-         (unless (hash-ref visited-trees post-sha1)
-           (hash-set! visited-trees post-sha1 #t)
+  (pk 'master-ref master-ref)
+  (let ((parent (assq-ref (parse-commit master-ref) 'parent)))
+    (if parent
+        (fold-commits
+         (lambda (rev commit _)
+           (pk 'computing-bogus rev)
            (for-each
             (match-lambda
-              ((comment-name comment-sha1 'blob)
-               (unless (or (hash-ref legit comment-sha1)
-                           (hash-ref bogus comment-sha1))
-                 (hash-set! bogus comment-sha1 comment-name)))
-              (_ #f))
-            (git-ls-tree (string-append post-sha1 ":comments") #f))))
-        (_ #f))
-      (git-ls-tree (assq-ref commit 'tree) #f)))
-   (assq-ref (parse-commit master-ref) 'parent)
-   #f)
+             ((post-name post-sha1 'tree)
+              (unless (hash-ref visited-trees post-sha1)
+                      (hash-set! visited-trees post-sha1 #t)
+                      (for-each
+                       (match-lambda
+                        ((comment-name comment-sha1 'blob)
+                         (unless (or (hash-ref legit comment-sha1)
+                                     (hash-ref bogus comment-sha1))
+                                 (hash-set! bogus comment-sha1 comment-name)))
+                        (_ #f))
+                       (git-ls-tree (string-append post-sha1 ":comments") #f))))
+             (_ #f))
+            (git-ls-tree (assq-ref commit 'tree) #f)))
+         parent
+         #f)))
   bogus)
-- 
2.11.0

Reply via email to