[PR #1325] [MERGED] fix(native): refuse to list architectures of non-Mach-O targets #2801

Closed
opened 2026-10-17 21:10:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1325
Author: @kaoru0822-kitauji
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/native-list-architectures-non-macho


📝 Commits (1)

  • 32c543c fix(native): refuse to list architectures of non-Mach-O targets

📊 Changes

2 files changed (+35 additions, -0 deletions)

View changed files

📝 src/native/NativeMacOSProvider.ts (+10 -0)
📝 tests/boundary/providers/native/nativeProvider.test.ts (+25 -0)

📄 Description

Summary

list_architectures / rea list-architectures ran lipo -detailed_info on every admitted target. For a PE DLL, an ELF binary or a plist, lipo exits 1 with can't figure out architecture for …, and REA projected that as:

{ "code": "execution_failure",
  "message": "Analysis could not complete. Retry once; if it continues, run `rea doctor`.",
  "details": { "provider_id": "native-macos", "operation": "list_architectures",
               "captured_output": { "stderr": "lipo: can't figure out architecture for '…/clink_dll_x64.dll'\n" } } }

The target is simply not Mach-O, so neither retrying nor rea doctor can help. Reproduced on main against every .dll under /Applications on this Mac (10 files, native and managed .NET, e.g. Tabby's clink_dll_x64.dll and VS Code's Microsoft.PowerShell.PSReadLine.dll) and against KeepingYouAwake.app/Contents/Info.plist. Found in a sweep of real-app targets.

Change

#listArchitectures refuses a non-Mach-O target before running lipo, with the same AnalysisCapabilityUnavailableError ("Active artifact is not Mach-O.") that inspect_macho already returns in the same provider. Mach-O and universal targets are unchanged.

Verification

  • tests/boundary/providers/native/nativeProvider.test.ts: PE and ELF targets now get capability_unavailable with that reason, and the runner is never called. Both cases fail on main.
  • Real CLI on macOS arm64: the DLL and the plist now report capability_unavailable / "Active artifact is not Mach-O."; /bin/ls still lists its architectures.
  • npm run check:changed, npm run format:check

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1325 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/native-list-architectures-non-macho` --- ### 📝 Commits (1) - [`32c543c`](https://github.com/morluto/rea/commit/32c543ce7769518e1d6973d78ee79fbbc83335af) fix(native): refuse to list architectures of non-Mach-O targets ### 📊 Changes **2 files changed** (+35 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/native/NativeMacOSProvider.ts` (+10 -0) 📝 `tests/boundary/providers/native/nativeProvider.test.ts` (+25 -0) </details> ### 📄 Description ## Summary `list_architectures` / `rea list-architectures` ran `lipo -detailed_info` on every admitted target. For a PE DLL, an ELF binary or a plist, `lipo` exits 1 with `can't figure out architecture for …`, and REA projected that as: ```json { "code": "execution_failure", "message": "Analysis could not complete. Retry once; if it continues, run `rea doctor`.", "details": { "provider_id": "native-macos", "operation": "list_architectures", "captured_output": { "stderr": "lipo: can't figure out architecture for '…/clink_dll_x64.dll'\n" } } } ``` The target is simply not Mach-O, so neither retrying nor `rea doctor` can help. Reproduced on `main` against every `.dll` under `/Applications` on this Mac (10 files, native and managed .NET, e.g. Tabby's `clink_dll_x64.dll` and VS Code's `Microsoft.PowerShell.PSReadLine.dll`) and against `KeepingYouAwake.app/Contents/Info.plist`. Found in a sweep of real-app targets. ## Change `#listArchitectures` refuses a non-Mach-O target before running `lipo`, with the same `AnalysisCapabilityUnavailableError` ("Active artifact is not Mach-O.") that `inspect_macho` already returns in the same provider. Mach-O and universal targets are unchanged. ## Verification - `tests/boundary/providers/native/nativeProvider.test.ts`: PE and ELF targets now get `capability_unavailable` with that reason, and the runner is never called. Both cases fail on `main`. - Real CLI on macOS arm64: the DLL and the plist now report `capability_unavailable` / "Active artifact is not Mach-O."; `/bin/ls` still lists its architectures. - `npm run check:changed`, `npm run format:check` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2801
No description provided.