fix(cli): prevent fork-bomb when supabase-go binary is not found#5282
Merged
Conversation
LegacyGoProxy.resolveBinary() previously returned the literal string "supabase" as a last-resort fallback when no co-located supabase-go nor any @supabase/cli-<platform> npm package could be found. When a user installs the v2.99.0 release tarball by moving only the `supabase` shim onto PATH and leaving `supabase-go` behind, that fallback resolves to the shim itself — every legacy command then spawns the shim recursively (stdio inherited, parent-side SIGTERM masked by holdSignals), producing the silent multi-minute CI hang that ends in SIGKILL from the runner. Replace the fallback with a structured BinaryResolution result and print a specific diagnostic listing every location the resolver checked, with concrete remediation steps, then exit non-zero before spawning anything. https://claude.ai/code/session_01Lb1v3o9Dabe6qjH565ki4k
The "Docs: ..." line on the not-found diagnostic pointed at a page that doesn't explain the two-binary tarball layout, so it added no context for the user actually stuck. Replace it with a concrete `curl | tar` snippet that uses the CLI_VERSION baked in at build time and the host platform/arch — the asset filename is fully constructed so the user can paste it as-is. Skip the snippet on Windows (different asset format) and on dev builds where CLI_VERSION resolves to the "0.0.0-dev" sentinel. https://claude.ai/code/session_01Lb1v3o9Dabe6qjH565ki4k
The release pipeline publishes `supabase_<version>_windows_<arch>.tar.gz` for every Windows target (in addition to .zip), so the `curl | tar` remediation snippet is just as valid on Windows as on linux/darwin. Drop the platform skip and map Node's historical `win32` to the release asset's `windows` slug. Switch from `os.arch()` to `process.arch` (same value) so the host mock in the unit tests can shape both axes via Object.defineProperty — ESM module namespaces aren't spy-able, so the os module couldn't be intercepted directly. https://claude.ai/code/session_01Lb1v3o9Dabe6qjH565ki4k
jgoux
approved these changes
May 18, 2026
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.
Fixes CLI-1488: the Go proxy layer was silently falling back to
"supabase"on PATH when thesupabase-gobinary could not be resolved. When the shim itself is on PATH andsupabase-gois not co-located, this fallback resolves to the shim and causes a fork-bomb (silent multi-minute hang in CI followed by SIGTERM).Changes
Binary resolution:
resolveBinary()now returns aBinaryResolutiondiscriminated union ({ found: string } | { notFound: string[] }) instead of a fallback string. ThenotFoundvariant tracks all attempted locations for user-facing diagnostics.Error handling: When binary resolution fails,
makeGoProxyLayernow prints a specific diagnostic message to stderr and exits with code 1 viaProcessControl.exit(), rather than attempting to spawn a non-existent binary.User-facing diagnostics: New
formatGoBinaryNotFoundError()function generates a helpful error message that:curl | tarinstall snippets (when CLI_VERSION is not the dev sentinel and the host architecture is supported)Test coverage: Added comprehensive unit tests for
formatGoBinaryNotFoundError()covering:The fix ensures the CLI fails fast with actionable guidance instead of silently fork-bombing itself.
https://claude.ai/code/session_01Lb1v3o9Dabe6qjH565ki4k