-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
"sqlite3_enable_shared_cache" deprecation warning when compiling with macOS system SQLite3 #68652
Comments
I got this warning when compiling sqlite3 module. gcc -Wno-unused-result -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -DMODULE_NAME="sqlite3" -DSQLITE_OMIT_LOAD_EXTENSION=1 -IModules/_sqlite -I/usr/include -I./Include -I. -IInclude -I/usr/local/include -I/Users/sky/Code/python/cpython/Include -I/Users/sky/Code/python/cpython -c /Users/sky/Code/python/cpython/Modules/_sqlite/module.c -o build/temp.macosx-10.10-x86_64-3.6-pydebug/Users/sky/Code/python/cpython/Modules/_sqlite/module.o The enable_shared_cache method will fail if it is used afterwards. Here is the patch to remove the warning. |
<https://www.sqlite.org/c3ref/enable_shared_cache.html\> appears to indicate that the function is deprecated on OSX 10.7 and iOS 5.0, but looking at the latest sources on sqlite.org that's not the case, the warning in the documentation appears to be for the version of SQLite that Apple ships with their systems. Because of this I'm against merging this patch as is because it also affects anyone building using the upstream version of SQLite instead of the version shipped with OSX. I'm -0 on suppressing the warning other ways, either by detecting that the build uses Apple's build of SQLite or by using pragma's to disable deprecation warnings for this functions. |
I agree with Ronald that the proposed patch should not be applied as is. For example, the Pythons installed by the current python.org OS X installers build and link with a newer version of libsqlite3. This is one of several examples of third-party libraries for which the Apple-supplied version in OS X is old and users are better served by providing a newer version for use with Python. I think a better approach would be to make it easier for people building from source on OS X to also build and include these newer versions, like the installer build does. |
Now that this has come up again, it's worth noting Ronald's comment in msg295954 from duplicate bpo-30646: "See also <https://sqlite.org/c3ref/enable_shared_cache.html\>. Apple basically disabled this function starting at macOS 10.7, that's why there's a warning. It is possible to suppress the warning, but I don't think its worth the trouble. BTW. The python documentation for this function claims this changes a thread-local setting, but the SQLite documentation says this is a process global setting in SQLite 3.5.0 and later (released in 2007). It is possible to make behaviour match the python documentation by making _sqlite3.enable_shared_cache store a flag that's used in the call to sqlite3_open_v2. That would be a backward compatibility concern (there's bound to be users that rely on the current behavior), but would also avoid this warning." |
Also, I notice that, while there is docstring help for sqlite3.enable_shared_cache, it does not seem to be mentioned in the sqlite3 module doc page in the Library reference. |
The SQLite docs clearly states that using sqlite3_enable_shared_cache() is not recommended: "Shared cache is disabled by default. It is recommended that it stay that way. In other words, do not use this routine. This interface continues to be provided for historical compatibility, but its use is discouraged. Any use of shared cache is discouraged." If sqlite3.enable_shared_cache is not even documented, perhaps we could just deprecate and remove it? |
It's now deprecated in 3.10. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: