mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 00:36:35 +00:00
fix(native): refuse to list architectures of non-Mach-O targets (#1325)
list_architectures ran lipo on every admitted target. For a PE DLL, ELF binary or plist, lipo's refusal surfaced as execution_failure with "Retry once; if it continues, run rea doctor", which neither can fix. Refuse non-Mach-O targets as capability_unavailable before running lipo, as inspect_macho already does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
56598beb4e
commit
1b73b5ab4b
2 files changed
+35
No files matched your search
@@ -283,6 +283,16 @@ class NativeMacOSClient implements AnalysisClient {
|
||||
async #listArchitectures(
|
||||
signal?: AbortSignal,
|
||||
): Promise<Result<NativeObservation, AnalysisError>> {
|
||||
// lipo reads only Mach-O; its refusal of a PE, ELF, or plist target is not
|
||||
// a tool failure that a retry or `rea doctor` could repair.
|
||||
if (this.target.format !== "mach-o")
|
||||
return err(
|
||||
new AnalysisCapabilityUnavailableError(
|
||||
IDENTITY.id,
|
||||
"list_architectures",
|
||||
"Active artifact is not Mach-O.",
|
||||
),
|
||||
);
|
||||
const capture = await this.#run(
|
||||
"list_architectures",
|
||||
"lipo",
|
||||
|
||||
Reference in new issue
Block a user