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

Replace Buildalyzer from CSharpProject #3112

Merged
merged 5 commits into from
Aug 26, 2023

Conversation

ocallesp
Copy link
Contributor

@ocallesp ocallesp commented Jul 31, 2023

This Pull Request seeks to eliminate all dependencies on Buildalyzer, due to its frequent breakdown during runtime. The instability can be attributed to frequent changes in the binlog format, necessitating either a regular update of Buildalyzer to the latest version supporting the new format, or the submission of respective updates to the Buildalyzer project repository.

This update involves numerous changes, the crux of which is a revision to the build process. During the build, a temporary file named Directory.Build.Targets is generated. This file initiates the creation of a target called DirectoryBuildTargetsContent which, in turn, generates a cache file containing all the necessary data to create a Roslyn Workspace object.

Subsequent to this update, instead of analyzing a binlog, the system reads from the cache file to create a Workspace, providing a more stable and efficient solution.

@ocallesp ocallesp force-pushed the remove-buildalyzer-with-cache-file branch 2 times, most recently from 291986b to 8e6b37c Compare August 1, 2023 05:04
@ocallesp ocallesp force-pushed the remove-buildalyzer-with-cache-file branch 6 times, most recently from 464a31f to c65083c Compare August 1, 2023 08:16
@ocallesp ocallesp mentioned this pull request Aug 1, 2023
@ocallesp ocallesp force-pushed the remove-buildalyzer-with-cache-file branch from 84194a3 to cbf181b Compare August 1, 2023 20:34
@ocallesp
Copy link
Contributor Author

ocallesp commented Aug 2, 2023

@colombod Fixed the issue with Document Ids in the last commit.

These are the 3 remaining unit-tests

image

@ocallesp ocallesp force-pushed the remove-buildalyzer-with-cache-file branch from cc3989b to 31be419 Compare August 21, 2023 19:49
@ocallesp
Copy link
Contributor Author

ocallesp commented Aug 21, 2023

I removed the last commit and did a git rebase onto upstream main to get the package upgrade in Markdig.Signed

Can someone approve ?

@ocallesp ocallesp force-pushed the remove-buildalyzer-with-cache-file branch 2 times, most recently from d74fa02 to 47aae5b Compare August 22, 2023 00:17
@ocallesp ocallesp force-pushed the remove-buildalyzer-with-cache-file branch from 47aae5b to dd529dd Compare August 22, 2023 00:53
@@ -47,7 +47,7 @@ internal static BuildDataResults GetResultsFromCacheFile(string cacheFilePath)
CSharpParseOptions = cSharpParseOptions
};
}
catch (Exception)
catch (ArgumentNullException)
{
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we hiding an exception here at all? This is presumably happening due to a bug in our code.

@@ -172,8 +172,7 @@ public static CodeAnalysis.Project AddToWorkspace(BuildProjectData analyzerResul
ProjectInfo projectInfo = GetProjectInfo(analyzerResult, workspace, projectId);
if (projectInfo is null)
{
// Error
return null;
throw new ArgumentNullException(nameof(projectInfo));
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the correct exception type, since it's not an argument.

What causes projectInfo to be null? Is it due to a bug somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll push a cleanup pr to fix this

@ocallesp ocallesp merged commit 4ad53d9 into dotnet:main Aug 26, 2023
4 checks passed
@ocallesp ocallesp deleted the remove-buildalyzer-with-cache-file branch August 27, 2023 23:11
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.

4 participants