[MacPorts] #74333: lang/clisp: fix build failure caused by a clisp compiler bug (SEARCH/:TEST-NOT)
MacPorts
noreply at macports.org
Mon Aug 17 11:25:36 UTC 2026
#74333: lang/clisp: fix build failure caused by a clisp compiler bug (SEARCH/:TEST-
NOT)
----------------------------+--------------------
Reporter: informatimago | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: lang/clisp |
----------------------------+--------------------
Description changed by informatimago:
Old description:
> ### Description
>
> `clisp @2.50.0-20241112` (the current gitlab-snapshot revision this port
> tracks) currently **fails to build from scratch** on every platform, not
> just
> macOS: compiling the bundled ASDF module aborts with
>
> ```
> ;; Compiling file .../modules/asdf/asdf.lisp ...
> *** -
> (AND (= SYSTEM::OPT-NUM 0) (SYSTEM::MEMQ ':TEST SYSTEM::KEYWORDS)
> (SYSTEM::MEMQ ':TEST-NOT SYSTEM::KEYWORDS)) must evaluate to a non-
> NIL
> value.
> 0 errors, 0 warnings
> make[1]: *** [asdf.fas] Error 1
> make: *** [asdf] Error 2
> ```
>
> **Root cause** (upstream clisp bug, not a packaging issue):
> `src/compiler.lisp`
> keeps a dispatch table of standard functions that get an inline
> optimization
> (`c-TEST/TEST-NOT`, rewriting `:TEST (COMPLEMENT f)` → `:TEST-NOT f`).
> `SEARCH`
> is listed in that table, but per ANSI CL `SEARCH`'s lambda list is
> `(sequence1 sequence2 &key from-end test key start1 end1 start2 end2)` —
> it has
> no `:TEST-NOT`, unlike every other entry in the table (`FIND`, `MEMBER`,
> `ASSOC`, `POSITION`, etc., which genuinely have both). `c-TEST/TEST-NOT`
> unconditionally asserts the function has both keywords, so compiling
> *any*
> call to `(search ...)` aborts. `modules/asdf/asdf.lisp` calls `(search
> sub
> string :start2 start :end2 end)`, which is apparently the first `SEARCH`
> call
> clisp's own build compiles (other in-tree callers aren't part of the
> base-image compile list), so the failure only surfaces here.
>
> I've reported this upstream: <link to be added once filed at
> https://gitlab.com/gnu-clisp/clisp/-/issues>. This PR adds a small local
> patch
> so the port builds again in the meantime; it should be dropped once clisp
> fixes it upstream and this port's pinned commit is advanced past the fix.
>
> ### Fix
>
> Removes the single bogus `(SEARCH . c-TEST/TEST-NOT)` entry from the
> table —
> `SEARCH` doesn't belong there since the `:TEST`/`:TEST-NOT` rewrite is
> inapplicable to a function that has no `:TEST-NOT`. Added as
> `files/patch-clisp-search-test-not.diff`, wired into `patchfiles`, with
> `revision` bumped `0 → 1` since the upstream `version`/tarball is
> unchanged.
>
> ### Type of change
>
> - [x] Bugfix (non-breaking change which fixes an issue)
>
> ### Tested on
>
> - macOS 26.5 (25F71), arm64 (Apple Silicon), Xcode/clang 20.1.8, MacPorts
> 2.12.5
> - `sudo port -v install clisp` completes successfully with this patch
> applied;
> without it, the build fails deterministically as shown above on every
> run.
>
> ### Checklist
>
> - [x] I have read the [Porting Guide section on submitting
> changes](https://guide.macports.org/#project.contributing.patches)
> - [x] My commit message describes the changes and their motivation
> clearly (`lang/clisp: fix build failure caused by clisp compiler bug
> (SEARCH/:TEST-NOT)`)
> - [x] `port lint --nitpick lang/clisp` passes
> - [x] I have verified this port builds successfully
> - [ ] Also runs/passes `make check` (this port's `test.target check`) —
> *(confirm before submitting)*
> - [x] Root-caused against clisp's own source (`src/compiler.lisp`), not
> just worked around blindly
> - [ ] Upstream clisp issue filed and linked above — *(fill in before
> submitting)*
New description:
### Description
`clisp @2.50.0-20241112` (the current gitlab-snapshot revision this port
tracks) currently **fails to build from scratch** on every platform, not
just
macOS: compiling the bundled ASDF module aborts with
```
;; Compiling file .../modules/asdf/asdf.lisp ...
*** -
(AND (= SYSTEM::OPT-NUM 0) (SYSTEM::MEMQ ':TEST SYSTEM::KEYWORDS)
(SYSTEM::MEMQ ':TEST-NOT SYSTEM::KEYWORDS)) must evaluate to a non-
NIL
value.
0 errors, 0 warnings
make[1]: *** [asdf.fas] Error 1
make: *** [asdf] Error 2
```
**Root cause** (upstream clisp bug, not a packaging issue):
`src/compiler.lisp`
keeps a dispatch table of standard functions that get an inline
optimization
(`c-TEST/TEST-NOT`, rewriting `:TEST (COMPLEMENT f)` → `:TEST-NOT f`).
`SEARCH`
is listed in that table, but per ANSI CL `SEARCH`'s lambda list is
`(sequence1 sequence2 &key from-end test key start1 end1 start2 end2)` —
it has
no `:TEST-NOT`, unlike every other entry in the table (`FIND`, `MEMBER`,
`ASSOC`, `POSITION`, etc., which genuinely have both). `c-TEST/TEST-NOT`
unconditionally asserts the function has both keywords, so compiling *any*
call to `(search ...)` aborts. `modules/asdf/asdf.lisp` calls `(search sub
string :start2 start :end2 end)`, which is apparently the first `SEARCH`
call
clisp's own build compiles (other in-tree callers aren't part of the
base-image compile list), so the failure only surfaces here.
I've reported this upstream: <https://gitlab.com/gnu-
clisp/clisp/-/work_items/63>. This PR adds a small local patch
so the port builds again in the meantime; it should be dropped once clisp
fixes it upstream and this port's pinned commit is advanced past the fix.
### Fix
Removes the single bogus `(SEARCH . c-TEST/TEST-NOT)` entry from the table
—
`SEARCH` doesn't belong there since the `:TEST`/`:TEST-NOT` rewrite is
inapplicable to a function that has no `:TEST-NOT`. Added as
`files/patch-clisp-search-test-not.diff`, wired into `patchfiles`, with
`revision` bumped `0 → 1` since the upstream `version`/tarball is
unchanged.
### Type of change
- [x] Bugfix (non-breaking change which fixes an issue)
### Tested on
- macOS 26.5 (25F71), arm64 (Apple Silicon), Xcode/clang 20.1.8, MacPorts
2.12.5
- `sudo port -v install clisp` completes successfully with this patch
applied;
without it, the build fails deterministically as shown above on every
run.
### Checklist
- [x] I have read the [Porting Guide section on submitting
changes](https://guide.macports.org/#project.contributing.patches)
- [x] My commit message describes the changes and their motivation clearly
(`lang/clisp: fix build failure caused by clisp compiler bug (SEARCH
/:TEST-NOT)`)
- [x] `port lint --nitpick lang/clisp` passes
- [x] I have verified this port builds successfully
- [ ] Also runs/passes `make check` (this port's `test.target check`) —
*(confirm before submitting)*
- [x] Root-caused against clisp's own source (`src/compiler.lisp`), not
just worked around blindly
- [ ] Upstream clisp issue filed and linked above — *(fill in before
submitting)*
--
--
Ticket URL: <https://trac.macports.org/ticket/74333#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list