Open brianjenkins94 opened 4 years ago
I found a way to get more information:
$ node-gyp configure build && node -e "process.env.COREHOST_TRACE = 1; process.env.EDGE_USE_CORECLR = '1'; require('./lib/edge.js').func('async (input) => { return input.ToString(); }')"
Most Relevant Bit:
-- Listing probe configurations...
probe_config_t: probe=[/Users/bjenks/.nuget/packages] match-hash=[1] patch-roll-forward=[0] prerelease-roll-forward=[0] deps-json=[0x0]
probe_config_t: probe=[/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0] match-hash=[0] patch-roll-forward=[0] prerelease-roll-forward=[0] deps-json=[0x104a3a550]
Adding tpa entry: /Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/bootstrap/bin/Release/netcoreapp3.1/bootstrap.dll
Processing TPA for deps entry [Microsoft.CodeAnalysis.CSharp.Workspaces, 3.4.0, lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll]
Considering entry [Microsoft.CodeAnalysis.CSharp.Workspaces/3.4.0/lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll] and probe dir [/Users/bjenks/.nuget/packages]
The file hash [eEGy3aupnjYWvdNDLqMyM7/b755t7cejBgRB0XF1rg2LIBtTmZHlxDOdT2ebMovyelM9k2z1XUlCgiZIR177ZQ==][88] did not match entry hash [ReUtqcb+Pz1jtnVZTfDZl1uPV0mrngVA2U+pzxJ7MtrFM1rjlCU2KxuXs8VaOXUteYYAlAn1ZhMYlE3P8j2hIg==][88]
Skipping... match hash failed
Considering entry [Microsoft.CodeAnalysis.CSharp.Workspaces/3.4.0/lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll] and probe dir [/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0]
Skipping... probe in deps json failed
Local path query did not exist /Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/bootstrap/bin/Release/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll
Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.CodeAnalysis.CSharp.Workspaces', version: '3.4.0', path: 'lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll'
Based off of this I've added a publish step.
$ cd lib/bootstrap \
&& dotnet publish --configuration Release --framework netcoreapp3.1 --output bin/Release/netcoreapp3.1 --self-contained \
&& cd ../.. \
&& node-gyp configure build \
&& node -e "process.env.EDGE_USE_CORECLR = '1'; require('./lib/edge.js').func('async (input) => { return input.ToString(); }')"
Output:
Load edge native library from: /Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/build/Release/edge_coreclr
/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145
return edge.initializeClrFunc(options);
^
/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145
return edge.initializeClrFunc(options);
^
Error: Unable to resolve reference to System.Runtime.
at Object.exports.func (/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145:17)
at [eval]:1:63
at Script.runInThisContext (vm.js:116:20)
at Object.runInThisContext (vm.js:306:38)
at Object.<anonymous> ([eval]-wrapper:9:26)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at evalScript (internal/process/execution.js:80:25)
at internal/main/eval_string.js:23:3 {
TargetSite: {
...
},
StackTrace: ' at EdgeCompiler.TryCompile(String source, List`1 references, IDictionary`2 compileAssemblies, String& errors, Assembly& assembly) in /Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/src/double/Edge.js.CSharp/EdgeCompiler.cs:line 230\n' +
' at EdgeCompiler.CompileFunc(IDictionary`2 parameters, IDictionary`2 compileAssemblies)',
Message: 'Unable to resolve reference to System.Runtime.',
Data: {},
InnerException: null,
HelpLink: null,
Source: 'Edge.js.CSharp',
HResult: -2146233088,
Name: 'System.Exception',
message: 'Unable to resolve reference to System.Runtime.',
name: 'System.Exception',
stack: '/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145\n' +
' return edge.initializeClrFunc(options);\n' +
' ^\n' +
'\n' +
'Error: Unable to resolve reference to System.Runtime.\n' +
' at Object.exports.func (/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145:17)\n' +
' at [eval]:1:63\n' +
' at Script.runInThisContext (vm.js:116:20)\n' +
' at Object.runInThisContext (vm.js:306:38)\n' +
' at Object.<anonymous> ([eval]-wrapper:9:26)\n' +
' at Module._compile (internal/modules/cjs/loader.js:956:30)\n' +
' at evalScript (internal/process/execution.js:80:25)\n' +
' at internal/main/eval_string.js:23:3'
}
Unable to resolve reference to System.Runtime
?
Why am I having so many dependency issues?
The problem is somewhere around here:
edge-js/src/double/Edge.js/dotnetcore/coreclrembedding.cs
Since adding System.Runtime
as a dependency didn't fix the issue.
I added these assemblies to Edge.js.csproj
but no change.
The only assemblies that I get from compileAssemblies
are:
Microsoft.CodeAnalysis.Common
Microsoft.CodeAnalysis.CSharp
Microsoft.CodeAnalysis.CSharp.Workspaces
Microsoft.CodeAnalysis.VisualBasic
Microsoft.CodeAnalysis.VisualBasic.Workspaces
Microsoft.CodeAnalysis.Workspaces.Common
Microsoft.DotNet.InternalAbstractions
Microsoft.Extensions.DependencyModel
System.Composition.AttributedModel
System.Composition.Convention
System.Composition.Hosting
System.Composition.Runtime
System.Composition.TypedParts
System.Text.Json
System.Xml.XPath.XmlDocument
bootstrap
Microsoft.CodeAnalysis
Microsoft.CodeAnalysis.Workspaces
Edge.js
EdgeJs
Edge.js.CSharp
Weirdly I can't seem to influence that collection.
The issue may be originating from C++ land.
Lots of libraries look like they're being skipped here:
Dissecting the entires for System.Runtime
(did not load):
Processing TPA for deps entry
[runtime.osx-x64.Microsoft.NETCore.App, 3.1.0-rtm.19565.2, runtimes/osx-x64/lib/netcoreapp3.1/System.Runtime.dll]
Considering entry
[runtime.osx-x64.Microsoft.NETCore.App/3.1.0-rtm.19565.2/runtimes/osx-x64/lib/netcoreapp3.1/System.Runtime.dll]
and probe dir
[/Users/bjenks/.nuget/packages]
-The hash file is invalid
-[/Users/bjenks/.nuget/packages/runtime.osx-x64.Microsoft.NETCore.App/3.1.0-rtm.19565.2/runtime.osx-x64.Microsoft.NETCore.App.3.1.0-rtm.19565.2.nupkg.sha512]
-Skipping... match hash failed
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Considering entry
[runtime.osx-x64.Microsoft.NETCore.App/3.1.0-rtm.19565.2/runtimes/osx-x64/lib/netcoreapp3.1/System.Runtime.dll]
-and probe dir
-[/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0]
Local path query exists
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Runtime.dll
Probed deps json and matched
[/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Runtime.dll]
Adding tpa entry:
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Runtime.dll
and Microsoft.CodeAnalysis.Workspaces
(loaded):
Processing TPA for deps entry
[Microsoft.CodeAnalysis.Workspaces.Common, 3.4.0, lib/netstandard2.0/Microsoft.CodeAnalysis.Workspaces.dll]
Considering entry
[Microsoft.CodeAnalysis.Workspaces.Common/3.4.0/lib/netstandard2.0/Microsoft.CodeAnalysis.Workspaces.dll]
and probe dir
[/Users/bjenks/.nuget/packages]
-The file hash
-[BnE/sgDNtxSaCxbwfUglgyUqNiGUHrH/iJ5s6WC62gqpNYUWthdbvkOPml+2Kyit3ZhW7nvQBX8wvG5JCFK7BQ==][88]
-did not match entry hash
-[AJszIKY+hXBXDqbcYTiztAQ17GTYfSMDB5u2plzJQqwKN17bqYKr1aC/1NkI5Oho9tixVJ0T/SoeYHpDUMsIBA==][88]
-Skipping... match hash failed
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Considering entry
[Microsoft.CodeAnalysis.Workspaces.Common/3.4.0/lib/netstandard2.0/Microsoft.CodeAnalysis.Workspaces.dll]
-and probe dir
-[/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0]
-Skipping... probe in deps json failed
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Local path query exists
/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/bootstrap/bin/Release/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll
Adding tpa entry:
/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/bootstrap/bin/Release/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll
Well, I'm out of ideas.
@agracio or @tjanczuk any chance I could bother either of you for a consult?
I can't tell if it's an issue with CoreCLREmbedding
's dependency resolution or with .NET Core but I can't seem to dynamically reference anything.
I'm quite stuck on this:
StackTrace: ' at EdgeCompiler.TryCompile(String source, List`1 references, IDictionary`2 compileAssemblies, String& errors, Assembly& assembly) in /Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/src/double/Edge.js.CSharp/EdgeCompiler.cs:line 230\n' +
' at EdgeCompiler.CompileFunc(IDictionary`2 parameters, IDictionary`2 compileAssemblies)',
Message: 'Unable to resolve reference to System.Runtime.',
Data: {},
InnerException: null,
HelpLink: null,
Source: 'Edge.js.CSharp',
HResult: -2146233088,
Name: 'System.Exception',
message: 'Unable to resolve reference to System.Runtime.',
name: 'System.Exception',
stack: '/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145\n' +
' return edge.initializeClrFunc(options);\n' +
' ^\n' +
'\n' +
'Error: Unable to resolve reference to System.Runtime.\n' +
' at Object.exports.func (/Users/bjenks/Developer/node-native-addon-experiments/edge/edge-js/lib/edge.js:145:17)\n' +
' at [eval]:1:63\n' +
' at Script.runInThisContext (vm.js:116:20)\n' +
' at Object.runInThisContext (vm.js:306:38)\n' +
' at Object.<anonymous> ([eval]-wrapper:9:26)\n' +
' at Module._compile (internal/modules/cjs/loader.js:956:30)\n' +
' at evalScript (internal/process/execution.js:80:25)\n' +
' at internal/main/eval_string.js:23:3'
Here's my working copy: edge-js.zip
But I wouldn't expect it to work on Windows.
@brianjenkins94 was this issue ever resolved?
I think @corylulu tracked it down to a case-sensitivity issue in one of the other issues I reported:
https://github.com/agracio/edge-js/issues/96#issuecomment-639995596
I haven't tried it though.
So I'm working this issue https://github.com/agracio/edge-js/issues/96#issuecomment-568206718 (relevant bits included below) but my resultant binary from
node-gyp
can't seem to locateMicrosoft.CodeAnalysis.CSharp.Workspaces.dll
even though it's plainly there on disk right alongside all of my othernuget
-retrieved packages:I even swapped out the relative reference for an absolute one and it's pointed right at it but it still can't seem to find it.
``` .NET Core SDK (reflecting any global.json): Version: 3.1.100 Commit: cd82f021f4 Runtime Environment: OS Name: Mac OS X OS Version: 10.15 OS Platform: Darwin RID: osx.10.15-x64 Base Path: /usr/local/share/dotnet/sdk/3.1.100/ Host (useful for support): Version: 3.1.0 Commit: 65f04fb6db .NET Core SDKs installed: 2.1.202 [/usr/local/share/dotnet/sdk] 2.1.607 [/usr/local/share/dotnet/sdk] 2.2.207 [/usr/local/share/dotnet/sdk] 3.0.100 [/usr/local/share/dotnet/sdk] 3.1.100 [/usr/local/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download ```$ dotnet --info
Let me know if there's anything I can attach that might be of diagnostic help.
Same results on Linux.
Error: Call to coreclr_create_delegate() for G failed with a return code of 0x80070002
on Windows (probably unrelated).Weird thing that I probably should have mentioned earlier: I don't even have a
using
statement forMicrosoft.CodeAnalysis.CSharp.Workspaces
, just these three.