Repository navigation
Conversation
The podspec walked up from its own folder to the first package.json. Under pnpm that folder is in the store, so in a monorepo the walk ended at the workspace root and ignored the app's "op-sqlite" config: a SQLCipher app built plain SQLite. Android already reads the app's package.json. The old lookup stays as it was. After it, when CocoaPods found a Podfile, the podspec walks up from the app (the folder above the Podfile), no higher than the folder the old lookup found, and uses the first package.json with an "op-sqlite" key. A config in a monorepo root package.json still works, and nothing above the workspace is read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Fix the swift version too please |
The autolinker hands SwiftPM this package through a symlink inside the app, and #filePath keeps that path. It is not inside node_modules, so isUserApp was false and the manifest read example/package.json, which the published package does not ship: the app's "op-sqlite" config was ignored. Search from the real directory instead, then prefer the app's package.json as the podspec does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rachitsrivastava07
force-pushed
the
fix/podspec-app-package-json
branch
from
November 5, 2026 07:28
d82ab1c to
1eef2a7
Compare
Contributor
Author
Done in 08f4d7b. Testing it showed SwiftPM had a second problem in front of the pnpm one: the autolinker hands the package over through a symlink inside the app, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On iOS,
op-sqlite.podspecwalks up from its own folder and uses the firstpackage.jsonit finds. Under pnpm, that folder is in the store (<repo>/node_modules/.pnpm/@op-engineering+op-sqlite@…/node_modules/@op-engineering/op-sqlite), so in a monorepo the walk skips the app and stops at the workspace root. The app's"op-sqlite"block is never read, and nothing fails: an app that asks for SQLCipher builds plain SQLite, and theencryptionKeyit passes is ignored.Package.swift(SwiftPM) has the same walk, and a second problem in front of it. The autolinker gives SwiftPM this package through a symlink inside the app (<app>/ios/build/generated/autolinking/libs/OpSqlite), and#filePathkeeps that symlink path. The path has nonode_modulesin it, soisUserAppis false and the manifest readsexample/package.json, which the published package doesn't ship. In any app, pnpm or not, the config is read as empty.Android doesn't have this problem, because
build.gradlereads the app'spackage.json($rootDir/../package.json).Related: #172, #264, #268.
Change
Pod::Config.instance.podfile_path;pod installlooks it up before it evaluates any podspec), the podspec walks up from the app, the folder above the Podfile. It goes no higher than the folder the old lookup found, and uses the firstpackage.jsonon the way with an"op-sqlite"key.package.json, which the docs recommend today, is still picked up, and nothing above the workspace is read.Package.swiftdoes the same. It runs the old walk from the symlink's real directory (resolvingSymlinksInPath()), sonode_modulesis found. Then, when it was reached through the autolinker's symlink, it walks up from the app, the folder above the one holdingbuild/generated/autolinking, with the same bound and the same"op-sqlite"key rule. Without the symlink it keeps the old result.isUserAppitself, and everything else that uses it, is unchanged.package.jsonhave an"op-sqlite"block, iOS now uses the app's. Android already does.docs/docs/installation.mdnow says to put the config in the app'spackage.json.Tested
I ran the old and new podspec under a stub of the CocoaPods calls the podspec makes (
Pod::Spec.new,Pod::Config.instance.podfile_path), with"sqlcipher": truewherever a config is present unless the row says otherwise:apps/mobile/package.jsononlypackage.json, pure SQLiteapps/mobile/package.json, SQLCiphernode_modules, config in the rootpackage.jsononlypackage.jsonPod::Confignot definedpackage.jsononlypackage.jsonabove the workspacepackage.json, pure SQLiteOnly the first row and the both-configs row change.
For
Package.swiftI built each layout on disk with the autolinker's symlink, plus a root package that depends on../build/generated/autolinking/libs/OpSqlite, and ranswift package resolve(Swift 6.3.3) with the old and the new manifest. The table shows thepackage.jsoneach one printed in[OP-SQLITE] SPM configuration found at:…/OpSqlite/example/package.json(missing, so no config)package.jsonisn't valid JSON, root configuredexample/(the symlink points at the repo root)example/package.jsonexample/package.jsonI also loaded both versions of the podspec through real CocoaPods 1.17.0 (
Pod::Specification.from_file), run from theios/folder of a pnpm monorepo app (React Native 0.86.3) with the Podfile already looked up, aspod installdoes first. The old podspec read the rootpackage.jsonand used pure SQLite. The new one reportedConfiguration found at …/apps/mobile/package.json,using SQLCipherandPerformance mode enabled, and itsGCC_PREPROCESSOR_DEFINITIONSincludeSQLITE_HAS_CODEC. Without the Podfile lookup, both versions give the old result.I haven't run a full
pod install, an Xcode build, orreact-native spm updatewith this branch; the fixtures stand in for the autolinker's symlink.Not in this PR
isUserAppinPackage.swiftis still false under the symlink, and the tokenizers step uses it to findc_sources. I left that alone because I haven't run a tokenizers build.🤖 Generated with Claude Code