Skip to content

fix(orcad): name a missing shared library when the pinned Node runtime can't start - #29829

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-host-refusal-messages
Oct 22, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-host-refusal-messages

Conversation

@nwparker

@nwparker nwparker commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​63 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​63
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​18

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

  • RemoteNodeRuntimeSelfTestError runs the self-test output through parseMissingSharedLibrary and, 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.
  • Nothing moves on failure: the add is refused and the project stays where it is (on the bridge for WSL). WSL 1 and an old glibc already had plain refusals.

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

  • New src/main/ssh/orcad-remote-node-runtime-report.test.ts: glibc and musl loader wording, the generic fallback, and a non-libstdc++ library.
  • The existing native-host-abi, node-pty loader diagnosis and answered-failure tests pass (63 tests across 5 files). Typecheck is clean for the changed files.
  • Compatibility evidence: in the WSL lane sweep, Alpine 3.20 without libstdc++ is refused at this self-test, and with libstdc++ installed it passes the full bring-up.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

The native-host ABI parser now recognizes musl loader errors and extracts the missing library name. Remote runtime self-test errors use detected library names to provide installation guidance, including distribution-specific commands for libstdc++. Tests cover glibc and Alpine errors, an unnamed library, and guidance for another missing library.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 3e398

In rare cases the error message could tell users to install a library that is already present. The add is still refused as intended, so the impact is limited to misleading guidance. This can be fixed in a small follow-up.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description gives a clear summary, before-and-after behavior, mechanism, rationale, and testing details. However, it omits the required Linked Issue, Visual Proof or explicit N/A, AI Disclosure, R… Add the required template sections and complete them. Include a linked issue, state N/A with a reason for visual proof, complete the testing and checklist items, and address AI disclosure, review, upstream-boundary, and compatibility notes.
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: naming a missing shared library when the pinned Node runtime cannot start.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description gives a clear summary, before-and-after behavior, mechanism, rationale, and testing details. However, it omits the required Linked Issue, Visual Proof or explicit N/A, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Add the required template sections and complete them. Include a linked issue, state N/A with a reason for visual proof, complete the testing and checklist items, and address AI disclosure, review, upstream-boundary, and compatibility notes.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2a4797d-92b8-433f-a9d7-e2cf043392c1
📥 Commits

Reviewing files that changed from the base of the PR and between 37beafd and 3e39899.

📒 Files selected for processing: 3
  • src/main/orcad/native-host-abi.ts
  • src/main/ssh/orcad-remote-node-runtime-report.test.ts
  • src/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.]*)/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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)

nwparker added a commit that referenced this pull request Oct 18, 2026
…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.
@nwparker
nwparker force-pushed the nwparker/wsl-host-refusal-messages branch from 3e39899 to 1b62806 Compare October 20, 2026 21:46
…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]>
@nwparker
nwparker force-pushed the nwparker/wsl-host-refusal-messages branch from 1b62806 to 253f4f5 Compare October 22, 2026 09:25
@nwparker
nwparker merged commit c8d0f99 into main Oct 22, 2026
65 checks passed
@nwparker
nwparker deleted the nwparker/wsl-host-refusal-messages branch October 22, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant