Skip to content

fix: use uname -m for architecture detection#9

Merged
Timmy6942025 merged 2 commits intomasterfrom
fix/arch-detection
Mar 27, 2026
Merged

fix: use uname -m for architecture detection#9
Timmy6942025 merged 2 commits intomasterfrom
fix/arch-detection

Conversation

@Timmy6942025
Copy link
Copy Markdown
Owner

Problem

In GitHub Codespaces (and possibly other environments), MACHTYPE is incorrectly set to x86_64 even when running on arm64. This causes the launcher script to try to run the wrong binary, resulting in "Exec format error".

Solution

Prioritize uname -m for architecture detection instead of relying on HOSTTYPE/MACHTYPE environment variables.

The HOSTTYPE/MACHTYPE environment variables can be incorrect
in some environments (e.g., GitHub Codespaces), causing
arm64 machines to try to run x86_64 binaries.

Now prioritizes uname -m for reliable architecture detection.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 98c47d91-e7dc-49f0-8502-ef6e02292eb7

📥 Commits

Reviewing files that changed from the base of the PR and between f497c8b and c65aea0.

📒 Files selected for processing (1)
  • fpf
📜 Recent review details
🔇 Additional comments (1)
fpf (1)

51-59: Good fix: architecture detection now uses uname -m as source of truth.

This change correctly avoids MACHTYPE/HOSTTYPE drift and keeps compatibility with the later goarch mapping and packaged binary names.


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Improved bootstrap process reliability by streamlining architecture detection logic.

Walkthrough

The Go bootstrap script now unconditionally retrieves the machine architecture via uname -m and normalizes it with a case statement mapping x86_64/aarch64 to their respective aliases. The fallback logic within the case default has been removed, simplifying the conditional flow.

Changes

Cohort / File(s) Summary
Go Bootstrap Script
Bootstrap shell script
Refactored machine architecture detection to unconditionally obtain uname_m upfront, then normalize via case statement. Removed redundant fallback branch that conditionally executed uname -m within the default case, streamlining the logic flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through the bootstrap's way,
Simplifying paths, come what may! 🐰
One clear line, no second guess,
Makes the architecture shine its best!
Fewer branches, logic blessed!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: prioritizing uname -m for architecture detection instead of relying on environment variables.
Description check ✅ Passed The PR description is directly related to the changeset, explaining the problem (incorrect MACHTYPE in Codespaces) and the solution (using uname -m for detection).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/arch-detection
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/arch-detection

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

@Timmy6942025 Timmy6942025 merged commit 93f607d into master Mar 27, 2026
1 check failed
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.

1 participant