dkurt / dotnet_riscv

Build .NET SDK for RISC-V
24 stars 8 forks source link

Unable to load sdk commands #4

Closed Xinlong-Wu closed 8 months ago

Xinlong-Wu commented 8 months ago

I'm using following code to install the dotnet

DOTNET_FILE=dotnet-sdk-8.0.100-linux-riscv64.tar.gz
export DOTNET_ROOT=$(pwd)/.dotnet

mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"

export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

and create new console project by

dotnet new console -n HelloWorld

it report

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'new' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

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

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

it seems there is no sdk installed, but i think package dotnet-sdk-8.0.100-linux-riscv64.tar.gz has include the sdk already. I don't know why it can't find that.

dkurt commented 8 months ago

@Xinlong-Wu, many thanks! I will try to take a look closer.

Do you have any error messages about GLIBC? Because The published SDK requires 2.36 or newer for now (since Ubuntu 22.10).

dkurt commented 8 months ago

BTW, I'm trying to build GitHub CI Runner for now and here is the progress:

  1. dotnet hangs on Exec commands (or ConsoleToMSBuild="true", hard to say).
  2. Without such steps there is some progress on compilation until segfault: log.txt
Xinlong-Wu commented 8 months ago

@Xinlong-Wu, many thanks! I will try to take a look closer.

Do you have any error messages about GLIBC? Because The published SDK requires 2.36 or newer for now (since Ubuntu 22.10).

I have check my glibc verision, it is glibc-2.38-8.oe2309.riscv64

BTW, I'm trying to build GitHub CI Runner for now and here is the progress:

  1. dotnet hangs on Exec commands (or ConsoleToMSBuild="true", hard to say).
  2. Without such steps there is some progress on compilation until segfault: log.txt

sorry I can't help you about the information you give, I don't know what is the problem either some env might be helpful

// JitHelperLogging usage:
//      1) Ngen using:
//              DOTNET_HardPrejitEnabled=0
//
//         This allows us to instrument even ngen'd image calls to JIT helpers.
//         Remember to clear the key after ngen-ing and before actually running
//         the app you want to log.
//
//      2) Then set:
//              DOTNET_JitHelperLogging=1
//              DOTNET_LogEnable=1
//              DOTNET_LogLevel=1
//              DOTNET_LogToFile=1
//
//      3) Run the app that you want to log; Results will be in COMPLUS.LOG(.X)
//
//      4) JitHelperLogging=2 and JitHelperLogging=3 result in different output
//         as per code in WriteJitHelperCountToSTRESSLOG() below.
dkurt commented 8 months ago

@Xinlong-Wu, regarding the origin problem, I tried Ubuntu 23.10 from https://ubuntu.com/download/risc-v (Sipeed RV Dock board with C906 CPU).

$ export DOTNET_JitHelperLogging=1
$ export DOTNET_LogEnable=1
$ export DOTNET_LogLevel=1
$ export DOTNET_LogToFile=1
$ dotnet new console -n HelloWorld

The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /home/ubuntu/tmp/HelloWorld/HelloWorld.csproj:
  Determining projects to restore...
  Restored /home/ubuntu/tmp/HelloWorld/HelloWorld.csproj (in 28.64 sec).
Restore succeeded.

$ tree HelloWorld/
HelloWorld/
├── HelloWorld.csproj
├── Program.cs
└── obj
    ├── HelloWorld.csproj.nuget.dgspec.json
    ├── HelloWorld.csproj.nuget.g.props
    ├── HelloWorld.csproj.nuget.g.targets
    ├── project.assets.json
    └── project.nuget.cache

2 directories, 7 files

However without the environment variables, there was a segfault.

Xinlong-Wu commented 8 months ago

great, I have found the problem. That is because I have have installed a another dotnet for previous testing and forget to delete it.