-
Notifications
You must be signed in to change notification settings - Fork 175
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: add node-pre-gyp support #1095
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1095 +/- ##
==========================================
- Coverage 76.01% 73.00% -3.02%
==========================================
Files 20 21 +1
Lines 688 726 +38
Branches 129 136 +7
==========================================
+ Hits 523 530 +7
- Misses 118 146 +28
- Partials 47 50 +3
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
src/cli.ts
Outdated
@@ -128,6 +128,7 @@ process.on('unhandledRejection', handler); | |||
useElectronClang: !!argv.useElectronClang, | |||
disablePreGypCopy: !!argv.disablePreGypCopy, | |||
projectRootPath, | |||
skipPrebuilds: !!argv.skipPrebuilds, |
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.
Does this new option also impact prebuild
or just node-pre-gyp
?
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.
It also appears to have a buildFromSource
behavior rather than "skipping" the module entirely
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.
renamed prebuild
-> buildFromSource
@samuelmaddock, you can rebase this on |
a83c50f
to
fd708a0
Compare
Co-authored-by: Keeley Hammond <[email protected]>
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.
The code changes look good to me
@@ -35,7 +35,7 @@ export async function resetTestModule(testModulePath: string, installModules = t | |||
} | |||
|
|||
export async function cleanupTestModule(testModulePath: string): Promise<void> { | |||
await fs.remove(testModulePath); | |||
await fs.rmdir(testModulePath, { recursive: true, maxRetries: 10 }); |
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.
?
it('should not fail running prebuild-install', async () => { | ||
it('should not fail running prebuild-install', async function () { | ||
if (process.platform === 'darwin' && process.arch === 'arm64') { | ||
this.skip(); // farmhash module has no prebuilt binaries for ARM64 |
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.
this.skip(); // farmhash module has no prebuilt binaries for ARM64 | |
this.skip(); // farmhash module has no prebuilt binaries for ARM64 | |
return; |
This reverts commit e71316b.
o shoot, I merged before sam's comments loaded :PPP I'll make a new pr to address these |
🎉 This PR is included in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@mapbox/node-pre-gyp is a popular choice for serving prebuilt native node module binaries. These changes add support for downloading prebuilt binaries using it as well as rebuilding in the case that no prebuilt binaries are found.
A
skipPrebuilds
option was added to give tests the ability to force rebuilds without using any prebuilt binary modules.node-sqlite3 is used to test for node-pre-gyp support.
resolves #367