[PR #7051] [CLOSED] fix(ghidra): name buildNatives where release archives omit the decompiler (accidental copy) #7606

Closed
opened 2026-11-03 13:39:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7051
Author: @RishTheFish21
Created: 10/25/2026
Status: ❌ Closed

Base: main ← Head: fix/7018-macos-native-decompiler


📝 Commits (1)

  • 1909817 fix(ghidra): name buildNatives where release archives omit the decompiler

📊 Changes

3 files changed (+84 additions, -7 deletions)

View changed files

📝 docs/installation.md (+13 -5)
📝 src/ghidra/GhidraInstallation.test.ts (+54 -0)
📝 src/ghidra/GhidraInstallation.ts (+17 -2)

📄 Description

Summary

Fixes #7018

On macOS the official Ghidra 12.1.4 archive has no native decompiler. Ghidra's GettingStarted.md lists prebuilt natives only for Linux x64 and Windows x64. REA's installation guide named only Linux ARM64 as needing a separate build. On macOS, the native_decompiler doctor remediation just said "Provide an executable … REA does not build or install native tools", with no hint that the release omits it or how to build it. Both now say so for macOS x64, macOS arm64 and Linux ARM64.

Problem and expected behavior

Trigger: on macOS, extract the official ghidra_12.1.4_PUBLIC archive, point GHIDRA_INSTALL_DIR at it, and run rea doctor --json.

Before (main 76afdd35a):

$ GHIDRA_INSTALL_DIR=/tmp/ghidra-fresh/ghidra_12.1.4_PUBLIC node scripts/rea.mjs doctor --json \
    | jq '.. | objects | select(.name? == "native_decompiler")'
{
  "name": "native_decompiler",
  "ok": false,
  "code": "executable_missing",
  "detail": "Matching native decompiler for darwin/arm64 was not found",
  "remediation": "Provide an executable Ghidra/Features/Decompiler/os/mac_arm_64/decompile, or its build/os equivalent. REA does not build or install native tools.",
  "classification": "config_drift"
}

Expected: the remediation should say that this release omits the executable for the host and how to build it. The installation guide should list every supported host that needs user-built natives.

After:

{
  "name": "native_decompiler",
  "ok": false,
  "code": "executable_missing",
  "detail": "Matching native decompiler for darwin/arm64 was not found",
  "remediation": "Provide an executable Ghidra/Features/Decompiler/os/mac_arm_64/decompile, or its build/os equivalent. Official Ghidra release archives do not include it for this host. Build it with ./gradlew buildNatives (or gradle buildNatives) from the installation's support/gradle directory; REA accepts the resulting build/os executable. REA does not build or install native tools.",
  "classification": "config_drift"
}

Change and scope

  • src/ghidra/GhidraInstallation.ts: a small nativeBuildGuidance(platform, architecture) helper adds one sentence to both native_decompiler remediations (missing, and incompatible header) on darwin x64/arm64 and linux arm64. The sentence says the release omits the executable and to run ./gradlew buildNatives (or gradle buildNatives) from support/gradle, whose build/os output REA already accepts. Linux x64 and Windows x64 text is unchanged. The existing "REA does not build or install native tools" sentence stays.
  • docs/installation.md: the requirements paragraph now names the three hosts and links to Ghidra's 12.1.4 native-component instructions and the existing macOS make recipes. The macOS x64 section says the archive does lack the executable, instead of "may".
  • Not included: no change to the JDK/os.arch remediations, the website, or translated READMEs.

Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope).
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Ghidra installation inspection (nativeDecompilerCheck and assessNativeDecompiler in src/ghidra/GhidraInstallation.ts).
  • Contribution scope fit and linked maintainer decision: Within existing boundaries (diagnostic text and docs). Maintainer decision not applicable.
  • CLI and MCP/tool-catalog contract: rea doctor / doctor remediation text for native_decompiler gains one sentence on three hosts. Check names, codes and pass/fail outcomes are unchanged.
  • Provider, bridge, target-format, or platform compatibility: None. Admission rules are unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: None.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): Not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): Installation docs only. REA still doesn't build or install native tools.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/ghidra/GhidraInstallation.test.ts. A table test over darwin/arm64, darwin/x64, linux/arm64 and linux/x64 with no decompiler present checks that the first three name buildNatives and that linux/x64 doesn't.
  • Base reproduction or other evidence: the official Ghidra 12.2 archive listing in #7018 (decompiler only under linux_x86_64 and win_x86_64), and the doctor output above from a freshly extracted 12.1.4 installation. The platform list comes from GettingStarted.md at Ghidra_12.1.4_build.
  • User-visible CLI/MCP output (if applicable): see Before/After.
  • Remaining proof gaps: only macOS arm64 was run. macOS x64 and Linux ARM64 follow from the Ghidra docs and the same code path. I didn't run buildNatives itself as part of this change.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

