Skip to content

Add missing package dependencies to resolve non-SPM linker failures#441

Open
scogeo wants to merge 2 commits into
pointfreeco:mainfrom
scogeo:package-fix
Open

Add missing package dependencies to resolve non-SPM linker failures#441
scogeo wants to merge 2 commits into
pointfreeco:mainfrom
scogeo:package-fix

Conversation

@scogeo
Copy link
Copy Markdown

@scogeo scogeo commented Apr 6, 2026

Summary

Fixes linker issues when non-SPM targets depend on SqliteData by explicitly declaring missing package dependencies.

Details

When linking non-SPM targets to SqliteData, builds can fail due to undeclared dependencies in the sqlite-data package:

  • StructuredQueriesCore is directly imported in multiple source files but is not listed in the package manifest.
  • StructuredQueriesSQLiteCore is not explicitly imported, but is resolved transitively by Swift Package Manager. However, this transitive resolution does not carry over to non-SPM targets, resulting in missing symbol linker errors (especially in test builds).

A typical failing dependency chain:

(.xctest, .xcframework, .appex)
    → (internal SPM library)
        → (sqlite-data)

In these cases:

  • Compilation succeeds and dependencies appear resolved.
  • Linking fails in test builds or produces warnings in non-test builds.

Environment

  • Xcode 26.4 (17E192)
  • swift-driver 1.148.6
  • Apple Swift 6.3 (swiftlang-6.3.0.123.5 clang-2100.0.123.102)
  • Target: arm64-apple-macosx26.0

Resolution

This PR explicitly adds the missing dependencies to the package manifest, ensuring consistent linking behavior across both SPM and non-SPM targets.

@mbrandonw
Copy link
Copy Markdown
Member

Hi @scogeo, sorry we never responded to this. We've been modernizing our packages to turn on explicit imports (#467) and so hopefully some of that work will fix any problems you are seeing.

But I am curious about how exactly to reproduce the problem you are running into here. Because StructuredQueriesSQLite re-exports those two libraries, so it should be sufficient to just depend on the one. We'd be happy to merge this if it fixes something, but we just want to understand what is going on.

@scogeo
Copy link
Copy Markdown
Author

scogeo commented May 29, 2026

@mbrandonw No worries. My project is fairly complex, so I would have to create a much simpler project that can reproduce it. I am hoping it may also just be an Xcode tooling issue that self resolves at some point. If you prefer, we can close this PR for now, and I can open an issue when I have a simpler reproducible project along with a PR that resolves it.

If I confirm that #467 fixes the issue I will add a followup comment.

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.

2 participants