Skip to content

fix(test): parenthesize case patterns in darwin cross-compiler target - #9855

Open
lloydmangnall wants to merge 2 commits into
dgraph-io:mainfrom
lloydmangnall:fix/t-makefile-darwin-case-syntax
Open

lloydmangnall wants to merge 2 commits into
dgraph-io:mainfrom
lloydmangnall:fix/t-makefile-darwin-case-syntax

Conversation

@lloydmangnall

@lloydmangnall lloydmangnall commented Oct 10, 2026 •

Copy link
Copy Markdown

Description

make setup / make -C t install-deps-cross-compiler-darwin fails on macOS:

/bin/sh: -c: line 0: syntax error near unexpected token `;;'
/bin/sh: -c: line 0: `brew tap messense/macos-cross-toolchains && brew install messense/macos-cross-toolchains/$(case $(uname -m) in arm64|aarch64) echo aarch64-unknown-linux-gnu;; x86_64) echo x86_64-unknown-linux-gnu;; esac)'

macOS /bin/sh is bash 3.2, which can't parse a case with unparenthesized patterns inside $(...): the pattern's ) closes the command substitution early. Without the cross toolchain, the linux/arm64 half of make install then fails with cgo: C compiler "aarch64-unknown-linux-gnu-gcc" not found.

The fix uses the POSIX leading-paren form, (arm64|aarch64) and (x86_64), which every POSIX shell accepts.

Verified on macOS (Apple Silicon, /bin/sh = GNU bash 3.2.57): the recipe from make -n now parses under /bin/sh -n and resolves to aarch64-unknown-linux-gnu. After installing the toolchain, make install builds both darwin/arm64 and linux/arm64 binaries.

Checklist

  • The PR title follows the
    Conventional Commits syntax, leading
    with fix:, feat:, chore:, ci:, etc.
  • Code compiles correctly and linting (via trunk) passes locally

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Updated the macOS cross-compiler installation command’s architecture matching syntax.

`install-deps-cross-compiler-darwin` fails on macOS with
"syntax error near unexpected token `;;'" because /bin/sh (bash 3.2)
cannot parse a `case` with unparenthesized patterns inside `$(...)`:
the pattern's closing paren ends the command substitution early.

Use the POSIX leading-paren pattern form so the recipe parses under
macOS /bin/sh. This also unblocks `make setup` on Apple Silicon and
the linux/arm64 half of `make install`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lloydmangnall
lloydmangnall requested a review from a team as a code owner October 10, 2026 15:05
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5059fc0f-6233-4974-b73d-e608a10368bf
📥 Commits

Reviewing files that changed from the base of the PR and between d63bca6 and d327bfe.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d5582fc9-d7dc-4005-97a0-eed62c69bc64
📥 Commits

Reviewing files that changed from the base of the PR and between 317411f and d63bca6.

📒 Files selected for processing (1)
  • t/Makefile

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Walkthrough

The macOS cross-compiler install command now parenthesizes its architecture case patterns. The architecture mappings and selected Homebrew packages remain unchanged.

Changes

macOS cross-compiler installation

Layer / File(s) Summary
Parenthesize architecture patterns
t/Makefile
The command now wraps the arm64|aarch64 and x86_64 case patterns in parentheses. Architecture mappings and Homebrew package selection are unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: mlwelles

Merge Risk: ⚪ Minimal · up to d63bc

The change preserves the architecture mappings while correcting the reported shell parsing issue. No actionable merge-blocking risk is evident.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: parenthesizing case patterns in the Darwin cross-compiler target.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant