Skip to content

Adopt Cocoanetics/GitKit; own the sqlite3 shell port + vend shellkit Commands - #58

Merged
odrobnik merged 4 commits into
mainfrom
claude/recursing-lamarr-1c570b
Jun 9, 2026
Merged

Adopt Cocoanetics/GitKit; own the sqlite3 shell port + vend shellkit Commands#58
odrobnik merged 4 commits into
mainfrom
claude/recursing-lamarr-1c570b

Conversation

@odrobnik

@odrobnik odrobnik commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Two related external-dependency / structure changes for SwiftPorts. (Also unblocks main, which is currently red from a Sqlite3Shell target-name collision with SQLiteKit main — see below.)

1. libgit2 → Cocoanetics/GitKit (409438d)

Replaces the odrobnik/libgit2 fork-of-a-fork dependency with Cocoanetics/GitKit (libgit2 packaged for SwiftPM, all platforms green). SwiftGit, GitCommand, and CLibgit2Shim now consume the CGitKit product; SwiftGit imports CGitKit.

2. Own the sqlite3 shell port + vend shellkit Command faces (89a288a)

Part of the toolchain layering (ShellKit = command base, SwiftPorts = ports with two faces each, SwiftBash = installer):

  • Restore Sqlite3Shell locally (Parser + Sqlite3Executable), depending on SQLiteKit's SDK product + ShellKit. Sqlite3Command + the sqlite3 executable depend on the local target again. SQLiteKit is now SDK-only (Drop the Sqlite3Shell CLI driver — SDK-only package SQLiteKit#2). (This reworks the intermediate 8a9aa0e, which had moved the shell port to SQLiteKit; the SDK stays external, the shell port comes home.)
  • Add Sqlite3Builtin — the ArgumentParser-free ShellKit Command face of the shell port (so it installs on Android too).
  • Add SwiftPortsCommands — vends every ArgumentParser-backed port (jq, rg, fd, gh, glab, git, archive + compression families) as a ready-to-install ShellKit Command, bridged through ShellKit's own Shell.parsableCommand(_:) (ShellCommandKit: vend bridged Commands as instances + redact Sandbox.Denial ShellKit#16) — no per-host bridge. Android-dropped (ArgumentParser-bearing); Sqlite3Builtin is 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 via swift 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 Sqlite3Shell target name collides); SwiftBash last.

🤖 Generated with Claude Code

odrobnik and others added 3 commits June 9, 2026 19:12
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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

main's #56/#57 (631609b) moved the sqlite3 shell port out to SQLiteKit;
this branch deliberately brings it back (toolchain layering: ShellKit =
command base, SQLiteKit = SDK only, SwiftPorts owns the port's two faces).
Keep our tree; main's externalization is superseded.
@odrobnik
odrobnik merged commit a387e36 into main Jun 9, 2026
2 of 5 checks passed
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>
@odrobnik
odrobnik deleted the claude/recursing-lamarr-1c570b branch June 10, 2026 18:35
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.

1 participant