Running a native binary fails on Ubuntu 14.04.3 LTS
I just installed the tooling and ran the following commands
dotnet new
dotnet restore
dotnet build -n
Running the binary fails with the following message:
ILCompiler failed generating code for this method; execution cannot continue.
This is likely because of a feature that is not yet implemented in the compiler.
Method: [System.Private.CoreLib]System.Text.UTF8Encoding.GetBytes
Reason: System.NotImplementedException: getFunctionEntryPoint
at Internal.JitInterface.CorInfoImpl.getFunctionEntryPoint_wrapper(IntPtr _this, IntPtr& exception, CORINFO_METHOD_STRUCT_* ftn, CORINFO_CONST_LOOKUP& pResult, CORINFO_ACCESS_FLAGS accessFlags)
Any tips? Something's telling me that that I'm not really dealing with a fully native app, but...
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24
@glhanna79. Native is still maturing, so I expect the message is accurate and expected.
@gkhanna79
This is definitely not expected because we should be able to compile a "Hello World".
The really bizarre part is:
If I restored and published the below project.json and used the published directory as --ilcpath it succeeds in compiling.
The issue occurs only in the current ubuntu drop. Is this drop up to date and good? Cc @Sridhar-MS
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true,
},
"dependencies": {
"NETStandard.Library": "1.0.0-beta-23704",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23704",
"Microsoft.NETCore.TestHost": "1.0.0-beta-23504",
"Microsoft.DotNet.ILCompiler.SDK": "1.0.4-prerelease-00006",
"Microsoft.DotNet.ILCompiler": "1.0.4-prerelease-00006",
},
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
}
}
}
@brthor the CI hello test is still enabled right?
@schellap Is there anything I can do to be able to run the native binary? Pass an extra flag or something? I'm going to demo the dotnet tools later today and would like to show the "Hello World" sample.
"--native" switch is a compiler that is still under development and in early phases of the same. It is a long way from supporting anything that is more than just plain, vanilla "HelloWorld".
Are you unable to compile and run "HelloWorld" that is produced by doing "dotnet new" ?
@schellap The current Ubuntu drop is not up to date. @Sridhar-MS has been dealing with some weird issues in the VSO CI.
@brthor Ubuntu CI builds were failing in VSO but it has been fixed by dotnet/cli#1060.
Nice, so when that goes through we should see some updated drops
I had a suspicion of DLL stomping going on again -- the libryujit.so that was brought in conflicts with the ILC's dependency. To workaround for your presentation, you can replace the copy of libryujit.so from this package (replace .nupkg to .zip and libryujit.so is in runtimes/ubuntu.14.04-x64/native/)
@schellap AFAIK libryujit is only brought in by ILC?
From my .nuget cache -- /home/senthil/.nuget/packages/runtime.ubuntu.14.04-x64.Microsoft.NETCore.Runtime.CoreCLR/1.0.1-rc2-23704/runtimes/ubuntu.14.04-x64/native/libryujit.so. I think this dependency problem needs to be taken care of now that CLI is beyond beta. @piotrpMSFT, you were suggesting commands will go into their own folders, is that plan still on?
@kyulee1, is there a reason libryujit.so gets included in the ubuntu CoreCLR package?
Since we don't support building native binaries with the CLI anymore, I will close this. @khellang, if needed, please reopen this on dotnet/corert.