-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python-build-standalone ships sqlite3 module missing Connection.serialize, deserialize #449
Comments
Hm the docs say
|
And we're on |
Check how CPython sniffs the feature. They may not be doing it robustly. |
This occurs at https://github.com/python/cpython/blob/ea578fc6d310c85538aefbb900a326c5c3424dd5/configure.ac#L4247-L4252
|
I actually can't reproduce this on macOS
|
But I can reproduce on Linux
|
I can fix this with a CPython patch diff --git a/configure.ac b/configure.ac
index 074e2ce3dd3..6d01927836d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4214,6 +4214,8 @@ dnl bpo-45774/GH-29507: The CPP check in AC_CHECK_HEADER can fail on FreeBSD,
dnl hence CPPFLAGS instead of CFLAGS.
CPPFLAGS="$CPPFLAGS $LIBSQLITE3_CFLAGS"
LDFLAGS="$LIBSQLITE3_LIBS $LDFLAGS"
+ LIBS="$LIBS -lm"
+
AC_CHECK_HEADER([sqlite3.h], [
have_sqlite3=yes I haven't figured out how to reproduce this cleanly with just the upstream yet to open a bug report. |
Huh. Libm will almost certainly be in the final library link set. I'm shocked this works. |
Can you clarify what you mean here? I want to spend some more time understanding what's going on before I engage upstream — I was hacking on a few things at once and need to confirm my findings. Very briefly though, I noticed these failures in the autconf logs:
all the
Since we're in a |
Those missing math functions are found in libm. So linking against libm is necessary here. I'm just surprised libm isn't being linked with. Usually libc and libm are both linked in any non-trivial program. I need to verify this, but I suspect the SQLite pkg-config incorrectly omits libm. Or maybe our static SQLite build confuses CPython configure. It's got to be something specific to PBS because I refuse to believe this bug exists in CPython since people would have noticed. |
Yeah that makes sense. My next goal was to reproduce this with our static SQLite build and CPython's configure. |
@indygreg perhaps I'm misunderstanding how this works.. but in bafaac8
|
Actually it looks like
which then falls back to just using
|
You can also see that
but... that requires So either we need to set
or update the upstream to use |
I opened some coherent findings from reproducing this outside PBS at python/cpython#128321 Separately, we fail the initial |
The PBS patches do some questionable things to configure for extension modules to force static linking. Those patches predate CPython allowing you to statically link (all) extension modules. Wouldn't surprise me if we're footgunning ourselves. |
FWIW the linked CPython issue you filed makes sense to me: it seems there is a bug in CPython configure not handling static SQLite correctly. Not surprising since this won't be a common configuration. |
Thanks for taking a look Greg! |
There's no way to detect if SQLite was configured with |
Agreed, I think this just has to be the responsibility of the person building downstream.
I am relatively new to this, but my understanding is that the |
Perhaps the .pc conventions does not align with this specific use case 🤷 |
I was really excited about switching away from
poetry
andpyenv
touv
for building and testing our project.However, our project relies on sqlite3.Connection.serialize and sqlite3.Connection.deserialize. The docs for these methods say:
My system Python (Python 3.12 on Ubuntu 24.04) and pyenv-supplied Python 3.11 (also on Ubuntu 24.04) have these methods. It seems like this is something that should normally be available.
I really hate having to switch back to pyenv because of this issue. Can you compile sqlite3 with the
Connection.serialize
andConnection.deserialize
methods?Steps to reproduce:
I tested with python-build-standalone cpython-3.11.11+20241206-x86_64-unknown-linux-gnu-install_only.tar.gz on Ubuntu 24.04.
Steps to reproduce with python-build-standalone Python 3.11.11:
Comparing with pyenv Python 3.11:
The text was updated successfully, but these errors were encountered: