Closed artch closed 4 years ago
Did this work before on an earlier version of Electron or is it possible this has always been broken?
Could you give this diff a shot?
diff --git a/src/isolate/platform_delegate.h b/src/isolate/platform_delegate.h
index d6c2a97..ab031dd 100644
--- a/src/isolate/platform_delegate.h
+++ b/src/isolate/platform_delegate.h
@@ -86,7 +86,7 @@ class PlatformDelegate : public v8::Platform {
PlatformDelegate(v8::Isolate* node_isolate, v8::Platform* node_platform) : node_isolate(node_isolate), node_platform(node_platform) {}
static PlatformDelegate& DelegateInstance() {
- static PlatformDelegate delegate(v8::Isolate::GetCurrent(), v8::internal::V8::GetCurrentPlatform());
+ static PlatformDelegate delegate(v8::Isolate::GetCurrent(), node::GetMainThreadMultiIsolatePlatform());
return delegate;
}
With this diff now there is only one error:
inspector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::unique_ptr<class v8_inspector::V8Inspector,struct std::default_delete<class v8_inspector::V8Inspector> > __cdecl v8_inspector::V8Inspector::create(class v8::Isolate *,class v8_inspector::V8InspectorClient
*)" (__imp_?create@V8Inspector@v8_inspector@@SA?AV?$unique_ptr@VV8Inspector@v8_inspector@@U?$default_delete@VV8Inspector@v8_inspector@@@std@@@std@@PEAVIsolate@v8@@PEAVV8InspectorClient@2@@Z) [C:\Home\screeps\driver\node_modules\isolated-vm\build\isolated_vm.vcxproj]
C:\Home\screeps\driver\node_modules\isolated-vm\build\Release\isolated_vm.node : fatal error LNK1120: 1 unresolved externals [C:\Home\screeps\driver\node_modules\isolated-vm\build\isolated_vm.vcxproj]
The last working version was isolated-vm@1.5.2 with electron@2.0.0-beta.7, but we didn't try to build any intermediates.
Ok I created a new electron
branch for you which removes the inspector support that is bothering electron. I don't have Windows set up at the moment so it's a bit of a guessing game, but I hope that one will work.
That worked, thanks for the super quick response!
Well no. Build worked, but the module doesn't load. This code hangs up and doesn't output anything after loading
:
console.log('loading');
try {
require('isolated-vm');
}
catch(e) {
console.error(e);
}
console.log('loaded');
I took a look at this for a while today and I think it's going to be tough to get this into Electron with the changes that they've made to their build process. I need access to an internal v8 API that they've stripped from their binaries.
There's two options for now:
a) Include a plain node
binary with screeps that runner
will run under.
b) Ship a custom build of Electron with the extra feature reenabled.
I'm also going to reach out the nodejs team on #133 about the issue because I think it's a more general problem than one that just affects isolated-vm.
OK, thanks, we'll have to consider it. Meanwhile, it looks like electron 2.0.18 builds and works well with isolated-vm 1.7.5, so we'll continue shipping it.
We're having issues with building isolated-vm for electron on Windows. We're trying electron 4.x branch since it ships nodejs 10. This is what I get when trying to build isolated-vm 2.0.1 against electron 4.2.12 using MSBuild 2017:
Building with local Node.js 10.16.3 works fine. Building for electron on Linux also works fine.
Note: there is a small unrelated problem with node-gyp 6.0.0 which we had to overcome using this workaround.