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

fix: require node-gyp@^8.4.0 & handle old Electron versions #907

Merged
merged 7 commits into from
Nov 10, 2021
Merged

fix: require node-gyp@^8.4.0 & handle old Electron versions #907

merged 7 commits into from
Nov 10, 2021

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Nov 8, 2021

Since node-gyp >= 8.4.0, building modules for old versions of Electron requires passing --force-process-config due to them lacking a valid config.gypi in their headers.

See also nodejs/node-gyp#2497.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2021

Codecov Report

Merging #907 (956b51c) into master (e3754a5) will increase coverage by 0.25%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #907      +/-   ##
==========================================
+ Coverage   76.13%   76.38%   +0.25%     
==========================================
  Files          19       19              
  Lines         683      686       +3     
  Branches      130      131       +1     
==========================================
+ Hits          520      524       +4     
  Misses        118      118              
+ Partials       45       44       -1     
Impacted Files Coverage Δ
src/module-type/node-gyp.ts 84.61% <100.00%> (+0.61%) ⬆️
src/rebuild.ts 72.52% <0.00%> (+1.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3754a5...956b51c. Read the comment docs.

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

Can we start adding tests for src/module-type/node-gyp.ts? You'd be adding test/module-type-node-gyp.ts and testing when --force-process-config is added to the args.

@malept malept changed the title fix: latest node-gyp with old Electron versions fix: update to node-gyp 8.4.0 & handle old Electron versions Nov 8, 2021
@malept malept changed the title fix: update to node-gyp 8.4.0 & handle old Electron versions fix: require node-gyp@^8.4.0 & handle old Electron versions Nov 8, 2021
Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

Going to actually block on the testing request.

@zcbenz
Copy link
Member Author

zcbenz commented Nov 8, 2021

I have updated the code to add tests.

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

I've refactored the tests so that they should test all of the corner cases (and sped them up). But I have an implementation question which could potentially make this a bit easier to maintain.

src/module-type/node-gyp.ts Outdated Show resolved Hide resolved
@malept malept requested a review from a team November 8, 2021 19:47
@malept malept merged commit 9d64870 into electron:master Nov 10, 2021
@electron-bot
Copy link

🎉 This PR is included in version 3.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

dfunckt added a commit to balena-io/etcher that referenced this pull request Jan 23, 2023
The Electron version we’re currently using is on Node 13 (?) but this is a step forward to upgrading to a newer Electron and Node version.

Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios.

Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code.

The crucial changes that enable support are:

1. The update to etcher-sdk@8 where some dependency fixes and updates took place
2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913

Change-type: minor
dfunckt added a commit to balena-io/etcher that referenced this pull request Jan 23, 2023
The Electron version we’re currently using is on Node 13 (?) but this is a step forward to upgrading to a newer Electron and Node version.

Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios.

Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code.

The crucial changes that enable support are:

1. The update to etcher-sdk@8 where some dependency fixes and updates took place
2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913
3. A rule in webpack.config to ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used by etcher-sdk and does a runtime check to its availability. We’re not currently using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that it’s not found, so force webpack to ignore the import. See aws/aws-sdk-js-v3#3025

Change-type: minor
dfunckt added a commit to balena-io/etcher that referenced this pull request Jan 27, 2023
The Electron version we’re currently using is on Node 13 (?) but this is a step forward to upgrading to a newer Electron and Node version.

Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios.

Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code.

The crucial changes that enable support are:

1. The update to etcher-sdk@8 where some dependency fixes and updates took place
2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913
3. A rule in webpack.config to ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used by etcher-sdk and does a runtime check to its availability. We’re not currently using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that it’s not found, so force webpack to ignore the import. See aws/aws-sdk-js-v3#3025

Change-type: minor
dfunckt added a commit to balena-io/etcher that referenced this pull request Jan 27, 2023
The Electron version we’re currently using is on Node 14 but this is a step forward to upgrading to a newer Electron and Node version.

Updates etcher-sdk and switches the redundant aws4-axios dependency to just axios.

Also changed bundler to stop trying to bundle wasm files — they must be included inline with JS code as data — and removed some now redundant code.

The crucial changes that enable support are:

1. The update to etcher-sdk@8 where some dependency fixes and updates took place
2. The downgrade and pinning of "electron-rebuild" to v3.2.3 until we’re able to update to Electron >= 14.2. The patch we need to avoid is electron/rebuild#907. Also see: nodejs/node-gyp#2673 and electron/rebuild#913
3. A rule in webpack.config to ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used by etcher-sdk and does a runtime check to its availability. We’re not currently using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that it’s not found, so force webpack to ignore the import. See aws/aws-sdk-js-v3#3025

Change-type: minor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants