fix(server): skip Linux libc detection on Windows/macOS - #5354
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 8475e3c Straightforward bug fix that conditionally skips Linux-specific libc detection on non-Linux platforms. The change is safe since You can customize Macroscope's approvability policy. Learn more. |
What Changed
Only detect the host Linux libc when the server is actually running on Linux.
Tried to keep the actual change as minimal as possible. Apologies if the unit test is slop, I am not a ts developer.
Why
The resource-monitor binary resolver unconditionally evaluated
ResourceMonitorHostLinuxLibc. Its default implementation callsprocess.report.getReport(), even though the result is ignored when selecting a non-Linux resource-monitor binary.On my Windows ARM64 machine (I built ARM64 from source), this unused call took approximately 154.4 seconds, which exceeded the 60 second backend readiness check timeout and resulted in the gui never showing. After the fix the app started quickly.
Checklist
Note
Low Risk
Small, platform-gated change in binary resolution; Linux libc behavior is unchanged when
platform === "linux".Overview
Fixes slow or failed server startup on Windows (and macOS) by not running Linux libc detection when resolving the resource-monitor binary on non-Linux hosts.
ResourceMonitorBinary.make()now only evaluatesResourceMonitorHostLinuxLibcwhenplatform === "linux". Previously it always ran the default detector, which callsprocess.report.getReport()—unnecessary for Windows/macOS binary selection and reportedly very slow on Windows ARM64 (e.g. exceeding readiness timeouts).resourceMonitorRustTargetnow accepts an optionallinuxLibcfor that path.A new test stubs
process.report.getReportto throw on a mockedwin32host and asserts it is never called while override resolution still succeeds.Reviewed by Cursor Bugbot for commit 8475e3c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Skip Linux libc detection on Windows and macOS in
ResourceMonitorBinaryOn non-Linux platforms,
resourceTelemetry.resourceMonitorBinary.makeno longer attempts to obtainResourceMonitorHostLinuxLibc. ThelinuxLibcparameter inresourceMonitorRustTargetis now optional, and is only populated whenplatform === "linux".Macroscope summarized 8475e3c.