I'm using dotnet/cli for Linux;
I read here: https://github.com/dotnet/roslyn/blob/master/docs/infrastructure/cross-platform.md
that Roslyn for Linux is WIP, does that mean that I shouldn't be relying for now on the output of the compilation? Is it a standard version of Roslyn?
Is the output a native binary for Linux? If not, I assume the JIT is the one I can find on GitHub.
Sorry for the many questions, I'm happy to split it into other issues if needed.
First, that page you linked to is fairly, old, so it might be outdated. Second (emphasis mine):
Linux and Mac support for developing Roslyn is very much a work in progress
What I think this means is that if you want to _compile Roslyn_ for Linux on your own, you might encounter some issues. But just _using Roslyn_ on Linux should be reliable.
Is the output a native binary for Linux? If not, I assume the JIT is the one I can find on GitHub.
No, .Net Core CLI only supports compiling to IL and then running with CoreCLR, which uses JIT. And yes, that JIT compiler is the one from dotnet/coreclr.
(At least for now, see dotnet/corert for AOT compilation, but that's a work in progress.)
Thank you for the explanation;
I asked about the compilation result as I have tried to open the output with ILSpy and I got an error, but I'm assuming it just doesn't support .NET Core.
@UnoSD It's possible you may have been ildasm'ing the wrong binary. Since CoreCLR requires a host to run, there's a native executable that kicks off all CoreCLR runs. Your app is probably named "bin/Debug/<framework> directory after running dotnet build you should see a file called something like <your-project-name>.dll. If you ILSpy that do you see what you expected?
@agocke I opened the right one, I get this exception:
System.OutOfMemoryException: Array dimensions exceeded supported range.
at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings, Int32& age, Guid& guid)
at Mono.Cecil.Pdb.PdbReader.PopulateFunctions()
at Mono.Cecil.Pdb.PdbReader.ProcessDebugHeader(ImageDebugDirectory directory, Byte[] header)
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader()
at ICSharpCode.ILSpy.LoadedAssembly.LoadSymbols(ModuleDefinition module)
at ICSharpCode.ILSpy.LoadedAssembly.LoadAssembly(Object state)
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
I will submit it to ILSpy
My guess would be that ILSpy is trying to open Portable PDB as if it was Windows PDB and fails. The latest Mono.Cecil now supports Portable PDBs, so you might just need to wait for ILSpy to move to the latest version of Mono.Cecil.
Sounds like this is cleared up.