Adopt Cocoanetics/GitKit; own the sqlite3 shell port + vend shellkit Commands - #58
Merged
Conversation
Replace the odrobnik/libgit2 fork pin with Cocoanetics/GitKit (from: 1.9.4), which packages a pristine libgit2 submodule and exposes the curated, Windows-safe CGitKit module. SwiftGit/GitCommand/CLibgit2Shim now depend on the CGitKit product; SwiftGit sources import CGitKit instead of libgit2. GitClient API and behaviour are unchanged. Verified the git chain (CLibgit2Shim/SwiftGit/GitCommand) builds against GitKit on macOS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `Sqlite3Shell` driver (argv parser + dot-command / REPL engine) and
its test suite now live in Cocoanetics/SQLiteKit, the package this repo
already depends on for the SQLite SDK. Keeping a byte-identical copy here
was pure duplication — and, once SQLiteKit's `main` started vending its
own `Sqlite3Shell` product, a latent module-name collision waiting for
the pin to advance.
So remove SwiftPorts' local copy entirely:
- delete the `Sqlite3Shell` target + its `.library` product and
`Sources/SQLiteKit/Sqlite3Shell/` (Parser + Sqlite3Executable);
- delete the duplicated `Sqlite3Tests` target + `Tests/Sqlite3Tests/`
(SQLiteKit's own Sqlite3ShellTests covers the same ground on every
platform);
- repoint `Sqlite3Command` at `.product(name: "Sqlite3Shell",
package: "SQLiteKit")` — it only ever used the driver's public
`Sqlite3Executable.run`.
SwiftPorts now keeps just the two SwiftPorts-specific layers SQLiteKit
doesn't carry: `Sqlite3Command` (the ArgumentParser wrapper) and the
`sqlite3` executable. Downstream embedders that want the bare,
ArgumentParser-free driver (e.g. SwiftBash's `sqlite3` builtin) now
depend on `Sqlite3Shell` from Cocoanetics/SQLiteKit directly.
Verified: `swift build --product sqlite3` links the full chain against
SQLiteKit's driver, and the binary runs (in-memory queries; `.open
:memory:` creates no stray file).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The toolchain is being layered so ShellKit owns the command-building base,
SwiftPorts owns the ports (each with a macOS-CLI face AND a shellkit
`Command` face), and a host shell (SwiftBash) merely installs them. This is
the SwiftPorts half.
* Bring the `sqlite3` shell port back in-package. `Sqlite3Shell`
(`Parser` + `Sqlite3Executable`, ArgumentParser-free, IO via
`ShellKit.Shell.current`) returns as a local target — SQLiteKit is now
SDK-only — and `Sqlite3Command` + the `sqlite3` executable depend on it
again. Restores the `Sqlite3Shell` product and `Sqlite3Tests`. (Reworks
8a9aa0e: the SDK stays external, but the shell port lives here.)
* Add `Sqlite3Builtin` — the ArgumentParser-free ShellKit `Command` face of
the shell port (ported from SwiftBash and decoupled from it: `Shell.current`
instead of `Shell.bashCurrent`, no `SwiftBashVersion`, pure passthrough to
`Sqlite3Executable`). Lives in `Sqlite3Shell`, so it builds everywhere —
Android included — and a host installs `sqlite3` as a virtual bin from one
product.
* Add `SwiftPortsCommands`, which vends every ArgumentParser-backed port
(`jq`, `rg`, `fd`, `gh`, `glab`, `git`, the archive + compression families)
as a ready-to-install ShellKit `Command`, bridged through ShellKit's own
`ShellCommandKit` (`Shell.parsableCommand(_:)`). No per-host bridge. The
same platform gates the command targets carry are mirrored here.
* `androidDroppedTargets` gains `SwiftPortsCommands` (ArgumentParser-bearing);
the AP-free `sqlite3` builtin in `Sqlite3Shell` survives on Android.
Depends on ShellKit's new `Shell.parsableCommand(_:)` factory.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
odrobnik
added a commit
that referenced
this pull request
Jun 9, 2026
…59) Reverts only the GitKit-swap commit from #58 (which regressed git stash apply/ pop/branch on libgit2 1.9.4) and keeps the entire sqlite3 toolchain layering. Restores the odrobnik/libgit2 fork, whose git_stash_apply works. All 155 SwiftGit tests pass; CI green on all 5 platforms. Restores SwiftPorts main to green. GitKit + a proper libgit2-1.9.4 stash fix is a separate follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Two related external-dependency / structure changes for SwiftPorts. (Also unblocks
main, which is currently red from aSqlite3Shelltarget-name collision with SQLiteKitmain— see below.)1. libgit2 → Cocoanetics/GitKit (
409438d)Replaces the
odrobnik/libgit2fork-of-a-fork dependency with Cocoanetics/GitKit (libgit2 packaged for SwiftPM, all platforms green).SwiftGit,GitCommand, andCLibgit2Shimnow consume theCGitKitproduct;SwiftGitimportsCGitKit.2. Own the
sqlite3shell port + vend shellkit Command faces (89a288a)Part of the toolchain layering (ShellKit = command base, SwiftPorts = ports with two faces each, SwiftBash = installer):
Sqlite3Shelllocally (Parser+Sqlite3Executable), depending on SQLiteKit's SDK product + ShellKit.Sqlite3Command+ thesqlite3executable depend on the local target again. SQLiteKit is now SDK-only (Drop the Sqlite3Shell CLI driver — SDK-only package SQLiteKit#2). (This reworks the intermediate8a9aa0e, which had moved the shell port to SQLiteKit; the SDK stays external, the shell port comes home.)Sqlite3Builtin— the ArgumentParser-free ShellKitCommandface of the shell port (so it installs on Android too).SwiftPortsCommands— vends every ArgumentParser-backed port (jq,rg,fd,gh,glab,git, archive + compression families) as a ready-to-install ShellKitCommand, bridged through ShellKit's ownShell.parsableCommand(_:)(ShellCommandKit: vend bridged Commands as instances + redact Sandbox.Denial ShellKit#16) — no per-host bridge. Android-dropped (ArgumentParser-bearing);Sqlite3Builtinis the AP-free exception that survives.Verification
Full
swift build+swift build --product sqlite3+Sqlite3Tests(61) green on macOS, with the sibling branches wired in locally viaswift package edit. Cross-platform (Linux/iOS/Windows/Android) is for CI.Landing order
Cocoanetics/ShellKit#16 first; this + Cocoanetics/SQLiteKit#2 together (SwiftPorts needs SQLiteKit SDK-only or the
Sqlite3Shelltarget name collides); SwiftBash last.🤖 Generated with Claude Code