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

Continue analysis even RuntimeInformation, OSPlatofrm types not loaded #4281

Merged
merged 8 commits into from
Oct 7, 2020

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Oct 2, 2020

As part of dotnet/runtime#42335 we need to ensure that each of runtime projects can produce warnings/errors from the platform compat analyzer during a normal build. There are several projects not having access to the System.Runtime.InteropServices.RuntimeInformation, System.Runtime.InteropServices.OSPlatofrm which are used as one of the guard methods for the analzyer. Normally we bail out when any of the types used for the analysis is not loaded/found, but the types mentioned are not essential for the analysis we want to continue the analysis in that case and get warnings if there is any.

@buyaa-n buyaa-n requested a review from a team as a code owner October 2, 2020 21:24
@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@5ca20e8). Click here to learn what that means.
The diff coverage is 99.24%.

@@            Coverage Diff            @@
##             master    #4281   +/-   ##
=========================================
  Coverage          ?   95.80%           
=========================================
  Files             ?     1168           
  Lines             ?   265259           
  Branches          ?    15985           
=========================================
  Hits              ?   254143           
  Misses            ?     9095           
  Partials          ?     2021           

Copy link
Contributor

@mavasani mavasani left a comment

Choose a reason for hiding this comment

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

Overall LGTM, have some trivial suggestions.

Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

Is it possible to add a test to avoid any regression?

@buyaa-n
Copy link
Contributor Author

buyaa-n commented Oct 7, 2020

I have tested runtime build by enabling the analyzer when other types (System.OperatingSystem and System.String) also not found, but that didn't reveal any new warning so going to keep the code bail out when they are not loaded.

While doing that test found a bug: IOOB exception thrown when the OSPlatform type is not loaded which is silently swallowed by the IDE and no more diagnostics take place. Fixed the bug, now this PR is ready for merge @mavasani if you would like to take another look

@buyaa-n
Copy link
Contributor Author

buyaa-n commented Oct 7, 2020

Gonna merge it now if there are any questions/comments feel free to add, will apply/answer then separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants