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

Clean up debugger attributes tests. #89011

Merged

Conversation

mrvoorhe
Copy link
Contributor

  • Remove SetupLinkerKeepDebugMembersAttribute. This isn't supported anymore by the linker.

  • Remove NETCOREAPP behavior difference in debugger attribute removal tests

  • Move DebuggerDisplayAttributeOnTypeWithNonExistentMethod to the KeepDebugMembers folder since that is the scenario this test is testing

@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Jul 17, 2023
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 17, 2023
@ghost
Copy link

ghost commented Jul 17, 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
  • Remove SetupLinkerKeepDebugMembersAttribute. This isn't supported anymore by the linker.

  • Remove NETCOREAPP behavior difference in debugger attribute removal tests

  • Move DebuggerDisplayAttributeOnTypeWithNonExistentMethod to the KeepDebugMembers folder since that is the scenario this test is testing

Author: mrvoorhe
Assignees: -
Labels:

area-Debugger-mono, linkable-framework

Milestone: -

@mrvoorhe
Copy link
Contributor Author

@vitek-karas Do I have to do something to get the tests to rerun? The failure about

src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs(30,57): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'SetupLinkerKeepDebugMembersAttribute' does not exist in the current context

Seems out of date. I deleted that line.

@sbomer
Copy link
Member

sbomer commented Jul 18, 2023

Note the error is for a file in src/coreclr/tools/aot, not src/tools/illink.

@mrvoorhe
Copy link
Contributor Author

Note the error is for a file in src/coreclr/tools/aot, not src/tools/illink.

I did not see that coming! A copy of Mono.Linker.Tests\TestCasesRunner 🙈

* Remove `SetupLinkerKeepDebugMembersAttribute`.  This isn't supported anymore by the linker.

* Remove NETCOREAPP behavior difference in debugger attribute removal tests

* Move `DebuggerDisplayAttributeOnTypeWithNonExistentMethod` to the `KeepDebugMembers` folder since that is the scenario this test is testing
@mrvoorhe mrvoorhe force-pushed the linker-debug-attrs-test-cleanup branch from b356e61 to e38c157 Compare July 18, 2023 18:52
@vitek-karas
Copy link
Member

A copy of Mono.Linker.Tests\TestCasesRunner

Yeah - it's good and bad. It's good since we share the tests between illink and NativeAOT. It's bad because it's the same mess as in illink, just slightly different.

When I get some time I want to:

  • Rename the assembly for NativeAOT - currently it's the same name between illink/NativeAOT and it can do bad things to CI/local builds sometimes
  • See if we could refactor the runner to share code between the two in some easy way

@mrvoorhe
Copy link
Contributor Author

Rename the assembly for NativeAOT - currently it's the same name between illink/NativeAOT and it can do bad things to CI/local builds sometimes

I think that's worth doing. If the file names had been different that might have been enough to get my brain to notice it was a different copy of TestCaseMetadataProvider.cs.

See if we could refactor the runner to share code between the two in some easy way

I didn't look it too closely but maybe you could share more following the pattern we do with UnityLinker's test suite. We inherit and override things.

C:\UnitySrc\dev>cd C:\UnitySrc\dev\il2cpp-12\Unity.Linker.Tests\TestCaseRunner\

C:\UnitySrc\dev\il2cpp-12\Unity.Linker.Tests\TestCaseRunner>dir
 Volume in drive C is Windows
 Volume Serial Number is CA0A-0107

 Directory of C:\UnitySrc\dev\il2cpp-12\Unity.Linker.Tests\TestCaseRunner

06/02/2023  01:25 PM    <DIR>          .
06/22/2023  01:01 PM    <DIR>          ..
02/09/2023  05:11 PM             4,833 CoreUtils.cs
02/09/2023  05:11 PM             3,479 ILDumper.cs
10/25/2021  03:27 PM    <DIR>          Invoking
09/23/2021  12:29 PM             8,618 OutputChecker.cs
02/09/2023  05:11 PM             2,596 StubAssertionUtils.cs
06/02/2023  01:25 PM             5,725 UnityAssemblyChecker.cs
05/19/2021  08:52 AM               413 UnityCompilerOptions.cs
10/14/2021  10:22 AM             1,327 UnityILCompiler.cs
02/09/2023  05:11 PM             3,456 UnityLinker.cs
02/09/2023  05:11 PM            16,104 UnityLinkerArgumentBuilder.cs
05/19/2021  08:52 AM               947 UnityLinkerArgumentBuilderEditorMode.cs
03/03/2022  01:54 PM             5,013 UnityObjectFactory.cs
03/03/2022  01:54 PM             1,044 UnityObjectFactoryEditorMode.cs
02/09/2023  05:11 PM             4,710 UnityPeVerifier.cs
04/21/2023  09:19 AM            42,403 UnityResultChecker.cs
05/19/2021  08:52 AM               420 UnitySetupCompileInfo.cs
02/09/2023  05:11 PM             3,268 UnityTestCaseAssemblyResolver.cs
02/09/2023  05:11 PM             8,014 UnityTestCaseCompilationMetadataProvider.cs
02/09/2023  05:11 PM            14,233 UnityTestCaseCompiler.cs
02/09/2023  05:11 PM            12,209 UnityTestCaseMetadataProvider.cs
04/24/2023  11:53 AM             5,605 UnityTestCaseSandbox.cs
06/02/2023  01:25 PM             5,199 UnityTestRunner.cs
02/09/2023  05:11 PM             3,144 UnityTestRunnerEditorMode.cs

We have a lot of the same files. They just inherit and extend rather than copy whole sale from upstream.

Then again, maybe you're use case is different enough that trying to follow the same pattern would lead to more api breaks for us, in which case feel free to stick with copying whole sale 😄

@mrvoorhe
Copy link
Contributor Author

@vitek-karas I think these changes are good now?

@vitek-karas
Copy link
Member

In the product we went with source sharing and partial types typically. But it was mostly for performance reasons to avoid casting a virtual calls everywhere. I would need to look into this some more which approach would work best for the tests.

@vitek-karas vitek-karas merged commit 4c356de into dotnet:main Jul 19, 2023
115 of 119 checks passed
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Debugger-mono community-contribution Indicates that the PR has been added by a community member linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants