groue / GRDB.swift

A toolkit for SQLite databases, with a focus on application development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugging no longer possible after installing Custom SQLite build

marchy opened this issue · comments

What did you do?

Installed Custom SQL Build as per the instructions in the docs.

What did you expect to happen?

po command while stopping at a breakpoint while debugging in Xcode would work as per usual.

What happened instead?

po {some variable} command throws the following error (where {some variable} is any variable within the active stack frame):

error: /Users/.../MyApp-dwgxauhihhscsgfuakjstodrcfim/Build/Products/Dev-iphoneos/GRDB.framework/Headers/sqlite3.h:7281:9: error: 'sqlite3_module::xIntegrity' from module 'GRDB.sqlite3' is not present in definition of 'struct sqlite3_module' provided earlier
  int (*xIntegrity)(sqlite3_vtab *pVTab, const char *zSchema,

Environment

GRDB flavor(s): Custom SQLite build
GRDB version: 6.23.0
Installation method: (CocoaPods, SPM, manual?)
Xcode version: 15.1
Swift version: Latest (Swift 5 specified in Xcode, presumably v5.9)
Platform(s) running GRDB: iOS
macOS version running Xcode: Sonoma (14.1.2)

Demo Project

N/A

Notes

Any idea what might be causing this?
The severity is really high as it has prevented us from seeing any values while debugging so it is a major developer workflow handicap that we need to get past.

One culprit I was thinking about is that our 'Debug' build configuration is called 'Dev' for us, so within /DerivedData/MyApp-XXXXX/Build/Products the Custom SQLite build exports its build artifacts into a Debug-iphoneos folder (containing libsqlitecustom.a and the GRDB.framework folder) which we then manually copy over into our Dev-iphoneos folder). Not sure if this build config however affects GRDB / the SQLLite lib in some way?

Hello @marchy,

This looks very painful indeed. Now, I have no idea of the cause. I could use successfully use po while running the custom SQLite test app.

I recommend checking your various hypothesis. I fully understand that such build issues are delicate and time consuming... Filing a report on https://feedbackassistant.apple.com might help as well.

The error says:

error: 'sqlite3_module::xIntegrity' from module 'GRDB.sqlite3' is not present in definition of 'struct sqlite3_module' provided earlier"

This xIntegrity field was added to the sqlite3_module struct with SQLite 3.44.0 (see line 7281 of sqlite/src/sqlite.h.in in swiftlyfalling/SQLiteLib@57a280b).

So it looks like LLDB is not up-to-date. You may have stale information somewhere. I recommended performing all usual cleanup operations, because one of them may fix your issue:

  • Xcode > Project > Clean Build Folder…
  • Delete ~/Library/Developer/Xcode/DerivedData/MyApp
  • Delete MyApp.xcworkspace/xcuserdata
  • Delete MyApp.xcodeproj/xcuserdata

No news is good news. I'm closing this issue.