fix(build): escape literal braces in bun:sqlite stub regex (Perl strict)#2111
Open
nuga0718 wants to merge 1 commit into
Open
fix(build): escape literal braces in bun:sqlite stub regex (Perl strict)#2111nuga0718 wants to merge 1 commit into
nuga0718 wants to merge 1 commit into
Conversation
The Node server bundle post-processing in build-node-server.sh uses a
Perl substitution with an unescaped literal `{` in the pattern
`import { Database } from "bun:sqlite";`. Perl treats an unescaped `{`
that is not part of a valid quantifier as an error ("Unescaped left
brace in regex is illegal here in regex"), hard-failing the build with
exit code 255 and breaking `./setup`.
Reproduced on Windows Git Bash (msys Perl 5.26.2); also affects modern
Perl 5.32+ on Linux. Escaping the braces (`\{ \}`) matches them
literally and is backward compatible; verified the substitution still
produces the expected `const Database = null` stub and `node --check`
passes on the resulting server-node.mjs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
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
./setupfails on Windows with exit code 255 during the final build step:browse/scripts/build-node-server.shpost-processes the Node server bundle with a Perl substitution that stubs out thebun:sqliteimport. The pattern contains an unescaped literal{:perl -pi -e 's|import { Database } from "bun:sqlite";|const Database = null; ...|g' ...Perl treats an unescaped
{that is not part of a valid quantifier as an error, so the build hard-fails before the stub is applied.Environment
Fix
Escape the braces (
\{ \}) so they match literally. One-line change, behavior-preserving.Verification
After the fix, on the same Windows environment:
const Database = null; // bun:sqlite stubbed on Node(no realfrom "bun:sqlite"import remains).node --check browse/dist/server-node.mjspasses.🤖 Generated with Claude Code