This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix SQLite warnings on macOS
Type: compile error Stage: resolved
Components: Build Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: erlendaasland, ronaldoussoren, samuelmarks
Priority: normal Keywords:

Created on 2020-11-01 10:49 by samuelmarks, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23072 closed samuelmarks, 2020-11-01 10:49
Messages (10)
msg380126 - (view) Author: Samuel Marks (samuelmarks) * Date: 2020-11-01 10:49
Planned to fix all the compiler warnings on macOS. Ended up just fixing this SQLite one:
```
Python-3.9.0/Modules/_sqlite/connection.c:1066:9: warning: 'sqlite3_trace' is deprecated: first deprecated in macOS 10.12
      [-Wdeprecated-declarations]
        sqlite3_trace(self->db, 0, (void*)0);
        ^~~~~~~~~~~~~
        sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3022:36: note: 'sqlite3_trace' has
      been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
                                   ^
Python-3.9.0/Modules/_sqlite/connection.c:1069:9: warning: 'sqlite3_trace' is deprecated: first deprecated in macOS 10.12
      [-Wdeprecated-declarations]
        sqlite3_trace(self->db, _trace_callback, trace_callback);
        ^~~~~~~~~~~~~
        sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3022:36: note: 'sqlite3_trace' has
      been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
                                   ^
```

Note that: `sqlite3_enable_shared_cache` should be removed from `Modules/_sqlite/module.c` also, as warning and guide says: https://www.sqlite.org/c3ref/enable_shared_cache.html
```
Python-3.9.0/Modules/_sqlite/module.c:147:10: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS
      10.7 - Not supported [-Wdeprecated-declarations]
```

But I think that would require a major version change, so let's keep that warning fix to one side.

Same with the tk issues, as per https://bugs.python.org/issue41016 ; although I suspect there's a way to quiet the warnings here…
msg380161 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-11-01 20:22
FYI, commit 7f331c8 (GH-19581 / bpo-40318) migrates the sqlite3 to the new trace API.

There was also a discussion about sqlite3_enable_shared_cache() on bpo, but I think it was closed as "wont-fix", IIRC.
msg380162 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-11-01 20:52
Look at bpo-24464 regarding the shared cache issue. Apparently I did not remember correctly regarding its status.
msg380163 - (view) Author: Samuel Marks (samuelmarks) * Date: 2020-11-01 20:53
Yes, this commit extends his changes to include macOS support (for some reason that SQLite version check doesn’t work properly on macOS; so this checks the macOS version, knowing AOT when SQLite trace v1 APIs were deprecated.

Curious that `sqlite3_enable_shared_cache` is in the ‘wontfix’ category… why is this?
msg380164 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-11-01 20:58
Oh, I see now that you're only mentioning 3.9 here. The issue was fixed in master only (that is 3.10 alpha). Perhaps GH-19581 should be backported to 3.9, or even 3.8, but that's not for me to decide.

Note: your patch is against 3.10, not 3.9.
msg380165 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-11-01 21:11
> Yes, this commit extends his changes to include macOS support (for some reason that SQLite version check doesn’t work properly on macOS

I can't reproduce this on master on macOS 10.15.7 with the SQLite 3.28.0 that's shipped with the os.
msg380170 - (view) Author: Samuel Marks (samuelmarks) * Date: 2020-11-02 00:48
@erlendaasland Hmm… just double-checked, and this issue is present on Python 3.8.6 and 3.9.0 but not master [d3b4e068077dd26927ae7485bd0303e09d962c02] as you referenced.

Should I close this issue—and PR—then? - Backport from master to these?
msg380182 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-11-02 06:24
> Should I close this issue—and PR—then? - Backport from master to these?

If this fix is wanted in 3.9 and 3.8, I think the correct way to proceed would be to close GH-23072 and backport GH-19581.

Try checking out 3.9 and cherrypicking 7f331c8 to verify that the trace-warning disappears. I'm pretty sure that SQLite3 version detection works on macOS.
msg380183 - (view) Author: Samuel Marks (samuelmarks) * Date: 2020-11-02 06:25
👌
msg380187 - (view) Author: Samuel Marks (samuelmarks) * Date: 2020-11-02 07:27
Opened two issues and two PRs for 3.8 and 3.8:
- https://bugs.python.org/issue42241
- https://bugs.python.org/issue42242
History
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86395
2020-11-02 07:27:40samuelmarkssetmessages: + msg380187
2020-11-02 06:25:36samuelmarkssetstatus: open -> closed
stage: resolved
2020-11-02 06:25:19samuelmarkssetmessages: + msg380183
2020-11-02 06:24:11erlendaaslandsetmessages: + msg380182
2020-11-02 00:48:28samuelmarkssetmessages: + msg380170
2020-11-01 21:12:56erlendaaslandsetnosy: + ronaldoussoren
2020-11-01 21:11:35erlendaaslandsetmessages: + msg380165
2020-11-01 20:58:14erlendaaslandsetmessages: + msg380164
2020-11-01 20:53:07samuelmarkssetmessages: + msg380163
2020-11-01 20:52:53erlendaaslandsetmessages: + msg380162
2020-11-01 20:22:56erlendaaslandsetnosy: + erlendaasland
messages: + msg380161
2020-11-01 10:49:32samuelmarkscreate