dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.26k stars 4.73k forks source link

Failed to build "CoreCLR component". #53805

Open sangramsalunkhe97 opened 3 years ago

sangramsalunkhe97 commented 3 years ago

Hi, after cloning a source code i wanna build it on my Ubuntu 18.04 machine. So i go to "/runtime-main$" Directory and start "build.sh" script. But I faced the following error. can you please suggest why that error has been occur or any argument has to pass with "build.sh" script.

error

sangram@sangram-VirtualBox:~/Downloads/mozilla_sangram0/runtime-main$` ./build.sh 
__DistroRid: linux-x64
  Determining projects to restore..
  Tool 'coverlet.console' (version '1.7.2') was restored. Available commands: coverlet
  Tool 'dotnet-reportgenerator-globaltool' (version '4.5.8') was restored. Available commands: reportgenerator
  Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.21281.2') was restored. Available commands: xharness
  Tool 'microsoft.visualstudio.slngen.tool' (version '5.0.5') was restored. Available commands: slngen

  Restore was successful.
  All projects are up-to-date for restore.
  Determining projects to restore...
  All projects are up-to-date for restore.
  System.Private.CoreLib.Generators -> /home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/bin/System.Private.CoreLib.Generators/netstandard2.0-Debug/System.Private.CoreLib.Generators.dll
  System.Private.CoreLib -> /home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/bin/coreclr/Linux.x64.Debug/IL/System.Private.CoreLib.dll
  runtime -> 
  Commencing CoreCLR Repo build
  __DistroRid: linux-x64
  Setting up directories for build
  Checking prerequisites...
  Restoring the OptimizationData package
  /home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/MSBuild.dll /nologo -bl:/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/log/Debug/OptRestore_Linux.x64.Debug.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll -maxcpucount /m /m -verbosity:m /v:minimal /clp:Summary /clp:nosummary /nr:true /nodeReuse:false /nodereuse:false /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /p:TargetArchitecture=x64 /p:Configuration=Debug /p:TargetOS=Linux /t:Restore /warnaserror /home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/.nuget/optdata/optdata.csproj
    Determining projects to restore...
    Restored /home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/.nuget/optdata/optdata.csproj (in 806 ms).
  Commencing build of "install" target in "CoreCLR component" for Linux.x64.Debug in /home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug
  /home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/MSBuild.dll /nologo -bl:/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/log/Debug/GenNativeVersion_Linux.x64.Debug.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll -maxcpucount /m -verbosity:m /v:minimal /clp:Summary /clp:nosummary /nr:true /nodeReuse:false /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /p:NativeVersionFile=/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug/version.c /p:RuntimeVersionFile=/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug/../runtime_version.h /p:TargetArchitecture=x64 /p:Configuration=Debug /p:TargetOS=Linux /restore /t:GenerateRuntimeVersionFile /warnaserror /home/sangram/Downloads/mozilla_sangram0/runtime-main/eng/empty.csproj
    Determining projects to restore...
    Restored /home/sangram/Downloads/mozilla_sangram0/runtime-main/eng/empty.csproj (in 327 ms).
  Invoking "/home/sangram/Downloads/mozilla_sangram0/runtime-main/eng/native/gen-buildsys.sh" "/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr" "/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug" x64 clang "" "" Debug ""  -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH=/home/sangram/.nuget/packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.21275.7 -DCLR_CMAKE_PGO_OPTIMIZE=1 -DFEATURE_DISTRO_AGNOSTIC_SSL=1 
  CMake command line is unchanged. Reusing previous cache instead of regenerating.
  make: *** No rule to make target 'install'.  Stop.
  ~/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug ~/Downloads/mozilla_sangram0/runtime-main/src/coreclr
  Executing make install -j 1
  ~/Downloads/mozilla_sangram0/runtime-main/src/coreclr
  Failed to build "CoreCLR component".
/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/runtime.proj(46,5): error MSB3073: The command ""/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/build-runtime.sh" -x64 -debug -os Linux" exited with code 2.

Build FAILED.

/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/runtime.proj(46,5): error MSB3073: The command ""/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/build-runtime.sh" -x64 -debug -os Linux" exited with code 2.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:03:38.09
Build failed with exit code 1. Check errors above.
dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost commented 3 years ago

Tagging subscribers to this area: @dotnet/runtime-infrastructure See info in area-owners.md if you want to be subscribed.

Issue Details
Hi, after cloning a source code i wanna build it on my Ubuntu 18.04 machine. So i go to "/runtime-main$" Directory and start "build.sh" script. But I faced the following error. can you please suggest why that error has been occur or any argument has to pass with "build.sh" script. ![error](https://user-images.githubusercontent.com/81962828/120997900-35bc5b80-c7a5-11eb-938c-7b3af51049ec.png) ```` sangram@sangram-VirtualBox:~/Downloads/mozilla_sangram0/runtime-main$` ./build.sh __DistroRid: linux-x64 Determining projects to restore.. Tool 'coverlet.console' (version '1.7.2') was restored. Available commands: coverlet Tool 'dotnet-reportgenerator-globaltool' (version '4.5.8') was restored. Available commands: reportgenerator Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.21281.2') was restored. Available commands: xharness Tool 'microsoft.visualstudio.slngen.tool' (version '5.0.5') was restored. Available commands: slngen Restore was successful. All projects are up-to-date for restore. Determining projects to restore... All projects are up-to-date for restore. System.Private.CoreLib.Generators -> /home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/bin/System.Private.CoreLib.Generators/netstandard2.0-Debug/System.Private.CoreLib.Generators.dll System.Private.CoreLib -> /home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/bin/coreclr/Linux.x64.Debug/IL/System.Private.CoreLib.dll runtime -> Commencing CoreCLR Repo build __DistroRid: linux-x64 Setting up directories for build Checking prerequisites... Restoring the OptimizationData package /home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/MSBuild.dll /nologo -bl:/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/log/Debug/OptRestore_Linux.x64.Debug.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll -maxcpucount /m /m -verbosity:m /v:minimal /clp:Summary /clp:nosummary /nr:true /nodeReuse:false /nodereuse:false /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /p:TargetArchitecture=x64 /p:Configuration=Debug /p:TargetOS=Linux /t:Restore /warnaserror /home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/.nuget/optdata/optdata.csproj Determining projects to restore... Restored /home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/.nuget/optdata/optdata.csproj (in 806 ms). Commencing build of "install" target in "CoreCLR component" for Linux.x64.Debug in /home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug /home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/MSBuild.dll /nologo -bl:/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/log/Debug/GenNativeVersion_Linux.x64.Debug.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/home/sangram/Downloads/mozilla_sangram0/runtime-main/.dotnet/sdk/6.0.100-preview.3.21202.5/dotnet.dll -maxcpucount /m -verbosity:m /v:minimal /clp:Summary /clp:nosummary /nr:true /nodeReuse:false /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /p:NativeVersionFile=/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug/version.c /p:RuntimeVersionFile=/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug/../runtime_version.h /p:TargetArchitecture=x64 /p:Configuration=Debug /p:TargetOS=Linux /restore /t:GenerateRuntimeVersionFile /warnaserror /home/sangram/Downloads/mozilla_sangram0/runtime-main/eng/empty.csproj Determining projects to restore... Restored /home/sangram/Downloads/mozilla_sangram0/runtime-main/eng/empty.csproj (in 327 ms). Invoking "/home/sangram/Downloads/mozilla_sangram0/runtime-main/eng/native/gen-buildsys.sh" "/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr" "/home/sangram/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug" x64 clang "" "" Debug "" -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH=/home/sangram/.nuget/packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.21275.7 -DCLR_CMAKE_PGO_OPTIMIZE=1 -DFEATURE_DISTRO_AGNOSTIC_SSL=1 CMake command line is unchanged. Reusing previous cache instead of regenerating. make: *** No rule to make target 'install'. Stop. ~/Downloads/mozilla_sangram0/runtime-main/artifacts/obj/coreclr/Linux.x64.Debug ~/Downloads/mozilla_sangram0/runtime-main/src/coreclr Executing make install -j 1 ~/Downloads/mozilla_sangram0/runtime-main/src/coreclr Failed to build "CoreCLR component". /home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/runtime.proj(46,5): error MSB3073: The command ""/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/build-runtime.sh" -x64 -debug -os Linux" exited with code 2. Build FAILED. /home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/runtime.proj(46,5): error MSB3073: The command ""/home/sangram/Downloads/mozilla_sangram0/runtime-main/src/coreclr/build-runtime.sh" -x64 -debug -os Linux" exited with code 2. 0 Warning(s) 1 Error(s) Time Elapsed 00:03:38.09 Build failed with exit code 1. Check errors above. ```
Author: sangramsalunkhe97
Assignees: -
Labels: `area-Infrastructure`, `untriaged`
Milestone: -
trylek commented 3 years ago

@sangramsalunkhe97 - looking at the log excerpt I'm wondering whether it may be occurring due to stale artifacts confusing the build after codebase update (as CMake claims it sees a pre-existing cache). In case you updated a pre-existing runtime clone, can you please try to "git clean -xdf" and retry build.sh? Of course it wouldn't make sense if you made a fresh new clone.

hoyosjs commented 3 years ago

This is a dupe of https://github.com/dotnet/runtime/issues/53594. Copying my comment here and closing the other issue:

It's not obvious from you output what went wrong. It looks like a cached CMake run - probably from a previous try - prevents us from having more diagnostic output. Can you try deleting artifacts/obj/coreclr/Linux.x64.Debug/cmake_cmd_line.txt (or the one for your build configuration, be it debug or release) and retry? We also recommend building inside Docker to ensure you have all the dependencies. The image we use for Linux x64 currently is mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-20201227183837-5fe0e50 and instructions can be found in https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md