macOS arm64, Node 24.22.1:

  • npm run test:focused -- src/ghidra/GhidraInstallation.test.ts: passed, 114 tests, including the 4 new buildNatives cases
  • npm run check:fast: passed (typecheck and lint)
  • npm run format:check: passed
  • npm run docs:check: passed, including readmeConsistency.test.ts (9 tests)
  • rea doctor --json against a freshly extracted official 12.1.4 archive, before and after: shown above

Compatibility, safety, and release

  • Breaking changes or migration steps: None. Text-only change to one remediation on three hosts.
  • Real Hopper/Ghidra, browser, or OS coverage: real Ghidra 12.1.4 archive on macOS arm64.
  • Package or release metadata impact: None.
  • Security, privacy, process, or containment review: No new process or file access.

Author readiness

Human owner: @RishTheFish21

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/7051 **Author:** [@RishTheFish21](https://github.com/RishTheFish21) **Created:** 10/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/7018-macos-native-decompiler` --- ### 📝 Commits (1) - [`1909817`](https://github.com/morluto/rea/commit/19098175c6d346dbcb1f9ab0af9cc494cd03c7a6) fix(ghidra): name buildNatives where release archives omit the decompiler ### 📊 Changes **3 files changed** (+84 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+13 -5) 📝 `src/ghidra/GhidraInstallation.test.ts` (+54 -0) 📝 `src/ghidra/GhidraInstallation.ts` (+17 -2) </details> ### 📄 Description ## Summary Fixes #7018 On macOS the official Ghidra 12.1.4 archive has no native decompiler. Ghidra's `GettingStarted.md` lists prebuilt natives only for Linux x64 and Windows x64. REA's installation guide named only Linux ARM64 as needing a separate build. On macOS, the `native_decompiler` doctor remediation just said "Provide an executable … REA does not build or install native tools", with no hint that the release omits it or how to build it. Both now say so for macOS x64, macOS arm64 and Linux ARM64. ## Problem and expected behavior Trigger: on macOS, extract the official `ghidra_12.1.4_PUBLIC` archive, point `GHIDRA_INSTALL_DIR` at it, and run `rea doctor --json`. Before (main `76afdd35a`): ``` $ GHIDRA_INSTALL_DIR=/tmp/ghidra-fresh/ghidra_12.1.4_PUBLIC node scripts/rea.mjs doctor --json \ | jq '.. | objects | select(.name? == "native_decompiler")' { "name": "native_decompiler", "ok": false, "code": "executable_missing", "detail": "Matching native decompiler for darwin/arm64 was not found", "remediation": "Provide an executable Ghidra/Features/Decompiler/os/mac_arm_64/decompile, or its build/os equivalent. REA does not build or install native tools.", "classification": "config_drift" } ``` Expected: the remediation should say that this release omits the executable for the host and how to build it. The installation guide should list every supported host that needs user-built natives. After: ``` { "name": "native_decompiler", "ok": false, "code": "executable_missing", "detail": "Matching native decompiler for darwin/arm64 was not found", "remediation": "Provide an executable Ghidra/Features/Decompiler/os/mac_arm_64/decompile, or its build/os equivalent. Official Ghidra release archives do not include it for this host. Build it with ./gradlew buildNatives (or gradle buildNatives) from the installation's support/gradle directory; REA accepts the resulting build/os executable. REA does not build or install native tools.", "classification": "config_drift" } ``` ## Change and scope - `src/ghidra/GhidraInstallation.ts`: a small `nativeBuildGuidance(platform, architecture)` helper adds one sentence to both `native_decompiler` remediations (missing, and incompatible header) on darwin x64/arm64 and linux arm64. The sentence says the release omits the executable and to run `./gradlew buildNatives` (or `gradle buildNatives`) from `support/gradle`, whose `build/os` output REA already accepts. Linux x64 and Windows x64 text is unchanged. The existing "REA does not build or install native tools" sentence stays. - `docs/installation.md`: the requirements paragraph now names the three hosts and links to Ghidra's 12.1.4 native-component instructions and the existing macOS make recipes. The macOS x64 section says the archive *does* lack the executable, instead of "may". - Not included: no change to the JDK/os.arch remediations, the website, or translated READMEs. Follow the [[contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope)](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. ## Contract and boundary impact - Semantic owner and earliest changed stage: Ghidra installation inspection (`nativeDecompilerCheck` and `assessNativeDecompiler` in `src/ghidra/GhidraInstallation.ts`). - Contribution scope fit and linked maintainer decision: Within existing boundaries (diagnostic text and docs). Maintainer decision not applicable. - CLI and MCP/tool-catalog contract: `rea doctor` / `doctor` remediation text for `native_decompiler` gains one sentence on three hosts. Check names, codes and pass/fail outcomes are unchanged. - Provider, bridge, target-format, or platform compatibility: None. Admission rules are unchanged. - Evidence, artifact, provenance, or reconstruction contract: None. - Target selection, authority, upstream behavior, and cleanup details (if applicable): Not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): Installation docs only. REA still doesn't build or install native tools. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/ghidra/GhidraInstallation.test.ts`. A table test over darwin/arm64, darwin/x64, linux/arm64 and linux/x64 with no decompiler present checks that the first three name `buildNatives` and that linux/x64 doesn't. - Base reproduction or other evidence: the official Ghidra 12.2 archive listing in #7018 (decompiler only under `linux_x86_64` and `win_x86_64`), and the doctor output above from a freshly extracted 12.1.4 installation. The platform list comes from [`GettingStarted.md` at `Ghidra_12.1.4_build`](https://github.com/NationalSecurityAgency/ghidra/blob/Ghidra_12.1.4_build/GhidraDocs/GettingStarted.md#building-native-components). - User-visible CLI/MCP output (if applicable): see Before/After. - Remaining proof gaps: only macOS arm64 was run. macOS x64 and Linux ARM64 follow from the Ghidra docs and the same code path. I didn't run `buildNatives` itself as part of this change. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed macOS arm64, Node 24.22.1: - `npm run test:focused -- src/ghidra/GhidraInstallation.test.ts`: passed, 114 tests, including the 4 new buildNatives cases - `npm run check:fast`: passed (typecheck and lint) - `npm run format:check`: passed - `npm run docs:check`: passed, including `readmeConsistency.test.ts` (9 tests) - `rea doctor --json` against a freshly extracted official 12.1.4 archive, before and after: shown above ## Compatibility, safety, and release - Breaking changes or migration steps: None. Text-only change to one remediation on three hosts. - Real Hopper/Ghidra, browser, or OS coverage: real Ghidra 12.1.4 archive on macOS arm64. - Package or release metadata impact: None. - Security, privacy, process, or containment review: No new process or file access. ## Author readiness Human owner: @RishTheFish21 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:04 +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#7606
No description provided.