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

Return all error messages instead of throwing on the first error in linker tests #97605

Merged
merged 5 commits into from
Feb 2, 2024

Conversation

jtschuster
Copy link
Member

@jtschuster jtschuster commented Jan 28, 2024

Debugging the linker tests would be easier if we could see all the missing/extra members/warnings, but the tests currently throw an exception at the first unexpected thing. Instead, we could return a sequence of error messages to make it easier to see a pattern in the missing members and make debugging easier.

@jtschuster jtschuster added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Jan 28, 2024
@ghost
Copy link

ghost commented Jan 28, 2024

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

Debugging the linker would be easier if we could see all the missing members in the tests, but the tests currently fail at the first missing/extra member. Instead, we should return a sequence of error messages to make it easier to see a pattern in the missing members and make debugging easier.

Author: jtschuster
Assignees: -
Labels:

area-Tools-ILLink

Milestone: -

@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Jan 28, 2024
@ghost ghost assigned jtschuster Jan 28, 2024
@ghost
Copy link

ghost commented Jan 28, 2024

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

Debugging the linker would be easier if we could see all the missing members in the tests, but the tests currently fail at the first missing/extra member. Instead, we should return a sequence of error messages to make it easier to see a pattern in the missing members and make debugging easier.

Author: jtschuster
Assignees: -
Labels:

linkable-framework, area-Tools-ILLink

Milestone: -

Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

Overall looks good, but we should try to keep the structure of the nativeaot AssemblyChecker similar. Would you mind making the same kind of change there too?

@jtschuster
Copy link
Member Author

Overall looks good, but we should try to keep the structure of the nativeaot AssemblyChecker similar. Would you mind making the same kind of change there too?

Made the same changes for NativeAOT. A few places still assert for invalid test parameters or failing to resolve a reference, but all the Verify... methods return a list of error messages and concat them before throwing.

Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

LGTM once it builds and tests pass. Thanks!

@jtschuster
Copy link
Member Author

Failures are known.

@jtschuster jtschuster merged commit 0213697 into dotnet:main Feb 2, 2024
134 of 136 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2024
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 linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants