Description
Describe the bug
When trying to run tests by means of the dotnet build -t:Test
command using R2R, one must exclude any content references (dll references for instance) in the csproj file. Otherwise, the SDK fails when building.
To Reproduce
- Get the changes of the following PR (will be merged into main very soon) in a local clone of the runtime repo: [Continuation] - Enable the fundamentals behind libraries tests compiled via Crossgen2 runtime#80946
- Then, build coreclr and the libraries:
cd /path/to/runtime/repo
./build.sh -s clr+libs -c Release
- Move to one of the faulty tests location:
cd src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests
- Now, looking at that specific test's csproj file (./System.Diagnostics.FileVersionInfo.Tests.csproj), you'll see at the bottom in line 55 that a dll is excluded from PublishReadyToRun:
<PublishReadyToRunExclude Include="System.Diagnostics.FileVersionInfo.TestAssembly.dll" />
- Remove/Comment out that line and then run the test with R2R to trigger the bug:
dotnet build -c Release -t:Test -p:TestReadyToRun=true
Exceptions (if any)
/usr/local/share/dotnet/sdk/8.0.100-preview.1.23108.10/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(472,28): error MSB4094: "/path/to/runtime/repo/artifacts/bin/System.Diagnostics.FileVersionInfo.TestAssembly/Release/net8.0/System.Diagnostics.FileVersionInfo.TestAssembly.dll;/path/to/runtime/repo/artifacts/bin/System.Diagnostics.FileVersionInfo.TestAssembly/Release/net8.0/System.Diagnostics.FileVersionInfo.TestAssembly.dll" is an invalid value for the "CompilationEntry" parameter of the "RunReadyToRunCompiler" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". [/path/to/runtime/repo/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj::TargetFramework=net8.0-unix]
Further technical details
- No IDE used to reproduce this bug, just a terminal.
- I also got the bug to reproduce on Linux x64 (Ubuntu 20.04 LTS).
- My
dotnet --info
output:
.NET SDK:
Version: 8.0.100-preview.1.23108.10
Commit: 5725657a6b
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.2
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.100-preview.1.23108.10/
Host:
Version: 8.0.0-preview.1.23106.5
Architecture: arm64
Commit: 9f654effb1
.NET SDKs installed:
6.0.405 [/usr/local/share/dotnet/sdk]
7.0.102 [/usr/local/share/dotnet/sdk]
8.0.100-preview.1.23108.10 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.1.23107.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.1.23106.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/usr/local/share/dotnet]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download