Skip to content

Support RISC-V64 architecture #4837

@ww898

Description

@ww898

Hi, I got follwing exception trying to run dotnet test for RISC-V64:

Unhandled exception. System.NotSupportedException: Specified method is not supported.
   at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.GetCurrentProcessArchitecture() in /_/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs:line 45
   at Microsoft.VisualStudio.TestPlatform.CommandLine.Executor.PrintSplashScreen(Boolean isDiag, String[] args) in /_/src/vstest.console/CommandLine/Executor.cs:line 449
   at Microsoft.VisualStudio.TestPlatform.CommandLine.Executor.Execute(String[] args) in /_/src/vstest.console/CommandLine/Executor.cs:line 134
   at Microsoft.VisualStudio.TestPlatform.CommandLine.Program.Run(String[] args, UiLanguageOverride uiLanguageOverride) in /_/src/vstest.console/Program.cs:line 31
   at Microsoft.VisualStudio.TestPlatform.CommandLine.Program.Main(String[] args) in /_/src/vstest.console/Program.cs:line 22

I see that RISC-V64 is not even declared:

public enum Architecture
{
Default,
X86,
X64,
ARM,
AnyCPU,
ARM64,
S390x,
Ppc64le
}

public PlatformArchitecture GetCurrentProcessArchitecture()
{
return RuntimeInformation.ProcessArchitecture switch
{
Architecture.X86 => PlatformArchitecture.X86,
Architecture.X64 => PlatformArchitecture.X64,
Architecture.Arm => PlatformArchitecture.ARM,
Architecture.Arm64 => PlatformArchitecture.ARM64,
// The symbolic value is only available with .NET 6
// preview 6 or later, so use the numerical value for now.
// case System.Runtime.InteropServices.Architecture.S390x:
(Architecture)5 => PlatformArchitecture.S390x,
(Architecture)8 => PlatformArchitecture.Ppc64le,
_ => throw new NotSupportedException(),
};
}

Hardware: StarFive VisionFive 2
OS: Unintu 23.10 (see https://ubuntu.com/download/risc-v)
.NET SDK: 8.0.1(see https://github.com/dkurt/dotnet_riscv/releases)

$ dotnet --info
.NET SDK:
 Version:           8.0.101
 Commit:            6eceda187b
 Workload version:  8.0.100-manifests.69afb982

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  23.10
 OS Platform: Linux
 RID:         linux-riscv64
 Base Path:   /usr/local/dotnet/sdk/8.0.101/

.NET workloads installed:
 Workload version: 8.0.100-manifests.69afb982
There are no installed workloads to display.

Host:
  Version:      8.0.1
  Architecture: riscv64
  Commit:       bf5e279d92

.NET SDKs installed:
  8.0.101 [/usr/local/dotnet/sdk]

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

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions