Skip to content

Fix macOS shim cache reuse and atomic publication - #3

Merged
timsehn merged 1 commit into
mainfrom
fix/2-stable-macos-shim
Nov 2, 2026
Merged

timsehn merged 1 commit into
mainfrom
fix/2-stable-macos-shim

Conversation

@timsehn

@timsehn timsehn commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Every macOS interpreter start used a process-randomized cache key, copying and patching another library. Concurrent starts could also reuse a shim before copying or patching finished.

Use a stable SHA-256 key over the resolved library path, modification time, and target install name. Build in a private temporary directory, then publish with an atomic rename. Failed builds leave no cached library to poison a retry.

Validation:

  • Eight unit tests pass on Python 3.9, 3.13, and 3.14. The original loader failed five of the initial seven tests.
  • An installed wheel using the published v0.51.6 native library passes the existing smoke test, cross-process cache reuse without rewriting the shim, and four concurrent cold imports. The published unpatched wheel fails the reuse test.
  • Both unit and installed-wheel regressions are wired into CI.

Fixes #2

Co-Authored-By: OpenAI Codex noreply@openai.com

Use a stable digest of the resolved library path, mtime, and SQLite install name. Patch a private staging copy and atomically replace the cached shim so failed or concurrent builds cannot expose an unfinished library. Cover cross-process reuse, invalidation, failure cleanup, and concurrent starts in CI.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@timsehn
timsehn merged commit b63d697 into main Nov 2, 2026
6 checks passed
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.

macOS: shim cache key uses hash(), so every start copies libdoltlite into a new $TMPDIR dir

1 participant