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

Fix issue in metering generator when cyclic references causes VS to crash #4231

Merged
merged 6 commits into from
Aug 2, 2023

Conversation

dariusclay
Copy link
Contributor

@dariusclay dariusclay commented Aug 1, 2023

If a strong typed metering class contains cyclic type references it will lead to a stack overflow.

Fixes #4228

This change detects any cycles and emits R9G071: A metric class has cycles in its type hierarchy

Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned dariusclay Aug 1, 2023
@dariusclay dariusclay marked this pull request as ready for review August 1, 2023 15:35
Copy link
Contributor Author

@dariusclay dariusclay Aug 1, 2023

Choose a reason for hiding this comment

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

We could extract Microsoft.Gen.Logging/Parsing/TransitiveTypeCycleException into a shared area and reuse it here.

@@ -147,7 +147,7 @@ This sets up necessary environmental variables and opens the repository in VS Co
* The file format is an MSBuild Binary Log. Install the [MSBuild Structured Log Viewer][msbuild-log-viewer] to view them.
* Windows Forms uses Visual Studio MSBuild but for certain features we require the latest MSBuild from .NET Core/.NET SDK. If you are on an official version of [Visual Studio][VS-download] (i.e. not a Preview version), then you may need to enable previews for .NET Core/.NET SDKs in VS.
* you can do this in VS under Tools->Options->Environment->Preview Features->Use previews of the .Net Core SDK (Requires restart)

* When restoring packages, if you get the following message: "The SSL connection could not be established, see inner exception. Unable to read data from the transport connection", try disabling IPv6 on your network adapter.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is dealing with an issue I had when getting the project to build locally. I spent more time than I wanted to on it.

@geeknoid geeknoid merged commit 3bc2b7e into dotnet:main Aug 2, 2023
@ghost ghost added this to the 8.0 RC1 milestone Aug 2, 2023
@dariusclay dariusclay deleted the dariusclay/meter-gen branch August 3, 2023 09:18
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2023
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.

Metering source-gen crashes VS if GUID property is in strong-type dims
3 participants