-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add arcade-powered-source-build local and ci builds #4930
Add arcade-powered-source-build local and ci builds #4930
Conversation
83fe8ec
to
8133033
Compare
Codecov Report
@@ Coverage Diff @@
## main #4930 +/- ##
==========================================
+ Coverage 95.54% 95.59% +0.04%
==========================================
Files 1185 1188 +3
Lines 272465 272671 +206
Branches 16428 16472 +44
==========================================
+ Hits 260338 260649 +311
+ Misses 10001 9895 -106
- Partials 2126 2127 +1 |
8133033
to
35ce29a
Compare
/// <param name="namedTypeSymbol">Named type symbol, if any.</param> | ||
/// <returns>True if found in the compilation, false otherwise.</returns> | ||
- [PerformanceSensitive("https://github.com/dotnet/roslyn-analyzers/issues/4893", AllowCaptures = false)] | ||
+ // [PerformanceSensitive("https://github.com/dotnet/roslyn-analyzers/issues/4893", AllowCaptures = false)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes this error I was seeing:
roslyn-analyzers/artifacts/source-build/self/src/src/Utilities/Compiler/WellKnownTypeProvider.cs(87,10): error CS0122: 'PerformanceSensitiveAttribute' is inaccessible due to its protection level [roslyn-analyzers/artifacts/source-build/self/src/src/Microsoft.CodeAnalysis.Analyzers/Core/Microsoft.CodeAnalysis.Analyzers.csproj]
I have no idea what the consequences of this change might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error would be reported if the build incorrectly omitted Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers, which is a required analyzer package.
35ce29a
to
55d6a13
Compare
@@ -32,6 +32,7 @@ | |||
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'type_or_member' (but other type parameters do) | |||
--> | |||
<NoWarn Condition="'$(Language)' == 'C#'">$(NoWarn),1573,1591,1712</NoWarn> | |||
<NoWarn Condition=" '$(DotnetBuildFromSource)' == 'true' ">$(NoWarn);AD0001;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8609;CS8619;CS8620;CS8625;CS8621;CS8631;CS8714;CS8762;CS8765;IDE0005</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some feedback about the CS
warnings (safe to disable), but not sure about the AD
ones... looks like the VB analogue of CS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be moved to a conditionally-included .globalconfig in eng/config/globalconfigs. See dotnet/roslyn for an example:
https://github.com/dotnet/roslyn/tree/main/eng/config/globalconfigs
azure-pipelines.yml
Outdated
parameters: | ||
- platform: | ||
name: 'Managed' | ||
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplicates the contents eng/common/templates/jobs/source-build.yaml
. Is there some way to just delegate to that (but only for source-build)?
55d6a13
to
ff96e2d
Compare
@jmarolf Can you please review? |
@@ -32,6 +32,7 @@ | |||
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'type_or_member' (but other type parameters do) | |||
--> | |||
<NoWarn Condition="'$(Language)' == 'C#'">$(NoWarn),1573,1591,1712</NoWarn> | |||
<NoWarn Condition=" '$(DotnetBuildFromSource)' == 'true' ">$(NoWarn);AD0001;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8609;CS8619;CS8620;CS8625;CS8621;CS8631;CS8714;CS8762;CS8765;IDE0005</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AD0001 should not be in this list.
@@ -32,6 +32,7 @@ | |||
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'type_or_member' (but other type parameters do) | |||
--> | |||
<NoWarn Condition="'$(Language)' == 'C#'">$(NoWarn),1573,1591,1712</NoWarn> | |||
<NoWarn Condition=" '$(DotnetBuildFromSource)' == 'true' ">$(NoWarn);AD0001;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8609;CS8619;CS8620;CS8625;CS8621;CS8631;CS8714;CS8762;CS8765;IDE0005</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CS8600 and many others in this list fall under nullable
. If there is intent to disable all NRT warnings, all items under the nullable
identifier umbrella should be removed from this list, and nullable
used by name instead.
@@ -32,6 +32,7 @@ | |||
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'type_or_member' (but other type parameters do) | |||
--> | |||
<NoWarn Condition="'$(Language)' == 'C#'">$(NoWarn),1573,1591,1712</NoWarn> | |||
<NoWarn Condition=" '$(DotnetBuildFromSource)' == 'true' ">$(NoWarn);AD0001;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8609;CS8619;CS8620;CS8625;CS8621;CS8631;CS8714;CS8762;CS8765;IDE0005</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE0005 should not be in this list.
--- a/RoslynAnalyzers.sln | ||
+++ b/RoslynAnalyzers.sln |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗ We should not patch RoslynAnalyzers.sln. If you need to build a subset of projects, create a SourceBuild.slnf solution filter, which is derived from RoslynAnalyzers.sln and only contains the projects needed for the build.
<CodeStyleAnalyersVersion>$(MicrosoftNETCoreCompilersPackageVersion)</CodeStyleAnalyersVersion> | ||
<!-- Roslyn --> | ||
<MicrosoftCodeAnalysisVersion>3.3.1</MicrosoftCodeAnalysisVersion> | ||
+ <MicrosoftCodeAnalysisCommonVersion>3.3.1</MicrosoftCodeAnalysisCommonVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is going to break every time we update the code analysis version. We should find a different approach.
- <TargetFramework>netstandard1.3</TargetFramework> | ||
+ <TargetFramework>netstandard2.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
netstandard1.3 is the correct target for this package. Builds using netstandard2.0 would not be correct.
- <TargetFramework>net46</TargetFramework> | ||
+ <TargetFramework>netstandard2.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗ None of the *.Setup.csproj projects should be included in the solution filter which is used for source build. As such, no changes are expected to any of them.
|
||
default: | ||
- Debug.Fail($"Unknown FixAllScope '{fixAllContext.Scope}'"); | ||
+ Debug.Fail($"Unknown FixAllScope '{fixAllContext.Scope!}'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😕 Why the suppression here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patches here are producing a totally different build than the repository. If we aren't going to build the real branch properly, we need to make a new branch which contains the code used for source build so it's clear the two build outputs are not equivalent. This branch would not need or use any patches.
@crummel @dseefeld @MichaelSimons any thoughts about the separate branching? |
ff96e2d
to
437b074
Compare
I am going to echo something @dagood wrote here:
I dont think a separate branch will work. https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/implementation-plan.md#stage-descriptions says:
The end goal is that the exact same git commit that produces official releases can be used for source-build. |
I echo @omajid's comments above. Creating a branch defeats the purpose of what we're trying to do with Arcade-powered source-build. The goal is to build source-build alongside the official build to ensure that all repos can be built from source, rather than doing this after the fact during a release. The patches represent changes that the source-build team has made to be able to build the repo with source-build. The idea is that these would be merged in and maintained in the main code base and that an additional source-build PR validation build would be added to exercise them. |
I don't believe the proposed approach is maintainable for individual repositories (i.e. the division of work pushes too many changes from devops to individual repository contributors). This impairs the ability to be a proper open source project with external contributors, and the value to those contributors is minimal if any. I would prefer the design be revisited before trying to add it to the main branch. |
@@ -32,6 +32,7 @@ | |||
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'type_or_member' (but other type parameters do) | |||
--> | |||
<NoWarn Condition="'$(Language)' == 'C#'">$(NoWarn),1573,1591,1712</NoWarn> | |||
<NoWarn Condition=" '$(DotnetBuildFromSource)' == 'true' ">$(NoWarn);AD0001;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8609;CS8619;CS8620;CS8625;CS8621;CS8631;CS8714;CS8762;CS8765;IDE0005</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear why source build would be different from normal builds here. We have warnings treated as errors in our build, and the build is clean. If these warnings start to show up for source build, then source build is by definition not matching our actual build and cannot be considered valid.
@@ -0,0 +1,23 @@ | |||
<Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ Can we move the source build supporting files to a subfolder?
There are so many problems with the proposed patches, it's really difficult for me to see a viable path from this proposal forward to something that works. It certainly seems easier to just remove all of them, and work through the resulting issues by making the build machine match repository expectations rather than trying to update the code to a different reality. The number/severity of deviations in the resulting artifacts certainly warrants a new branch, if not an entirely different fork. |
Thanks for merging this! Please let me know how you want to coordinate a cleanup. |
This enables 'source-build', which makes it easier to build the entire shipping .NET SDK from source.
This is the first and second step of arcade-powered-source-build: https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/README.md
See dotnet/sourcelink#692 for a similar PR, that this is based on.