Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run dotnet-ilverify on Apple M1 #70508

Closed
seesharper opened this issue Jun 9, 2022 · 2 comments · Fixed by #71695
Closed

Unable to run dotnet-ilverify on Apple M1 #70508

seesharper opened this issue Jun 9, 2022 · 2 comments · Fixed by #71695
Assignees
Labels
area-Tools-ILVerification Issues related to ilverify tool and IL verification in general
Milestone

Comments

@seesharper
Copy link

Description

Trying to install the global tool dotnet-ilverify on a Mac with Apple M1.

The tool installs just fine, but results in a System.BadImageFormatException when trying to execute.

Reproduction Steps

From the terminal

dotnet tool install dotnet-ilverify -g

Installs successfully

You can invoke the tool using the following command: ilverify
Tool 'dotnet-ilverify' (version '6.0.0') was successfully installed.

Expected behavior

To execute ilverify without any exceptions

Actual behavior

From the terminal

ilverify 

Result

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/bernhardrichter/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'. An attempt was made to load a program with an incorrect format.

File name: '/Users/bernhardrichter/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'
[1]    58520 abort      ilverify

Regression?

Installing the 5.0.0 version of dotnet-ilverify works just fine

From the terminal

ilverify --version 

Result

5.0.0-rtm.20519.4+cf258a14b70ad9069470a108f13765e0e5988f51

Known Workarounds

No response

Configuration

Results from dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.300
 Commit:    8473146e7d

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.2
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.300/

Host (useful for support):
  Version: 6.0.5
  Commit:  70ae3df4a6

.NET SDKs installed:
  6.0.203 [/usr/local/share/dotnet/sdk]
  6.0.300 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Other information

Inspecting the two NuGet packages 5.0.0 versus 6.0.0 there is some difference in ILVerify.runtimeconfig.json

Contents of the file in the 5.0.0 package

{
  "runtimeOptions": {
    "tfm": "netcoreapp3.1",
    "rollForward": "Major",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "3.1.0"
    }
  }
}

Contents of the file in the 6.0.0 package

{
  "runtimeOptions": {
    "tfm": "net6.0",
    "rollForward": "Major",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "6.0.0-rc.1.21430.1"
    },
    "configProperties": {
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false
    }
  }
}

So the difference is that the 5.0.0 package targets netcoreapp3.1 while the 6.0.0 package targets net6.0

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 9, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-Tools-ILVerification Issues related to ilverify tool and IL verification in general label Jun 9, 2022
@ghost
Copy link

ghost commented Jun 9, 2022

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Trying to install the global tool dotnet-ilverify on a Mac with Apple M1.

The tool installs just fine, but results in a System.BadImageFormatException when trying to execute.

Reproduction Steps

From the terminal

dotnet tool install dotnet-ilverify -g

Installs successfully

You can invoke the tool using the following command: ilverify
Tool 'dotnet-ilverify' (version '6.0.0') was successfully installed.

Expected behavior

To execute ilverify without any exceptions

Actual behavior

From the terminal

ilverify 

Result

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/bernhardrichter/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'. An attempt was made to load a program with an incorrect format.

File name: '/Users/bernhardrichter/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'
[1]    58520 abort      ilverify

Regression?

Installing the 5.0.0 version of dotnet-ilverify works just fine

From the terminal

ilverify --version 

Result

5.0.0-rtm.20519.4+cf258a14b70ad9069470a108f13765e0e5988f51

Known Workarounds

No response

Configuration

Results from dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.300
 Commit:    8473146e7d

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.2
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.300/

Host (useful for support):
  Version: 6.0.5
  Commit:  70ae3df4a6

.NET SDKs installed:
  6.0.203 [/usr/local/share/dotnet/sdk]
  6.0.300 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Other information

Inspecting the two NuGet packages 5.0.0 versus 6.0.0 there is some difference in ILVerify.runtimeconfig.json

Contents of the file in the 5.0.0 package

{
  "runtimeOptions": {
    "tfm": "netcoreapp3.1",
    "rollForward": "Major",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "3.1.0"
    }
  }
}

Contents of the file in the 6.0.0 package

{
  "runtimeOptions": {
    "tfm": "net6.0",
    "rollForward": "Major",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "6.0.0-rc.1.21430.1"
    },
    "configProperties": {
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false
    }
  }
}

So the difference is that the 5.0.0 package targets netcoreapp3.1 while the 6.0.0 package targets net6.0

Author: seesharper
Assignees: -
Labels:

untriaged, area-ILVerification

Milestone: -

@JulieLeeMSFT
Copy link
Member

@TIHan Please triage this issue to decide milestone.

@JulieLeeMSFT JulieLeeMSFT added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed untriaged New issue has not been triaged by the area owner labels Jun 9, 2022
@JulieLeeMSFT JulieLeeMSFT added this to the 7.0.0 milestone Jun 9, 2022
@TIHan TIHan added Pri2 and removed needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration labels Jun 10, 2022
@TIHan TIHan modified the milestones: 7.0.0, Future Jul 5, 2022
jkotas added a commit to jkotas/runtime that referenced this issue Jul 6, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 6, 2022
jkotas added a commit that referenced this issue Jul 6, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILVerification Issues related to ilverify tool and IL verification in general
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants