dotnet / runtime

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

Outerloop test builds broken #101628

Closed AndyAyersMS closed 2 weeks ago

AndyAyersMS commented 2 weeks ago

Noticed this in some of the jit optional pipelines but it's in outerloop too.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=657460&view=results

/__w/1/s/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs(71,85): error CS0436: The type 'TypeName' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs' conflicts with the imported type 'TypeName' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj] [/__w/1/s/src/tests/build.proj]
##[error]src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs(71,85): error CS0436: The type 'TypeName' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs' conflicts with the imported type 'TypeName' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj]
/__w/1/s/src/libraries/Common/src/System/Reflection/TypeNameParser.Helpers.cs(85,31): error CS0436: The type 'TypeName' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs' conflicts with the imported type 'TypeName' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj] [/__w/1/s/src/tests/build.proj]
##[error]src/libraries/Common/src/System/Reflection/TypeNameParser.Helpers.cs(85,31): error CS0436: The type 'TypeName' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs' conflicts with the imported type 'TypeName' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj]
/__w/1/s/src/libraries/Common/src/System/Reflection/TypeNameParser.Helpers.cs(170,50): error CS0436: The type 'TypeName' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs' conflicts with the imported type 'TypeName' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj] [/__w/1/s/src/tests/build.proj]
##[error]src/libraries/Common/src/System/Reflection/TypeNameParser.Helpers.cs(170,50): error CS0436: The type 'TypeName' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs' conflicts with the imported type 'TypeName' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/TypeName.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj]
/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/AssemblyNameInfo.cs(182,23): error CS0436: The type 'AssemblyNameInfo' in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/AssemblyNameInfo.cs' conflicts with the imported type 'AssemblyNameInfo' in 'System.Reflection.Metadata, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in '/__w/1/s/src/libraries/Common/src/System/Reflection/Metadata/AssemblyNameInfo.cs'. [/__w/1/s/src/tests/ilverify/ILVerificationTests.csproj] [/__w/1/s/src/tests/build.proj]
...etc..

Looks like it all may be ILVerify related.

TIHan commented 2 weeks ago

The failures seem to be occurring after https://github.com/dotnet/runtime/pull/100094 was merged. cc @adamsitnik

jeffhandley commented 2 weeks ago

I'm interpreting these failures as:

  1. ILVerify and ILCompiler projects were both modified to directly compile the TypeName sources into those projects
  2. But with an indirect dependency onto System.Reflection.Metadata, where the APIs were also available as public APIs, this leads to conflicting types

I see @jkotas has a branch going where he committed changes that:

  1. Make the APIs only public in System.Reflection.Metadata
  2. Instead of compiling the code into the other projects, a direct reference to System.Reflection.Metadata is added to those projects as well
  3. Some refactoring/cleanup is included s well