Skip to content

native: make inspect_macho resilient when vtool is unavailable #187

Closed

Description

@morluto

Problem

inspectNativeMacho currently aborts the whole native Mach-O inspection if any command in its fixed command list fails.

The native Mach-O command list is:

  • file -b
  • lipo -detailed_info
  • otool -l
  • nm -gjU
  • dyld_info -imports
  • dyld_info -exports
  • dwarfdump --uuid
  • vtool -show-build

The normalized schema does not require vtool output (src/native/NativeMachoInspection.ts:88-92); vtool is currently only retained as provenance.

If vtool is missing from the resolved xcrun toolchain (for example in partial CLI setups), inspect_macho fails with a capability/adapter error even though the rest of the analysis commands are available.

Evidence

  • Early-return on any command failure: if (!captured.ok) return err(captured.error) in inspectNativeMacho (src/native/NativeMachoInspection.ts:57).
  • vtool result is used only for provenance text, not required schema fields (src/native/NativeMachoInspection.ts:91).

Reproduction

  1. Run native Mach-O inspection on an environment where xcrun --find vtool fails.
  2. Observe inspect_macho fails despite other required tools being present.

Expected

inspect_macho should degrade gracefully when optional tools are unavailable:

  • keep the best-effort Mach-O result from required commands
  • add a limitation explaining that vtool was unavailable
  • include provenance for attempted commands

Impact

This blocks Mach-O inspection on valid environments with partial Xcode toolchains.

Suggested fix

Split Mach-O command execution into required and optional groups. Treat vtool as optional and convert its failure into a non-fatal limitation.

Activity

  1. added
    enhancement
    area: native
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: nativeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions