dotnet/runtime

ilasm (and ildasm) fail to resolve runtime dependencies on Linux

ivanpovazan opened this issue · 5 comments

Description

After adding ilasm (or ildasm) package to an app and publishing the app as runtime-dependent; running ilasm (or ildasm) fails with:
Error: Fail to load /home/ivan/Projects/test/bin/Release/netcoreapp3.1/linux-x64/publish/libcoreclr.so Failed to initialize Assembler

Configuration

OS: Ubuntu 18.04 x64
dotnet: 3.1.301
ilasm (ildasm) package: 2.0.8

How to reproduce

In a new terminal execute the following sequence:

  1. dotnet new console -n test
  2. cd test
  3. dotnet add package Microsoft.NETCore.ILAsm (ILDAsm)
  4. dotnet publish -c Release --self-contained false --runtime linux-x64
  5. touch test.il
  6. ./bin/Release/netcoreapp3.1/linux-x64/publish/ilasm test.il

Other information

This might be related to previously reported issue #38701

@janvorli, we suspect that this might be related to SDK issue. You appear as "area-SDK" owner. However, I don't see area-SDK anymore from our labels, but who would be the proper owner for SDK related issue? I also reported this to dotnet/sdk.

The problem is that libcoreclr.so needs to be side by side with the ilasm and the steps above don't put it there. The folder ./bin/Release/netcoreapp3.1/linux-x64/publish created by the above mentioned commands contains just these files:

ilasm
libsosplugin.so
libsos.so
sosdocsunix.txt
SOS.NETCore.dll
test
test.deps.json
test.dll
test.pdb
test.runtimeconfig.json

Removing the false after the --self-contained fixes the problem since the whole runtime is copied into the target folder.

You appear as "area-SDK" owner.

I am not an owner of the SDK area, I'm not sure how I got it assigned to myself. In fact, I have no idea what that area is supposed to mean in the runtime repo. I believe that dotnet/sdk repo is an appropriate repo for this issue.

Closing this bug and tracking from dotnet/sdk #12928.

This was fixed by dotnet/coreclr#25930 and related PRs that made ilasm/ildasm SDK standalone. It does not reproduce for me with the .NET 5 preview packages.

BTW: dotnet/runtime is the right repo to track this if this is still a problem. dotnet/sdk repo is not responsible to ilasm/ildasm packages.