Skip to content

pgloader-bundle-3.6.8 fails to build under SBCL 2.6.5-85913ede1 (gentoo) #1703

Description

@arabek

fix:

--- pgloader-bundle-3.6.8/software/named-readtables-20220220-git/src/cruft.lisp 2022-09-26 23:57:20.000000000 +0200
+++ pgloader-bundle-3.6.8-fix/software/named-readtables-20220220-git/src/cruft.lisp     2026-06-14 21:12:38.176910143 +0200
@@ -212,14 +212,14 @@
(let ((reader-fn (svref char-macro-array char-code))
(char (code-char (shiftf char-code (1+ char-code)))))
(if reader-fn
-                           (yield char)
+                           (yield char #'grovel-base-chars)
(grovel-base-chars)))))
(grovel-unicode-chars ()
(multiple-value-bind (more? char) (ht-iterator)
(if (not more?)
(values nil nil nil nil nil)
-                       (yield char))))
-               (yield (char)
+                       (yield char #'grovel-unicode-chars))))
+               (yield (char continue-fn)
(let ((disp-fn (get-macro-character char readtable))
(disp-ht))
(cond
@@ -229,8 +229,11 @@
(push (cons k v) sub-char-alist))
disp-ht)
(values t char disp-fn t sub-char-alist)))
+                     (disp-fn
+                      (values t char disp-fn nil nil))
(t
-                      (values t char disp-fn nil nil))))))
+                      ;; Not a real macro character, continue iterating
+                      (funcall continue-fn))))))
#'grovel-base-chars))))
#+clozure
(defun %make-readtable-iterator (readtable)

Activity

  1. added a commit that references this issue on Jun 28, 2026
    09c392b
  2. dimitri commented on Jun 28, 2026

    @dimitri
    Owner

    Thanks for the detailed report. The diagnosis is correct.

    Root cause: SBCL 2.6.5 changed the internal char-macro dispatch array to store 0 instead of NIL for absent macro characters. The named-readtables library shipped in the 2022 Quicklisp snapshot (which pgloader's bundle was pinned to) iterates over that array with:

    (if reader-fn (yield char) (grovel-base-chars))

    0 is truthy in Common Lisp, so it yields entries with no real macro function attached. check-reader-macro-conflict then finds a 0 where it expects a function and signals an assertion failure.

    Upstream fix: melisgl/named-readtables added the guard (and reader-fn (not (eql reader-fn 0))) in November 2025, and Quicklisp picked it up in the 2026-01-01 dist as named-readtables-20260101-git.

    What's been fixed: PR #1752 bumps BUNDLEDIST from 2022-02-20 to 2026-01-01. The bundle now vendors named-readtables-20260101-git which contains the upstream fix. make test-bundle runs the full regression suite against the bundle binary.

    Note: named-readtables is not manually vendored in the pgloader source tree — build/quicklisp/ is generated at build time and not committed. If you build from source by running make pgloader from scratch (which downloads fresh Quicklisp), you get whatever dist Quicklisp installs. Until Quicklisp pushes a dist newer than 2026-01-01, workarounds are: build from source and manually install a newer named-readtables into your local Quicklisp, or use v4.

    v4 (JVM) is entirely unaffected — it ships as a self-contained JAR with no SBCL dependency. If you can move to v4:

    curl -L https://github.com/dimitri/pgloader/releases/download/v4-dev/pgloader.jar -o pgloader.jar
    java -jar pgloader.jar --help
  3. added a commit that references this issue on Jun 28, 2026
    965d6cf
  4. arabek commented on Jun 30, 2026

    @arabek
    Author

    Thanks for the confirmation that my temporary fix was correct (as in didn't break anything). I'd rather keep away from having jvm installed and will stick to the fixed lisp version for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions