dotnet / runtime

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

CoreCLR test infra: get rid of spurious warning "Resolved file has a bad image, no metadata, or is otherwise inaccessible" #91564

Open trylek opened 1 year ago

trylek commented 1 year ago

Today, CoreCLR managed test component build produces a large number of warnings of the following type:

D:\git\runtime\.dotnet\sdk\8.0.100-rc.1.23415.11\Microsoft.Common.CurrentVersion.targets(2365,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. PE image does not have metadata. PE image does not have metadata. [D:\git\runtime\src\tests\CoreMangLib\system\type\TypeEquals2.csproj] [D:\git\runtime\src\tests\build.proj]

We should either fix the real problem if there's any or otherwise remove the spurious message that's just spamming output logs and confusing developers.

Thanks

Tomas

/cc @dotnet/runtime-infrastructure @jkoritzinsky

ghost commented 1 year ago

Tagging subscribers to this area: @hoyosjs See info in area-owners.md if you want to be subscribed.

Issue Details
Today, CoreCLR managed test component build produces a large number of warnings of the following type:
D:\git\runtime\.dotnet\sdk\8.0.100-rc.1.23415.11\Microsoft.Common.CurrentVersion.targets(2365,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. PE image does not have metadata. PE image does not have metadata. [D:\git\runtime\src\tests\CoreMangLib\system\type\TypeEquals2.csproj] [D:\git\runtime\src\tests\build.proj]
We should either fix the real problem if there's any or otherwise remove the spurious message that's just spamming output logs and confusing developers. Thanks Tomas /cc @dotnet/runtime-infrastructure @jkoritzinsky
Author: trylek
Assignees: -
Labels: `area-Infrastructure-coreclr`
Milestone: -
janvorli commented 1 year ago

The warning also reproduces when building a single test using dotnet build. For example, for src\tests\baseservices\exceptions\simple\ArrayInit.csproj, it generates the warning four times - twice for the ArrayInit.csproj and twice for tests\baseservices\exceptions\simple\VT.ilproj, which is its dependency. Looking at binlog from that build, it seems that the files it complains about are artifacts\TargetingPack\dia2lib.dll and artifacts\bin\ref\net8.0\msquic.dll. Both of these are native files and both of them are in the Assemblies parameter of the ResolveAssemblyReference task. I have no idea what puts them there though, my msbuild knowledge is very limited.