Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Comments

cmucl load failure fix#198

Open
vibs29 wants to merge 1 commit intocl-plus-ssl:masterfrom
vibs29:cmucl
Open

cmucl load failure fix#198
vibs29 wants to merge 1 commit intocl-plus-ssl:masterfrom
vibs29:cmucl

Conversation

@vibs29
Copy link
Contributor

@vibs29 vibs29 commented Dec 1, 2025

ffi.lisp's defcfun-late-bound macro is designed to raise an error for vararg cfuns. But the same file defines exactly such a vararg cfun (err-set-error).

The macro is only used on cmucl.

cl+ssl is therefore unloadable on any cmucl (regardless of cffi version and openssl version). This is a broad and true statement that follows from paragraph one alone.

This cl+ssl patch affects only cmucl. As per the previous paragraph, it cannot worsen things for any cmucl user, regardless of their cffi version and openssl version. Now I'll describe the effect of this patch on users more precisely.

I'll call cl+ssl versions without this patch "cl+ssl-unpatched" and with this patch "cl+ssl-patched".
I'll call cffi versions without the following "cffi-unpatched" and with the following "cffi-patched"
cffi/cffi#423
I'll call openssl prior to 1.1 "old-openssl" and including and after 1.1 "new-openssl".

We already know that cl+ssl-unpatched doesn't work at all.

With cl+ssl-patched,
new-openssl will work with both cffi-unpatched and cffi-patched.
old-openssl will not work with cffi-unpatched and will with cffi-patched.

Thus it is worth applying this patch to cl+ssl regardless of cffi's accepting the cffi patch, as this cl+ssl patch worsens things for nobody and improves things for many. There is only one (tiny?) group above who will not see an improvement. That group can patch their copies of cffi manually.

To reiterate, non cmucl users are entirely unaffected by this patch as a #+cmucl read macro in cl+ssl-unpatched has them bypass this part of the code.


ref: this patch's commit log

The macro is only called in cmucl. It is written to raise an error if
called for vararg functions. But ERR_set_error in the same file is a
vararg function that results in the macro's being called. Thus the file
cannot be compiled/loaded in cmucl.

In the future if other Lisps also require the macro to be called, the file
will not be loadable on those Lisps either, for the same reason as above.

Further, this macro was created to solve a problem with cmucl's compiler
being too optimising and complaining if a foreign function didn't exist
in the foreign library.
https://gitlab.common-lisp.net/cmucl/cmucl/-/issues/74
The fix described there was only partly implemented by cffi at the time,
so this macro was necessary. But now cffi has implemented it completely
(in revision a068a492892b12d54b430d93d707d663da850210) so this macro
isn't necessary.
@avodonosov avodonosov force-pushed the master branch 2 times, most recently from 7f45344 to d3e3cc9 Compare December 14, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant