-
Notifications
You must be signed in to change notification settings - Fork 31
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
Solution for running/packaging native modules for Electron #55
Comments
Hi @jondo2010 not sure I'm understanding the problem yet. You're not able to use grpc as a yarn dependency? If you can put together a minimal example repo with grpc/electron to iterate on that would be helpful. I'd like to get this working. |
Maybe grpc/grpc#8887 is related. |
Hi @pcj, awesome that you're keen to support! I put together a minimal example here With the sample output below, you can see that there is a mismatch with the gRPC binary module portion. It needs to be compiled against the correct version of Electron, and this is different than what yarn installs.
|
OK seeing same error. Electron alone seems to work. Uncertain if node version matters. Have you seen this working outside of bazel? (probably using electron-rebuild) |
OK I think I have this working. Here's what the yarn_modules(
name = "yarn_modules",
deps = {
"electron": "1.8.2-beta.4",
"electron-rebuild": "1.7.3",
"grpc": "^1.8.4"
},
post_install = ["{node}", "node_modules/electron-rebuild/lib/src/cli.js"],
)
Also, electron-rebuild pulls in rxjs, to which @gregmagolan added a I'll push up a PR, let me know what you think. |
If you just reference the rxjs directory as a workspace, it may resolve the issue since Bazel will no longer descend into the directory. But we'll also maybe run into incompatibility between the node just rules... |
Thanks @alexeagle that is a good point. |
Awesome, this totally works! Thanks for the quick turnaround. I've discovered a few other small gotchas with |
While attempting to integrate my Electron app using
rules_node
, I've run into a roadblock with dependent modules that have a native build portion, in particulargrpc
.At first I thought I could patch the call to
yarn
with some flag telling it to "build/install for Electron", which would result in ayarn_modules
repository specifically built for Electron, but it seems this is not possible.Do you have any ideas about how this could be implemented?
The text was updated successfully, but these errors were encountered: