dotnet / runtime

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

`dotnet-pgo` used in build with new packages without ensuring matching framework #106983

Open ericstj opened 2 months ago

ericstj commented 2 months ago

Similar to https://github.com/dotnet/runtime/issues/106740

Discovered in https://github.com/dotnet/runtime/pull/106873#issuecomment-2310658849

ILCompiler projects are referencing a package version of System.Reflection.Metdata and copying that to the output and running it during the build, without ensuring that the runtime they are running against supports that version of the package.

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.

MichalStrehovsky commented 1 month ago

I've deleted the S.R.Metadata package reference in ILCompiler.TypeSystem in #107343.

dotnet-pgo still doesn't work because it depends on ILCompiler.Reflection.ReadyToRun and that one does need a S.R.Metadata package reference because it's netstandard2.0 for ILSpy sake. If we could make it $(NetCoreAppToolCurrent), the problem would go away but that would break ILSpy. I don't know enough nuget-fu to resolve this. Reopening and moving to crossgen2 area path since this is not in a component shared with nativeaot anymore.