Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes.OnlyKeepUsed.NullableOnConstraints failing in dotnet-linker-tests #90431

Closed
ericstj opened this issue Aug 11, 2023 · 4 comments · Fixed by #90449
Closed

Attributes.OnlyKeepUsed.NullableOnConstraints failing in dotnet-linker-tests #90431

ericstj opened this issue Aug 11, 2023 · 4 comments · Fixed by #90449
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab linkable-framework Issues associated with delivering a linker friendly framework

Comments

@ericstj
Copy link
Member

ericstj commented Aug 11, 2023

Error Blob

{
  "ErrorMessage": "Failed Attributes.OnlyKeepUsed.NullableOnConstraints",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Failure:

  Failed Attributes.OnlyKeepUsed.NullableOnConstraints [912 ms]
  Error Message:
     Custom attributes on `T' are not matching
  Expected: equivalent to <empty>
  But was:  < "System.Runtime.CompilerServices.NullableAttribute" >
  Extra (1): < "System.Runtime.CompilerServices.NullableAttribute" >

  Stack Trace:
     at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyCustomAttributes(ICustomAttributeProvider src, ICustomAttributeProvider linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 833
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyGenericParameters(IGenericParameterProvider src, IGenericParameterProvider linked, Boolean compilerGenerated) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 1077
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyMethodKept(MethodDefinition src, MethodDefinition linked, Boolean compilerGenerated) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 548
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyMethodInternal(MethodDefinition src, MethodDefinition linked, Boolean expectedKept, Boolean compilerGenerated) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 512
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyMethod(MethodDefinition src, MethodDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 496
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinitionKept(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 297
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinition(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 169
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinitionKept(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 271
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinition(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 169
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.Verify() in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 75
   at Mono.Linker.Tests.TestCasesRunner.ResultChecker.Check(LinkedTestCaseResult linkResult) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs:line 102
   at Mono.Linker.Tests.TestCases.All.Run(TestCase testCase) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs:line 299
   at Mono.Linker.Tests.TestCases.All.AttributesTests(TestCase testCase) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs:line 34
   at InvokeStub_All.AttributesTests(Object, Span`1)

Reproduction Steps

No response

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=371500
Error message validated: Failed Attributes.OnlyKeepUsed.NullableOnConstraints
Result validation: ❌ Known issue did not match with the provided build.
Validation performed at: 8/11/2023 9:53:00 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
@ericstj ericstj added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels Aug 11, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 11, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 11, 2023
@ericstj ericstj added linkable-framework Issues associated with delivering a linker friendly framework area-Tools-ILLink .NET linker development as well as trimming analyzers and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 11, 2023
@ghost
Copy link

ghost commented Aug 11, 2023

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

Error Blob

{
  "ErrorMessage": "Failed Attributes.OnlyKeepUsed.NullableOnConstraints",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Failure:

  Failed Attributes.OnlyKeepUsed.NullableOnConstraints [912 ms]
  Error Message:
     Custom attributes on `T' are not matching
  Expected: equivalent to <empty>
  But was:  < "System.Runtime.CompilerServices.NullableAttribute" >
  Extra (1): < "System.Runtime.CompilerServices.NullableAttribute" >

  Stack Trace:
     at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyCustomAttributes(ICustomAttributeProvider src, ICustomAttributeProvider linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 833
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyGenericParameters(IGenericParameterProvider src, IGenericParameterProvider linked, Boolean compilerGenerated) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 1077
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyMethodKept(MethodDefinition src, MethodDefinition linked, Boolean compilerGenerated) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 548
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyMethodInternal(MethodDefinition src, MethodDefinition linked, Boolean expectedKept, Boolean compilerGenerated) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 512
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyMethod(MethodDefinition src, MethodDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 496
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinitionKept(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 297
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinition(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 169
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinitionKept(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 271
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.VerifyTypeDefinition(TypeDefinition original, TypeDefinition linked) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 169
   at Mono.Linker.Tests.TestCasesRunner.AssemblyChecker.Verify() in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs:line 75
   at Mono.Linker.Tests.TestCasesRunner.ResultChecker.Check(LinkedTestCaseResult linkResult) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs:line 102
   at Mono.Linker.Tests.TestCases.All.Run(TestCase testCase) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs:line 299
   at Mono.Linker.Tests.TestCases.All.AttributesTests(TestCase testCase) in /_/src/tools/illink/test/Mono.Linker.Tests/TestCases/TestSuites.cs:line 34
   at InvokeStub_All.AttributesTests(Object, Span`1)

Reproduction Steps

No response

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=371500&view=results
Result validation: ⚠️ Validation could not be done without an Azure DevOps build URL on the issue. Please add it to the "Build: 🔎" line.
Validation performed at: 8/11/2023 9:32:53 PM UTC

Author: ericstj
Assignees: -
Labels:

blocking-clean-ci, untriaged, linkable-framework, Known Build Error, area-Tools-ILLink

Milestone: -

@ericstj ericstj added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' and removed blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Aug 11, 2023
@ericstj ericstj closed this as completed Aug 11, 2023
@ericstj ericstj reopened this Aug 11, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 11, 2023
@ericstj ericstj added the untriaged New issue has not been triaged by the area owner label Aug 11, 2023
@sbomer
Copy link
Member

sbomer commented Aug 11, 2023

Locally I saw that this started happening with the update to preview 7 in 5549f72. It looks like it has something to do with NullableAttribute definition being moved to the framework instead of generated into the output assembly, but I haven't root caused it yet. I also need to check why the update PR didn't hit this.

@ericstj
Copy link
Member Author

ericstj commented Aug 12, 2023

Looks like the linker tests are running during the build so this infrastructure can’t identify them unless we ignore all failures from those tests.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 12, 2023
@sbomer
Copy link
Member

sbomer commented Aug 12, 2023

The update PR didn't catch this because the illink test jobs only run for changes to the tools.illink subset:

- subset: tools_illink
include:
- src/tools/illink/*

Most of the other jobs specify at least some exclude paths, which has the counterintuitive effect that all paths not specified in the exclude paths (including for example global.json) will be evaluated for changes.

@ghost ghost removed in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner labels Aug 15, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants