-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Rebuilding native modules #756
Comments
❤️ the experience here, thank you for shaving off so many edges to make developer experience wonderful! |
Looks like we can always run the rebuild directly (even scripting it like we do to match the Electron version in our |
I would also like to have an equivalent to |
electron-builder can't support yarn without a rebuild command that respects the architecture set in the environment. Does |
Clarification to @ConorIA question: electron-builder set |
|
@rgbkrk It seems you can just use
So, I guess, this issue can be closed (of course, no doubt, I don't recommend in any case use it for electron project – it is way to nowhere — some tool (e.g. electron-builder or electron-rebuild (if for some reasons you cannot use electron-builder ;))) should be used). |
Awesome, thanks @develar! |
Due to #1749 yarn will be still not supported by electron-builder (probably I will send PR to fix it). |
Issue on electron-builder side — electron-userland/electron-builder#861 |
As @Blaccexican and @develar mentioned, the docs now mention that |
@busches Strictly speaking, it is not equivalent. yarn does it more slowly and touch more than need. Maybe I am wrong, but it is what I saw several weeks ago. electron-builder currently uses another approach in case of yarn to rebuild. But in general case — yes, I suggest to close issue since it is more electron issue then yarn (i.e. you should not in any case use it to rebuild native deps for electron). |
|
Since my needs are addressed in Electron, the issue for me is closed. However, it still stands as @gaelduplessix points out that you can't rebuild using yarn (without doing the full thing). |
I agree with @gaelduplessix : rebuilding deps in a docker-build scenario is a use case that's probably quite common. Having the real |
|
Note: |
@aj0strow yeah no kidding :) |
How would yarn know which Node runtime version a dependency tree has been installed & built with? |
@williamboman put it at the top of
|
How would it know when a dependency requires a rebuild? I don't think a diff on the major version number of the Node runtime necessarily requires a rebuild. Also, would that require every developer installing dependencies to run the exact same Node version? |
@williamboman on a team of just me. You're right it doesn't belong in How often do you update node? I do maybe 2-3 times a year. Considering how infrequent, auto detecting likely has diminishing returns. If detecting is important, it would be ideal to introspect the binaries instead of writing a node version file (have to explain not to check it in to git). I'm not familiar with native extensions (gyp?) but yarn seems to know when they are absent, so maybe there's a way to detect if out of sync with node version. |
This is a solved problem;
I update Node wherever a new minor/patch release comes out. Sometimes twice in a week. Different people have different needs, rebuilds should happen only when |
We have some discussion with @BYK about it in Discord: Expand mevkrol
byk
vkrol
byk
vkrol
byk
|
**Summary** Fixes #756. We have multiple versions of our app and each one uses a different version of node. Therefore we need to rebuild our `node-sass` module every time we move from one to another. This PR addresses that by saving the NODE version those artifacts were built with within the `.yarn-integrity` file and triggers forced scripts install (only if the node version is different ofc). **Test plan** ``` 1. Install Node.js 7.x 2. Add the node-sass dependency to the project via Yarn 3. Update Node.js to 8.x (new NODE_VERSION) 4. Run "yarn install" (you should see yarn downloading fresh scripts/binaries) ```
…kg#4750) **Summary** Fixes yarnpkg#756. We have multiple versions of our app and each one uses a different version of node. Therefore we need to rebuild our `node-sass` module every time we move from one to another. This PR addresses that by saving the NODE version those artifacts were built with within the `.yarn-integrity` file and triggers forced scripts install (only if the node version is different ofc). **Test plan** ``` 1. Install Node.js 7.x 2. Add the node-sass dependency to the project via Yarn 3. Update Node.js to 8.x (new NODE_VERSION) 4. Run "yarn install" (you should see yarn downloading fresh scripts/binaries) ```
Would |
The problem with |
Is the workaround here til #5271 is implemented, to run |
Do you want to request a feature or report a bug?
Feature!
What is the current behavior?
https://yarnpkg.com/en/docs/migrating-from-npm does not list a way to rebuild.
What is the expected behavior?
We (in nteract) end up needing to rebuild one native module, zeromq. Normally we run this:
Our use case is specifically with Electron; I'm guessing there are others that use
npm rebuild
.Please mention your node.js, yarn and operating system version.
OS X 10.11.6
/cc @jdetle @captainsafia @lgeiger
The text was updated successfully, but these errors were encountered: