dotnet / runtime

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

Failures building from v6.0.x tags #94541

Open Wedgetable opened 11 months ago

Wedgetable commented 11 months ago

Description

I'm trying to build the dotnet/runtime repo from the v6.0.24 release tag. I'm using PowerShell and running .\build.cmd libs -c release -a x64. It always fails with the following error:

C:\Users\<user>\.nuget\packages\microsoft.dotnet.apicompat\6.0.0-beta.23408.5\build\Microsoft.DotNet.ApiCompat.targets(96,5): error : ApiCompat failed for 'C:\dev\dotnet-runtime\artifacts\bin\System.Net.WebClient\net6.0-Release\System.Net.WebClient.dll' [C:\dev\dotnet-runtime\src\libraries\System.Net.WebClient\src\System.Net.WebClient.csproj]

in the following place:

System.Runtime.CompilerServices.Unsafe -> C:\dev\dotnet-runtime\artifacts\bin\System.Runtime.CompilerServices.Unsafe\net6.0-Release\System.Runtime.CompilerServices.Unsafe.dll
'C:\Users\<user>\AppData\Local\Temp\MSBuildTemp<user>\tmp<random 32-char hex>.exec.cmd' is not recognized as an internal or external command, operable program or batch file.
C:\Users\<user>\.nuget\packages\microsoft.dotnet.apicompat\6.0.0-beta.23408.5\build\Microsoft.DotNet.ApiCompat.targets(96,5): error : ApiCompat failed for 'C:\dev\dotnet-runtime\artifacts\bin\System.Net.WebClient\net6.0-Release\System.Net.WebClient.dll' [C:\dev\dotnet-runtime\src\libraries\System.Net.WebClient\src\System.Net.WebClient.csproj]
System.Threading.Tasks.Dataflow -> C:\dev\dotnet-runtime\artifacts\bin\System.Threading.Tasks.Dataflow\net6.0-Release\System.Threading.Tasks.Dataflow.dll

When I try to build main, I have no issues. But if I checkout any of the following tags: v6.0.22, v6.0.23, and v6.0.24, the build fails with the error above (I haven't tried earlier v6.0.x tags).

Additionally, when I try to run .\build.cmd clr -c release -a x64, I get a failure about jitinterface_x64:

ILCompiler.ReadyToRun -> C:\dev\dotnet-runtime\artifacts\bin\ILCompiler.ReadyToRun\x64\Release\ILCompiler.ReadyToRun.dll
C:\dev\dotnet-runtime\.dotnet\sdk\6.0.121\Microsoft.Common.CurrentVersion.targets(5100,5): error MSB3030: Could not copy the file "C:\dev\dotnet-runtime\artifacts\bin\coreclr\windows.x64.Release\jitinterface_x64.dll" because it was not found. [C:\dev\dotnet-runtime\src\coreclr\tools\aot\crossgen2\crossgen2.csproj]

I've tried git clean -fxd, I've tried dotnet nuget locals all --clear. I've tried completely uninstalling/reinstalling .NET versions on my local machine. Nothing seems to help. I'm seeing this exact same problem on a Azure build agent where running the build command worked when we initally upgraded to v6.0.22, but now no longer does.

Reproduction Steps

Stop-Process -Name dotnet -Force
git checkout tags/v6.0.24
git clean -fxd
.\build.cmd libs -c release -a x64

Expected behavior

Build succeeded.
    0 Warning(s)
    0 Error(s)

Actual behavior

Build FAILED.

C:\Users\<user>\.nuget\packages\microsoft.dotnet.apicompat\6.0.0-beta.23408.5\build\Microsoft.DotNet.ApiCompat.targets(96,5): error : ApiCompat failed for 'C:\dev\dotnet-runtime\artifacts\bin\System.Net.WebClient\net6.0-Release\System.Net.WebClient.dll' [C:\dev\dotnet-runtime\src\libraries\System.Net.WebClient\src\System.Net.WebClient.csproj]
    0 Warning(s)
    1 Error(s)

Regression?

Building from the v6.0.22 tag used to work. I only noticed it was broken when I tried to update a local fork of the dotnet-runtime repository from v6.0.22 to v6.0.24, and realized it fails to build for the last 3 tags.

Known Workarounds

No response

Configuration

Which version of .NET is the code running on? For v6.0.22, the build is showing "SDK Version: 6.0.121", though I think it installed the corresponding SDK for 6.0.24 when I tried to build that runtime.

What OS and version, and what distro if applicable? Windows 10 Enterprise

What is the architecture (x64, x86, ARM, ARM64)? x64

Do you know whether it is specific to that configuration? No

If you're using Blazor, which web browser(s) do you see this issue in? n/a

Other information

No response

ghost commented 11 months ago

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

Issue Details
### Description I'm trying to build the dotnet/runtime repo from the `v6.0.24` release tag. I'm using PowerShell and running `.\build.cmd libs -c release -a x64`. It always fails in the following place: ``` System.Runtime.CompilerServices.Unsafe -> C:\dev\dotnet-runtime\artifacts\bin\System.Runtime.CompilerServices.Unsafe\net6.0-Release\System.Runtime.CompilerServices.Unsafe.dll 'C:\Users\\AppData\Local\Temp\MSBuildTemp\tmp.exec.cmd' is not recognized as an internal or external command, operable program or batch file. C:\Users\\.nuget\packages\microsoft.dotnet.apicompat\6.0.0-beta.23408.5\build\Microsoft.DotNet.ApiCompat.targets(96,5): error : ApiCompat failed for 'C:\dev\dotnet-runtime\artifacts\bin\System.Net.WebClient\net6.0-Release\System.Net.WebClient.dll' [C:\dev\dotnet-runtime\src\libraries\System.Net.WebClient\src\System.Net.WebClient.csproj] System.Threading.Tasks.Dataflow -> C:\dev\dotnet-runtime\artifacts\bin\System.Threading.Tasks.Dataflow\net6.0-Release\System.Threading.Tasks.Dataflow.dll ``` When I try to build `main`, I have no issues. But if I checkout any of the following tags: `v6.0.22`, `v6.0.23`, and `v6.0.24`, the build fails with the error above (I haven't tried earlier `v6.0.x` tags). Additionally, when I try to run `.\build.cmd clr -c release -a x64`, I get a failure about jitinterface_x64: ``` ILCompiler.ReadyToRun -> C:\dev\dotnet-runtime\artifacts\bin\ILCompiler.ReadyToRun\x64\Release\ILCompiler.ReadyToRun.dll C:\dev\dotnet-runtime\.dotnet\sdk\6.0.121\Microsoft.Common.CurrentVersion.targets(5100,5): error MSB3030: Could not copy the file "C:\dev\dotnet-runtime\artifacts\bin\coreclr\windows.x64.Release\jitinterface_x64.dll" because it was not found. [C:\dev\dotnet-runtime\src\coreclr\tools\aot\crossgen2\crossgen2.csproj] ``` I've tried `git clean -fxd`, I've tried `dotnet nuget locals all --clear`. I've tried completely uninstalling/reinstalling .NET versions on my local machine. Nothing seems to help. I'm seeing this exact same problem on a Azure build agent where running the build command worked when we initally upgraded to `v6.0.22`, but now no longer does. ### Reproduction Steps ``` Stop-Process -Name dotnet -Force git checkout tags/v6.0.24 git clean -fxd .\build.cmd libs -c release -a x64 ``` ### Expected behavior ``` Build succeeded. 0 Warning(s) 0 Error(s) ``` ### Actual behavior ``` Build FAILED. C:\Users\\.nuget\packages\microsoft.dotnet.apicompat\6.0.0-beta.23408.5\build\Microsoft.DotNet.ApiCompat.targets(96,5): error : ApiCompat failed for 'C:\dev\dotnet-runtime\artifacts\bin\System.Net.WebClient\net6.0-Release\System.Net.WebClient.dll' [C:\dev\dotnet-runtime\src\libraries\System.Net.WebClient\src\System.Net.WebClient.csproj] 0 Warning(s) 1 Error(s) ``` ### Regression? Building from the `v6.0.22` tag used to work. I only noticed it was broken when I tried to update a local fork of the dotnet-runtime repository from `v6.0.22` to `v6.0.24`, and realized it fails to build for the last 3 tags. ### Known Workarounds _No response_ ### Configuration _Which version of .NET is the code running on?_ For `v6.0.22`, the build is showing "SDK Version: 6.0.121", though I think it installed the corresponding SDK for 6.0.24 when I tried to build that runtime. _What OS and version, and what distro if applicable?_ Windows 10 Enterprise _What is the architecture (x64, x86, ARM, ARM64)?_ x64 _Do you know whether it is specific to that configuration?_ No _If you're using Blazor, which web browser(s) do you see this issue in?_ n/a ### Other information _No response_
Author: Wedgetable
Assignees: -
Labels: `area-Infrastructure-libraries`
Milestone: -
Wedgetable commented 10 months ago

I found that I can successfully build libraries again if I turn off ApiCompat: .\build.cmd libs -rc Release /p:RunApiCompat=false. Why did this start happening?