dotnet / source-build

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
MIT License
265 stars 132 forks source link

[9.0] VMR Stage2 build failing with `field` references #4639

Closed Winniexu01 closed 1 month ago

Winniexu01 commented 1 month ago

Release/9.0.1xx build: https://dev.azure.com/dnceng/internal/_build/results?buildId=2547862&view=logs&j=3121c41d-6088-53a5-4ef6-9a86f3460fe9&t=334539f4-dcef-5cad-a240-02997b3146e7 (internal Microsoft link)

VMR Stage2 building runtime failed with the following errors:

/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs(477,26): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs(478,32): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.TypeEquivalence.cs(141,29): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.TypeEquivalence.cs(147,29): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.TypeEquivalence.cs(152,29): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs(468,26): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs(469,32): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs(477,32): error CS1061: 'TypeDesc' does not contain a definition for 'IsStatic' and no accessible extension method 'IsStatic' accepting a first argument of type 'TypeDesc' could be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs(478,38): error CS1061: 'TypeDesc' does not contain a definition for 'FieldType' and no accessible extension method 'FieldType' accepting a first argument of type 'TypeDesc' could be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.TypeEquivalence.cs(141,35): error CS1061: 'bool' does not contain a definition for 'IsLiteral' and no accessible extension method 'IsLiteral' accepting a first argument of type 'bool' could be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.TypeEquivalence.cs(147,35): error CS1061: 'bool' does not contain a definition for 'IsStatic' and no accessible extension method 'IsStatic' accepting a first argument of type 'bool' could be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.TypeEquivalence.cs(152,29): error CS1929: 'bool' does not contain a definition for 'GetEffectiveVisibility' and the best extension method overload 'EffectiveVisibilityExtensions.GetEffectiveVisibility(EcmaMethod)' requires a receiver of type 'Internal.TypeSystem.Ecma.EcmaMethod' [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs(468,32): error CS1061: 'TypeDesc' does not contain a definition for 'IsStatic' and no accessible extension method 'IsStatic' accepting a first argument of type 'TypeDesc' could be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
/vmr/src/runtime/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs(469,38): error CS1061: 'TypeDesc' does not contain a definition for 'FieldType' and no accessible extension method 'FieldType' accepting a first argument of type 'TypeDesc' could be found (are you missing a using directive or an assembly reference?) [/vmr/src/runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj]
    7 Warning(s)
    7 Error(s)

Related to https://github.com/dotnet/runtime/pull/108219

MichaelSimons commented 1 month ago

@NikolaMilosavljevic Can you take a look? TIA

NikolaMilosavljevic commented 1 month ago

runtime issues outlined above are fixed in main and in a backport PR for release/9.0 - https://github.com/dotnet/runtime/pull/108222

I have tested these changes in a VMR build - there are issues in other repos, but runtime changes are complete and do not show up: https://dev.azure.com/dnceng/internal/_build/results?buildId=2550295

@MichalStrehovsky what is the timeline for completing the backporting PR? https://github.com/dotnet/runtime/pull/108222

NikolaMilosavljevic commented 1 month ago

New test build with runtime fix uncovered similar issues in vstest: https://dev.azure.com/dnceng/internal/_build/results?buildId=2550295&view=logs&j=3121c41d-6088-53a5-4ef6-9a86f3460fe9&t=334539f4-dcef-5cad-a240-02997b3146e7

    /vmr/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/PlatformEqtTrace.cs(87,5): error IDE0032: Use auto property (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0032) [/vmr/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj::TargetFramework=net9.0]

@nohwnd this needs to be fixed for 9.0 release. It reproes in source-build stage 2 build which uses compiler produced by source-building. You could repro the issue in your repo build by using the latest 9.0 SDK.

NikolaMilosavljevic commented 1 month ago

Another issue in roslyn-analyzers: https://dev.azure.com/dnceng/internal/_build/results?buildId=2550485&view=logs&j=3121c41d-6088-53a5-4ef6-9a86f3460fe9&t=334539f4-dcef-5cad-a240-02997b3146e7

    /vmr/src/roslyn-analyzers/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/AnalysisEntity.cs(189,35): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/roslyn-analyzers/src/Microsoft.CodeAnalysis.AnalyzerUtilities/Microsoft.CodeAnalysis.AnalyzerUtilities.csproj]
    /vmr/src/roslyn-analyzers/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/AnalysisEntity.cs(189,35): warning CS9258: In language version preview, the 'field' keyword binds to a synthesized backing field for the property. To avoid generating a synthesized backing field, and to refer to the existing member, use 'this.field' or '@field' instead. [/vmr/src/roslyn-analyzers/src/NetAnalyzers/Core/Microsoft.CodeAnalysis.NetAnalyzers.csproj]
    /vmr/src/roslyn-analyzers/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/AnalysisEntity.cs(189,41): error CS0428: Cannot convert method group 'HasConstantValue' to non-delegate type 'bool'. Did you intend to invoke the method? [/vmr/src/roslyn-analyzers/src/Microsoft.CodeAnalysis.AnalyzerUtilities/Microsoft.CodeAnalysis.AnalyzerUtilities.csproj]
    /vmr/src/roslyn-analyzers/src/Utilities/FlowAnalysis/FlowAnalysis/Framework/DataFlow/AnalysisEntity.cs(189,41): error CS0428: Cannot convert method group 'HasConstantValue' to non-delegate type 'bool'. Did you intend to invoke the method? [/vmr/src/roslyn-analyzers/src/NetAnalyzers/Core/Microsoft.CodeAnalysis.NetAnalyzers.csproj]

@mavasani this needs to be fixed for 9.0 release. It reproes in source-build stage 2 build which uses compiler produced by sour-building. You could repro the issue in your repo build by using the latest 9.0 SDK.

MichaelSimons commented 1 month ago

@NikolaMilosavljevic - I think it would be best to log separate issues for each cause of the stage 2 breaks. The main reason is to help track the issues needing addressed. Separate issues can be assigned to specific owners to address.

Given the point in time where we are in the release schedule, these issues should be patched when fixes are available. e.g. we need passing builds to ensure no further regressions.

NikolaMilosavljevic commented 1 month ago

@NikolaMilosavljevic - I think it would be best to log separate issues for each cause of the stage 2 breaks. The main reason is to help track the issues needing addressed. Separate issues can be assigned to specific owners to address.

Given the point in time where we are in the release schedule, these issues should be patched when fixes are available. e.g. we need passing builds to ensure no further regressions.

Certainly - will open issues both in source-build and the individual repos.

Should patches be produced even before fixes are available in repos? I.e. to suppress the warnings, when that is the quickest option.

MichaelSimons commented 1 month ago

Should patches be produced even before fixes are available in repos? I.e. to suppress the warnings, when that is the quickest option.

I am supportive of that. It will help us ensure the product is building and flush out all of the issues while we wait for the long term fixes.

MichalStrehovsky commented 1 month ago

@MichalStrehovsky what is the timeline for completing the backporting PR? dotnet/runtime#108222

The only way I'm involved in that PR is that I got auto-added as a reviewer by Github. Cc @cston @stephentoub who would know more.