Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

[feature/damAnalyzer] Merge changes from release/6.0.2xx - #2344

Merged
sbomer merged 27 commits into
dotnet:feature/damAnalyzerfrom
sbomer:updateFrom602
Nov 1, 2021
Merged

sbomer merged 27 commits into
dotnet:feature/damAnalyzerfrom
sbomer:updateFrom602

Conversation

@sbomer

@sbomer sbomer commented Oct 29, 2021

Copy link
Copy Markdown
Member

No description provided.

mateoatr and others added 26 commits October 1, 2021 22:39
* Add COM Analyzer

* Add IsComInterop
Run Interop tests

* PR feedback

* Rename variables in GetTestFilesByDirName
Fully compare ldstr with values.
Compare all tokens in instructions.

Updated all the tests which were missing strings and tokens in the expected instructions.
* Add COM Analyzer

* Add IsComInterop
Run Interop tests

* PR feedback

* Rename variables in GetTestFilesByDirName

* Extend ProducedBy with enum values for each supported analyzer

* Lint

* PR feedback

* Return ProducedBy instead of list
The Ubuntu 16.04 agents were removed from Azure DevOps: actions/runner-images#3287
Actually compare the contents of the embedded resource (not just its existence).
* Nullable annotations part 4 (final)

* PR feedback

- Clean up extra variables introduced as
  nullable versions of existing variables.

* Fix a few annotations

- TryGetMethodStubValue may return null when true
- GetReturnType and GetParameterType may return null in some cases

* More annotations and PR feedback

- Don't resolve a generic typeref that should already be a typedef
- Remove some redundant null checks
- Turn on nullable annotations for ref assembly
- Remove #nullable disable section

* Clean up GetInflatedDeclaringType

- Remove null check
- Replace TryResolve call with an assert
- Add comment and asserts justifying null-forgiving operator

* Replace exception with assert in accessors

* PR feedback

- Add parens to improve readability
- Throw on diagnostic without message
- Remove unnecessary string.empty

* Undo DiagnosticString change

- Some DiagnosticIds intentionally have no fixed format strings because
  we generate different strings in different circumstances.
* Use all analyzers for each linker's test run

* Remove SimpleAnalyzerOptions from CSharpAnalyzerVerifier
Merge main back to release/6.0.2xx
…cases in the TestExplorer (dotnet#2337)

* Improve analyzer test infra to split linker tests into separate test cases in the TestExplorer
xUnit will not split the test cases if the parameters to the Theory are complex objects. But if the parameter is a single string it will do it. So using a trick to store a string->object mapping and identify the tests by the string. When the test is executed the object representation is looked up from the string and executed.
* Add ProducedBy to LogContains attribute to handle the static ctor warning discrepancies between linker and analyzer
* Remove analyzer specific information in RunTest since now we run all analyzers at the same time
Add logic to check some of the Ruc on type analysis warnings
Change field and event signature to match analyzer and linker to a single signature mode
Add class as a diagnostic target
Fix issue where attributes ProducedBy.Trimmer/ProducedBy.All are skipped if they are surrounded by ProducedBy.Analyzer attributes
Bring IsConstructor and IsStaticConstructor from Roslyn source
Remove special case for printing warnings in the event instead of the caller of the event accessor

Scenarios of Ruc on type that are not addressed by this PR:
Dealing with interfaces with RUC and having a class implementing it
DAM interaction with RUC
Reflection patterns, some of the tests work because they use typeof() but in general, they are not supported
@sbomer
sbomer requested a review from marek-safar as a code owner October 29, 2021 22:02
@sbomer

sbomer commented Oct 29, 2021

Copy link
Copy Markdown
Member Author

The recent changes that run tests with all analyzers enabled are causing #2308 to show up in more places here. We'll probably want to fix that rather than disabling the failing tests like I did in #2307.

@tlakollo

tlakollo commented Oct 29, 2021 •

Copy link
Copy Markdown
Contributor

The recent changes that run tests with all analyzers enabled are causing #2308 to show up in more places here. We'll probably want to fix that rather than disabling the failing tests like I did in #2307.

Just to double-check, the RAF analyzer is not running because we didn't pass the MSBuildOptions.EnableSingleFileAnalyzer yet. And the Interop files don't have any errors so I guess is just that some changes in that PR exacerbated #2308, right?

@sbomer

sbomer commented Nov 1, 2021

Copy link
Copy Markdown
Member Author

That's right - sorry, I meant the changes that run tests with all trim analyzers. Those changes are exacerbating #2308. For example the failures in the RequiresCapability tests are coming from the DAM analyzer which didn't used to run on that testcase.

@tlakollo

tlakollo commented Nov 1, 2021

Copy link
Copy Markdown
Contributor

Considering that there is already a PR that has a fix for the spurious IL2082 and that other PRs will fail without the fix
Switch to ubuntu 20.04 agents (dotnet#2322) I think is best to merge this PR and pollute the branch while we merge #2348

@sbomer
sbomer requested a review from tlakollo November 1, 2021 20:37

@tlakollo tlakollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@sbomer
sbomer merged commit 2ed8172 into dotnet:feature/damAnalyzer Nov 1, 2021
@sbomer
sbomer deleted the updateFrom602 branch February 22, 2022 18:13
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
[feature/damAnalyzer] Merge changes from release/6.0.2xx

Commit migrated from dotnet/linker@2ed8172
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants