Skip to content

build: quote paths interpolated into the generated shell scripts - #196

Open
findajay wants to merge 1 commit into
lightpanda-io:forkfrom
findajay:claude/quote-generated-shell-paths
Open

build: quote paths interpolated into the generated shell scripts#196
findajay wants to merge 1 commit into
lightpanda-io:forkfrom
findajay:claude/quote-generated-shell-paths

Conversation

@findajay

@findajay findajay commented Aug 3, 2026

Copy link
Copy Markdown

Three bootstrap steps build a shell command by formatting a path straight into a redirect target:

b.fmt("echo '{s}' > {s}/.gclient", .{ gclient_content, v8_dir })

Unquoted, the shell splits on whitespace, so a checkout under a path containing a space -- "/home/user/my projects/zig-v8-fork" -- redirects to "/home/user/my" and leaves the rest as stray arguments. The bootstrap then fails with no useful indication of why.

Quote the redirect targets. The same change makes the paths safe on Windows, where the separator is a backslash and the shell would otherwise read it as an escape.

Three bootstrap steps build a shell command by formatting a path
straight into a redirect target:

    b.fmt("echo '{s}' > {s}/.gclient", .{ gclient_content, v8_dir })

Unquoted, the shell splits on whitespace, so a checkout under a path
containing a space -- "/home/user/my projects/zig-v8-fork" -- redirects
to "/home/user/my" and leaves the rest as stray arguments. The bootstrap
then fails with no useful indication of why.

Quote the redirect targets. The same change makes the paths safe on
Windows, where the separator is a backslash and the shell would
otherwise read it as an escape.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016rpebiAtvokoPgpBRVweJo
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.

2 participants