Skip to content
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

feat: implement node-gyp wrapper for native module compilation #1172

Closed
wants to merge 15 commits into from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Node-gyp Wrapper Implementation

This PR implements a node-gyp wrapper to enable running node-gyp npm commands using Electron's built-in Node runtime, focusing on node-pty compilation.

Changes

  • Added node-gyp wrapper script that uses system Node for npm commands
  • Configured electron-builder to include wrapper script in the build
  • Updated package.json with new build configuration
  • Added proper environment variables and node directory handling

Implementation Details

  • Uses process.execPath to ensure consistent Node binary usage
  • Handles platform-specific paths for Windows/Unix compatibility
  • Provides detailed logging for debugging compilation issues
  • Special handling for node-pty installation and rebuilding

Testing Status

⚠️ Testing is currently blocked by a system configuration issue:

  • Python's distutils module is missing, which is required for node-gyp
  • A fix requires system-level Python configuration changes
  • Once the Python environment is properly configured, we can proceed with testing

Next Steps

  1. Install python3-distutils package (requires system configuration)
  2. Test node-pty compilation
  3. Verify electron-builder integration

Link to Devin run: https://app.devin.ai/sessions/a041e99365054fb2b8eff10bb1a73600

devin-ai-integration bot and others added 15 commits January 30, 2025 01:57
- Add node-gyp wrapper script to use electron's node for npm commands
- Configure electron-builder with CommonJS format (.cjs)
- Add cross-platform support for node binary paths
- Include wrapper script in electron-builder resources

Co-Authored-By: [email protected] <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@Kitenite Kitenite closed this Feb 2, 2025
@Kitenite Kitenite deleted the devin/1738203719-node-gyp-wrapper branch February 4, 2025 09:04
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