fix: make schema-sync directory renames EXDEV-safe for docker builds#2357
Open
mikemeier wants to merge 1 commit into
Open
fix: make schema-sync directory renames EXDEV-safe for docker builds#2357mikemeier wants to merge 1 commit into
mikemeier wants to merge 1 commit into
Conversation
During docker build /app is overlayfs, and renameSync on a directory that came from a lower image layer (COPY . .) fails with EXDEV even though src and dest are on the same mount. This broke sync-schemas (and thus schemas:ensure / build:lib) in any image build without a pre-populated schema cache, misreported as 'AdCP not reachable' by the fallback path. Fall back to copy+delete on EXDEV and include the original error in the GitHub-dist fallback warning so extraction failures are no longer misreported as network failures. Co-Authored-By: Claude Fable 5 <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.
Problem
npm run sync-schemas(and thereforeschemas:ensure/build:lib) fails inside anydocker buildwhere the schema cache is not pre-populated.During an image build, the working tree is overlayfs.
renameSyncon a directory that came from a lower image layer (e.g. viaCOPY . .) fails withEXDEV: cross-device link not permittedeven though src and dest are on the same mount — overlayfs cannot rename lower-layer directories. This hitscopySkillTreewhen it snapshots an existing skill dir (skills/adcp-brand->skills/adcp-brand.previous) and can equally hitreplaceTree.The failure is then misreported: the catch in
sync()swallows the error and printsAdCP <version> was not reachable from adcontextprotocol.org, and the GitHub-dist fallback 404s (nodist/onmain), so the build dies with a misleading network error. Bind mounts and normal checkouts are unaffected, which makes this look flaky/environment-specific.Fix
moveTreeSync: tryrenameSync, and onEXDEVfall back tocpSync(recursive)+rmSync— overlayfs handles copy+delete fine. Used at all three directory-rename sites (replaceTreex2,copySkillTree).Notes
scripts/-only change (dev tooling, not published infiles), so no changeset per CONTRIBUTING policy — happy to add one if you want it anyway.docker builda context containing the repo, runnpm run sync-schemaswith an emptyschemas/cache/. Verified fixed in node:22-alpine builds.🤖 Generated with Claude Code