Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Replace Buildalyzer from CSharpProject#3112

Merged
ocallesp merged 5 commits into
dotnet:mainfrom
ocallesp:remove-buildalyzer-with-cache-file
Aug 26, 2023
Merged

Replace Buildalyzer from CSharpProject#3112
ocallesp merged 5 commits into
dotnet:mainfrom
ocallesp:remove-buildalyzer-with-cache-file

Conversation

@ocallesp

@ocallesp ocallesp commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

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 mentioned this pull request Aug 1, 2023
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/BuildCacheFileUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/RoslynWorkspaceUtilities.cs Outdated
@ocallesp

ocallesp commented Aug 2, 2023

Copy link
Copy Markdown
Contributor Author

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

These are the 3 remaining unit-tests

image

Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/Packaging/PackageBase.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/Packaging/ProjectAsset.cs Outdated
Comment thread src/Microsoft.DotNet.Interactive.CSharpProject/Packaging/PackageBase.cs Outdated

namespace Microsoft.DotNet.Interactive.CSharpProject.RoslynWorkspaceUtilities;

public class BuildDataResults

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this need to be public?

For every type introduced, we should make it internal if it's simple to do so. For the ones where it's less clear (for example you're using them in unit tests), let's have a discussion when we meet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In order to accomplish this, I will need to make other classes 'internal'.

I can implement these changes once I gain a clearer understanding of which APIs the service will utilize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's better to make them internal until a clear need for them to be public emerges.

The main public methods that the Try .NET web service will need to call will be the kernel commands and events, and this infrastructure should be an implementation detail.

@ocallesp

ocallesp commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

Git squash

@ocallesp

ocallesp commented Aug 21, 2023

Copy link
Copy Markdown
Contributor Author

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 enabled auto-merge August 21, 2023 20:34
Comment thread src/Microsoft.DotNet.Interactive/Utility/Dotnet.cs Outdated
@ocallesp
ocallesp requested a review from jonsequitur August 22, 2023 01:06
@ocallesp
ocallesp requested a review from jonsequitur August 25, 2023 17:19
catch (Exception)
catch (ArgumentNullException)
{
return null;

Copy link
Copy Markdown
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.

{
// Error
return null;
throw new ArgumentNullException(nameof(projectInfo));

Copy link
Copy Markdown
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
Copy Markdown
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
@ocallesp
ocallesp deleted the remove-buildalyzer-with-cache-file branch August 27, 2023 23:11
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.

4 participants