Wave icon indicating copy to clipboard operation
Wave copied to clipboard

Resolve transitive Mach-O executable_path dependencies from the root executable

Open LunaStev opened this issue 3 weeks ago • 0 comments

Problem

The resolver treats @executable_path and @loader_path identically, using the current dependency file parent. For a transitive dylib this searches relative to the dylib rather than the package executable.

Reproduction and evidence

Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.

Built a real x86_64 Mach-O b.dylib at app/plugins/b.dylib using clang/ld64.lld. Execute the unchanged library_directories/resolve_library functions in a focused projection with source=app/lib/a.dylib and dependency=@executable_path/plugins/b.dylib. The binary inspector accepts b.dylib, but the resolver reports it unresolved because it looks under app/lib/plugins. The intended executable position is app/program, so its executable-relative base would be app/. Only b.dylib was built for this resolver projection; no root executable or transitive a.dylib was linked or run. This is resolver/artifact evidence, not macOS execution.

Scope

Carry executable-root context independently of each loader directory throughout transitive resolution, including rpath expansion.

Starting points: tools/src/package.rs:374.

Completion criteria

  • [ ] A transitive executable-relative dependency resolves from the root executable.
  • [ ] loader_path remains relative to the current loader; rpath chains retain order/context.
  • [ ] Native macOS package execution remains a distinct validation step.

Related: #1070. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.

LunaStev avatar Nov 12 '26 12:11 LunaStev