ioi/isolate

How to run dotnet in isolate?

horvathgyozo opened this issue · 6 comments

Executing a dotnet command in isolate, or run the standalone binary in an isolate process results in:

Failed to create CoreCLR, HRESULT: 0x80070008
Exited with error status 137

Is there a solution for running .net core apps in isolate? Or, in other words, how we can compile and run a c# code in isolate? Mono supports .net 4.7. But if we need .net6 or .net7 features?

gollux commented

I do not see why it should not be possible, but I am not using C# myself.

Are you using the cgroup mode? Did you allow multiple processes?

dotnet (seemingly) requires internet access to compile. (I also do not use C# myself, so hopefully I'm wrong, and there is a way to compile without internet access).

@niemela it doesn't seem to be an issue with the internet connection.

@gollux I am using isolate in a docker container (Alpine linux). It works perfectly, e.g for c++ files. I can compile and run those files with isolate. I have extended this isolate image with .net7 runtime and sdk facilities (copying the necessary commands from official microsoft images). It is working fine, I can create a new console app, I can run it, publish it. But when I try to run it with isolate, I get the error mentioned above.

/work # dotnet new console
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /work/work.csproj:
  Determining projects to restore...
  Restored /work/work.csproj (in 129 ms).
Restore succeeded.


/work # ls
Program.cs   obj          work.csproj
/work # dotnet run
Hello, World!
/work # ls
Program.cs   bin          obj          work.csproj
/work # ./bin/Debug/net7.0/work
Hello, World!
/work # isolate --init --cg
/var/local/lib/isolate/0
/work # cp ./bin/Debug/net7.0/work* /var/local/lib/isolate/0/box/
/work # isolate --run --cg -- work
Failed to create CoreCLR, HRESULT: 0x80070008
Exited with error status 137
/work #

And the same happens, if I create a single file publish from the project.

Did you allow multiple processes?

How to do that?

@gollux It seems that allowing multiple processes solves the problem! Referring the example above:

isolate --run --cg -p -- work

Thank you!

gollux commented

Great, I am closing this issue.

@niemela it doesn't seem to be an issue with the internet connection.

@horvathgyozo Are you saying that the internet connection is working, or that it works fine without an internet connection?