Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
AssemblyChecker.Tests lacks a test-framework reference, preventing the registered test project from compiling.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates AssemblyChecker dependency resolution to find adjacent assemblies during metadata inspection, with regression coverage.
Changes:
- Adds per-assembly probing with runtime fallback.
- Adds external-attribute test fixtures and regression coverage.
- Registers the tests in
clr.toolstests.
| File | Summary |
|---|---|
src/coreclr/tools/AssemblyChecker/AssemblyInspector.cs |
Adds adjacent-directory dependency resolution. |
src/coreclr/tools/AssemblyChecker/AssemblyChecker.csproj |
Grants test access to internals. |
src/coreclr/tools/AssemblyChecker.Tests/TestAssets/ExternalAttribute/ReferencedAssemblyAttribute.cs |
Defines the external attribute dependency. |
src/coreclr/tools/AssemblyChecker.Tests/TestAssets/ExternalAttribute/ExternalAttribute.csproj |
Configures the external-attribute fixture. |
src/coreclr/tools/AssemblyChecker.Tests/TestAssets/AssemblyWithExternalAttribute/Marker.cs |
Defines the assembly-level attribute usage. |
src/coreclr/tools/AssemblyChecker.Tests/TestAssets/AssemblyWithExternalAttribute/AssemblyWithExternalAttribute.csproj |
Configures the assembly test fixture. |
src/coreclr/tools/AssemblyChecker.Tests/AssemblyInspectorTests.cs |
Tests adjacent attribute resolution. |
src/coreclr/tools/AssemblyChecker.Tests/AssemblyChecker.Tests.csproj |
Defines the regression test project. |
eng/Subsets.props |
Includes the tests in clr.toolstests. |
Comment on lines
+9
to
+12
| <ItemGroup> | ||
| <ProjectReference Include="../AssemblyChecker/AssemblyChecker.csproj" /> | ||
| <ProjectReference Include="TestAssets/AssemblyWithExternalAttribute/AssemblyWithExternalAttribute.csproj" /> | ||
| </ItemGroup> |
Member
|
#133622 is a better way to fix this. There is no reason for AssemblyChecker to resolve dependencies in the first place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
AssemblyCheckerusesMetadataLoadContextto inspect assembly attributes without retaining file locks. Its resolver only searched the runtime directory, causing inspection to fail when a custom attribute referenced an assembly located beside the inspected assembly.Update the resolver to:
This prevents repeated
FileNotFoundExceptioncrashes and the resulting crash dumps that could exhaust CI worker disk space.Test coverage
Added an
AssemblyChecker.Testsregression test with an assembly-level attribute defined in an adjacent assembly. The test fails with the previous implementation and passes with the updated resolver.Validated with:
clr.toolstestssubset.Resolves #134296
Note
This pull request description was generated with GitHub Copilot.