agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux
MIT License
643 stars 95 forks source link

Linux Build - Help please #151

Closed crgkillik closed 7 months ago

crgkillik commented 2 years ago

Hi, The build instructions in the documentation are pretty out of date for linux. Using v16.6.0, with Node v16 What packages, and instructions are required in order for the build to occur via npm? Currently trying it on an alpine image, which produces the build directory, but not the compiled outputs. Can change distro if working instructions exist for another one. Thanks in advance. C

crgkillik commented 2 years ago

OK. Found that alpine uses different c libraries (glibc not musl) and hence may not build correctly.

Moving to a debian distribution have successfully installed .net and edje-js with a build. However when trying to call the edge-sql module get the following error

Does anyone have any ideas what we are doing wrong?

listen Error Processing Message null Error: The given assembly name or codebase was invalid. (0x80131047) at Object.exports.func (/microservices/node_modules/edge-js/lib/edge.js:177:17) at ... { Message: 'The given assembly name or codebase was invalid. (0x80131047)', FileName: null, FusionLog: null, TargetSite: { Name: '', DeclaringType: '', ReflectedType: '', MemberType: '', MetadataToken: '', Module: '', IsSecurityCritical: '', IsSecuritySafeCritical: '', IsSecurityTransparent: '', MethodHandle: '', Attributes: '', CallingConvention: '', ReturnType: '', ReturnTypeCustomAttributes: '', ReturnParameter: '', IsCollectible: '', IsGenericMethod: '', IsGenericMethodDefinition: '', ContainsGenericParameters: '', MethodImplementationFlags: '', IsAbstract: '', IsConstructor: '', IsFinal: '', IsHideBySig: '', IsSpecialName: '', IsStatic: '', IsVirtual: '', IsAssembly: '', IsFamily: '', IsFamilyAndAssembly: '', IsFamilyOrAssembly: '', IsPrivate: '', IsPublic: '', IsConstructedGenericMethod: '', CustomAttributes: '' }, StackTrace: ' at System.Reflection.AssemblyName.nInit()\n' + ' at System.Reflection.AssemblyName..ctor(String assemblyName)\n' + ' at CoreCLREmbedding.CompileFunc(IntPtr v8Options, Int32 payloadType, IntPtr exception)', Data: {}, InnerException: null, HelpLink: null, Source: 'System.Private.CoreLib', HResult: -2146234297, Name: 'System.IO.FileLoadException', name: 'System.IO.FileLoadException' }

The call (which works on windows) being used is var edgeOptions = { source: sqlString, connectionString: options.connectionString, commandTimeout: options.commandTimeout, useOLEDB: false }; var runSqlFunc = edge.func('sql', edgeOptions); runSqlFunc(null, function(error, result) { if (error) { .. } .. });