-
Notifications
You must be signed in to change notification settings - Fork 5
use portable if cpu-feature build fails #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR makes the cpu-features package an optional dependency to improve compatibility with systems that lack native build tools (particularly Windows). The changes allow the CLI to gracefully fall back to portable CKB binaries when CPU feature detection is unavailable.
Key Changes
- Moved
cpu-featuresfrom a regular dependency to an optional dependency - Implemented graceful fallback using dynamic
require()with try-catch error handling - Added documentation for Windows users about potential installation issues
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/node/install.ts | Replaced static import with dynamic require() wrapped in try-catch; falls back to portable binary if cpu-features unavailable |
| package.json | Moved cpu-features to optionalDependencies; removed from onlyBuiltDependencies and removed @types/cpu-features from devDependencies |
| pnpm-lock.yaml | Updated lockfile to reflect cpu-features and its dependencies (buildcheck, nan) as optional |
| README.md | Added note for Windows users about optional native module compilation and performance trade-offs |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Initial plan * Apply review suggestions: add error logging and memoize isPortable Co-authored-by: RetricSu <23436060+RetricSu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: RetricSu <23436060+RetricSu@users.noreply.github.com>
No description provided.