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 solution-based graph builds when non 'well-known' project types are used #9384

Merged

Conversation

dfederm
Copy link
Contributor

@dfederm dfederm commented Nov 1, 2023

Fixes #9375

Previously, only projects which were SolutionProjectType.KnownToBeMSBuildFormat (handful of project type guids) would be considered. This would cause some projects in a sln to not be in the graph at all.

This change removes that check and in general brings solution-based graph construction slightly more aligned with how non-graph builds construct the metaproj (SolutionProjectGenerator). My ideal scenario would be that the graph would just directly call into SolutionProjectGenerator to create a metaproj and then use that as the entry point into the graph construction, but we would need to teach the metaproj the p2p protocol used for graph which is a bit more work. Maybe one day though :)

Change details:

  • Removed the check for SolutionProjectType.KnownToBeMSBuildFormat
  • Replaced the check for non-zero ProjectConfigurations with a call to SolutionFile.IsBuildableProject, which does that and also filters out SolutionProjectType.SolutionFolder
  • Replaced the check for projectConfiguration.IncludeInBuild and SolutionFile.ProjectShouldBuild with a call to SolutionProjectGenerator.WouldProjectBuild, which does both those checks.

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

My ideal scenario would be that the graph would just directly call into SolutionProjectGenerator to create a metaproj and then use that as the entry point into the graph construction, but we would need to teach the metaproj the p2p protocol used for graph which is a bit more work.

Agreed on both the ideal behavior and the decision to not do it right now.

@AR-May AR-May requested a review from rokonec November 14, 2023 14:34
src/Build/Graph/GraphBuilder.cs Show resolved Hide resolved
@JanKrivanek JanKrivanek merged commit 7b37a28 into dotnet:main Nov 23, 2023
8 checks passed
@dfederm dfederm deleted the dfederm/fix-graph-non-wellknown-proj branch December 1, 2023 22:21
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.

[Bug]: Hang and/or MSB0001 when building terminal repo with /graph
5 participants