Repository navigation
build-vercel.sh: hash engine files for the cache dir (restore [dist-dir] support) - #8
Merged
Merged
Conversation
Addresses review feedback: deriving VER from $(dirname "$DIST")/package.json only works when DIST is node_modules/chdb-wasm/dist. For any other [dist-dir] arg (e.g. ./dist or a standalone engine dir) dirname points elsewhere, reading this repo's package.json (0.0.0) or hitting ENOENT — breaking the [dist-dir] argument. Hash the actual mt engine files with node's crypto instead: still md5sum-free (fixes the exit-127 Vercel build), still content-based (any engine change busts the cache), and works for any DIST dir. The 16-char digest matches `cat <files> | md5sum`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review follow-up: the unquoted $ENGINE_FILES expansion word-splits when DIST contains a
space, so node received path fragments. Build the list as a bash array and expand it
quoted ("${ENGINE_FILES[@]}") so each full path is preserved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Follow-up to the exit-127 fix. Review flagged that computing
VERfrom$(dirname "$DIST")/package.jsononly works for the defaultDIST(
node_modules/chdb-wasm/dist); for any other[dist-dir]arg,dirnamepoints elsewhereand reads this repo's
package.json(0.0.0) or throwsENOENT.Fix: hash the mt engine files (glue + wasm) with node's
cryptoinstead of a version lookup.md5sum-free (the Vercel image doesn't ship it).DISTdir, restoring the[dist-dir]argument.cat <files> | md5sum.Verified locally: default invocation, a non-default standalone dist dir, and hash-equals-md5sum.
🤖 Generated with Claude Code
Note
Replace version-based cache dir naming with content hash of engine files in
build-vercel.shThe cache directory name (
VER) is now derived from an MD5 hash of the engine files ($JS,chdb.mjs,chdb.wasm) instead of thepackage.jsonversion, so cache invalidation tracks actual file changes rather than version bumps.ENGINE_FILESarray collecting$DIST-prefixed paths for the relevant files.VERasdist-followed by the first 16 hex chars of the MD5 hash via a Node one-liner.package.json.$OUTwill differ from previous runs, invalidating any existing caches on next deploy.Macroscope summarized 1eb81bf.