Repository navigation
fix(orcad): name a missing shared library when the pinned Node runtime can't start - #29829
Conversation
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c2a4797d-92b8-433f-a9d7-e2cf043392c1
📒 Files selected for processing: 3
src/main/orcad/native-host-abi.tssrc/main/ssh/orcad-remote-node-runtime-report.test.tssrc/main/ssh/orcad-remote-node-runtime-report.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
| return elf[1] | ||
| } | ||
| // musl's loader (Alpine) words it differently. | ||
| const musl = loaderError.match(/Error loading shared library ([\w.+-]+\.so[\w.]*)/) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Limit missing-library detection to missing-file errors.
If musl reports Error loading shared library libz.so.1: Exec format error, this regex returns libz.so.1. RemoteNodeRuntimeSelfTestError then says the host is missing the library and recommends installing its package. The library may already be present but incompatible. Match the missing-file reason before returning the name; otherwise retain the generic failure message. Musl can emit this loading-error format for an executable-format error. (android.googlesource.com)
…y code into src/main/managed-server/install/ (#30335) orcad-remote-*, remote-install-*, remote-node-runtime-store-*, remote-versioned-install and remote-deploy-timing leave src/main/ssh. git mv plus import and path-literal rewrites; one e2e route regex learns the new folder. orcad-remote-deploy and orcad-remote-node-runtime-report stay for now because open PRs #29834 and #29829 edit them.
3e39899 to
1b62806
Compare
…e can't start A host without libstdc++ (Alpine's default) failed with the loader's raw output. The self-test error now names the library and how to install it, and the missing-library parser also reads musl's loader wording, which node-pty's diagnosis uses too. Co-Authored-By: Claude <[email protected]>
1b62806 to
253f4f5
Compare
Summary
When Orca's pinned Node runtime can't start on a host because a shared library is missing (Alpine ships without
libstdc++by default), adding the host failed with the loader's raw output. Now the error names the missing library and how to install it. Applies to SSH-managed hosts and the WSL host, which share this self-test.Before / after
Before:
The pinned Node runtime did not run on the host (exit 127): Error loading shared library libstdc++.so.6: No such file or directory (needed by …/node).After:
The host is missing libstdc++.so.6, which Orca's Node runtime needs. Install it (Alpine: apk add libstdc++; Debian/Ubuntu: apt install libstdc++6; Fedora: dnf install libstdc++). Then reconnect. (exit 127: <the loader's own output>). Any other missing library says "Install the package that provides it." Failures that name no library keep the old wording.Mechanism
RemoteNodeRuntimeSelfTestErrorruns the self-test output throughparseMissingSharedLibraryand, when it names a library, leads with the plain message and keeps the raw output in parentheses for diagnosis.parseMissingSharedLibrary(also used by the node-pty loader diagnosis) now recognizes musl's wording,Error loading shared library <lib>, in addition to glibc's<lib>: cannot open shared object file. On a musl host whose node-pty can't load, that diagnosis now names the library too.Why this approach
The error class is already what every caller surfaces; changing its message fixes SSH and WSL in one place. No code parses the old message text (classification uses the error class).
Testing
src/main/ssh/orcad-remote-node-runtime-report.test.ts: glibc and musl loader wording, the generic fallback, and a non-libstdc++ library.