8000 fix: use 'target_arch' for node-pre-gyp by samuelmaddock · Pull Request #1115 · electron/rebuild · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: use 'target_arch' for node-pre-gyp #1115

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

Merged
merged 7 commits into from
Dec 4, 2023

Conversation

samuelmaddock
Copy link
Member
@samuelmaddock samuelmaddock commented Nov 18, 2023

The arguments provided to node-pre-gyp are incomplete, resulting in prebuilt binaries not downloading the correct architecture. From the readme, --target_arch and --target_platform are both used for downloading the prebuilt binaries. The --arch option seems to only be used when falling back to the node-gyp local build.

Also, if the binary already exists, --update-binary is required to redownload in the case of changing the targeted architecture.

Follow up to #1095

@samuelmaddock samuelmaddock requested a review from a team as a code owner November 18, 2023 17:52
@codecov-commenter
Copy link
codecov-commenter commented Nov 18, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (0e934ad) 76.78% compared to head (cbd44e4) 77.06%.

Files Patch % Lines
src/module-type/node-pre-gyp.ts 81.81% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1115      +/-   ##
==========================================
+ Coverage   76.78%   77.06%   +0.27%     
==========================================
  Files          21       21              
  Lines         741      763      +22     
  Branches      140      142       +2     
==========================================
+ Hits          569      588      +19     
- Misses        121      122       +1     
- Partials       51       53       +2     

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

@samuelmaddock
Copy link
Member Author

aea4654 will unfortunately cause the binaries to be redownloaded each time a rebuild occurs. node-pre-gyp doesn't update the binary without the --update-binary option even if the architecture changes.

@MarshallOfSound
Copy link
Member

@samuelmaddock is there a way that we can be smarter here for them? E.g. detect a .node file with the wrong arch and nuke it

Not super fussed but would be nice if it's not too hard

@samuelmaddock samuelmaddock changed the title fix: use 'target_arch' for node-pre-gyp [WIP] fix: use 'target_arch' for node-pre-gyp Nov 21, 2023
@MarshallOfSound MarshallOfSound changed the title [WIP] fix: use 'target_arch' for node-pre-gyp fix: use 'target_arch' for node-pre-gyp Dec 4, 2023
@MarshallOfSound MarshallOfSound merged commit 5e6f727 into electron:main Dec 4, 2023
Copy link

🎉 This PR is included in version 3.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants
0