Repository navigation
fix(apple): preserve line terminators in dyld path expansion - #5363
Conversation
Signed-off-by: 李永祺 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge. SummaryFixes dyld path expansion by letting the suffix contain line terminators without changing the token grammar.
Reviews (1) · Last reviewed commit: "fix(apple): preserve line terminators in..." · Reviewed by Greptile |
|
Replayed |
|
Thanks for the dyld path fix, @Doribelove, and welcome to REA. Preserving line terminators in |
Summary
Fixes #5362. Expand
@loader_pathand@executable_pathwhen the dependency name or rpath suffix contains a line terminator, preserving the exact path rather than reporting an existing dependency as undetermined.Problem and expected behavior
A synthetic app with
LC_LOAD_DYLIBset to@loader_path/lib\u2028core.dyliband the matching file on disk returns an undetermined resolution. AnLC_RPATHcontaining U+2029 has the same problem. The load-command reader retains both names correctly; the path expander's.*rejects line terminators.Change and scope
Enable dot-all at the existing path-token parser. Keep the exact token/slash grammar, downstream containment checks, rpath ownership, and unknown executable context unchanged. Add domain regressions for LF, CR, CRLF, U+2028 and U+2029 plus lookalike-token controls, and a real-file CLI regression for direct dependencies and rpaths.
This is a routine static-analysis correction within the existing contribution scope; no separate scope decision is required. It does not change the
otoolparser covered by #4979.Contract and boundary impact
expandPrefixinsrc/domain/apple/dyldPaths.ts, before candidate path lookup.Expected product effects:
Evidence and regression coverage
Executed on Ubuntu 22.04.5 x86_64, Node.js 24.18.0 and npm 11.16.0:
58d6043303e722115f1da18b9505c24abeeab423: 6 failed, 105 passed across the domain and CLI files. Failures are resolution assertions.799e8265b254e225dc1dabdd25e56f0ab7f86bd3: 131 passed across the domain, CLI and MCP files.undetermined/nullto the exact existing paths:[ { "install_name": "@loader_path/lib\u2028core.dylib", "resolution": {"status": "resolved", "image": "Contents/MacOS/lib\u2028core.dylib"} }, { "install_name": "@rpath/libsearch.dylib", "resolution": {"status": "resolved", "image": "Contents/MacOS/Libraries\u2029Nested/libsearch.dylib"} } ]Validation performed
npm ci— passed with the pinned toolchain.npm run test:focused -- src/domain/apple/dylibResolution.test.ts tests/boundary/cli/dylibResolutionCli.test.ts tests/boundary/mcp/dylibResolutionMcp.test.ts— 131 passed; required runtime/skill build passed.npm run check— passed: typecheck, lint/module boundaries, formatting, knip, metadata and architecture guards. Lint still reports warnings.npm run verify:test-discovery— all 1,714 test files discovered exactly once.git diff --check— passed.The first static check caught an overlong enclosing test-group callback after adding the cases. Moving the new tests to the existing top-level style resolved it; the final checks above passed.
Compatibility, safety, and release
No API, schema, dependency or release-metadata changes. Synthetic files were read by the built CLI and the production artifact resolver; fixture programs were never executed. This establishes static resolution on Linux. Actual macOS dyld loading, Windows filesystem execution and Hopper/Ghidra were not exercised. The existing MCP boundary suite passed; no live external MCP client was tested.
Author readiness
Human owner: @Doribelove
Before merge