Skip to content

Conversation

@Jobians
Copy link
Contributor

@Jobians Jobians commented Sep 24, 2025

On Termux/Android, report.getReport() crashes because CPU information is not available in the environment, causing the native Rollup loader to throw Failed to get cpu info.

This change wraps calls to report.getReport() in try/catch:

  • isMusl() now returns false if report information is unavailable, allowing Rollup to continue loading native bindings.
  • Windows MINGW detection (isMingw32()) is also safely wrapped.

These changes are non-breaking and maintain existing behavior on supported platforms. They ensure Rollup can run on Termux/Android without crashing while preserving all existing bindings and error handling.

No other logic is modified; this strictly improves environment robustness.

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

On Termux/Android, `report.getReport()` crashes because CPU information
is not available in the environment, causing the native Rollup loader
to throw `Failed to get cpu info`.

This change wraps calls to `report.getReport()` in try/catch:

- `isMusl()` now returns `false` if report information is unavailable,
  allowing Rollup to continue loading native bindings.
- Windows MINGW detection (`isMingw32()`) is also safely wrapped.

These changes are non-breaking and maintain existing behavior on
supported platforms. They ensure Rollup can run on Termux/Android
without crashing while preserving all existing bindings and error
handling.

No other logic is modified; this strictly improves environment
robustness.
@vercel
Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rollup Ready Ready Preview Comment Sep 27, 2025 6:42am

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Thanks! Just minor comments, but this sounds like a good improvement.

@codecov
Copy link

codecov bot commented Sep 27, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.72%. Comparing base (7340c45) to head (3dac57c).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
native.js 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6123      +/-   ##
==========================================
- Coverage   98.73%   98.72%   -0.02%     
==========================================
  Files         271      271              
  Lines       10630    10637       +7     
  Branches     2846     2846              
==========================================
+ Hits        10496    10501       +5     
- Misses         89       91       +2     
  Partials       45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert lukastaegert merged commit 4362862 into rollup:master Sep 27, 2025
42 checks passed
@github-actions
Copy link

This PR has been released as part of [email protected]. You can test it via npm install rollup.

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.

Latest update broke Bun

2 participants