Browse Source

Enable prebuilt detection (#47894)

* Enable prebuilt detection
- Add some missing depenencies with source-build tags
- Update baseline
- Remove some unused NuGet properties
- Remove old source build workaround
- Remove explicit reference to Microbuild.Core
- Pass DotNetBuildFromSource to the repo tasks inner build environment
Matt Mitchell 2 years ago
parent
commit
6d30638626

+ 1 - 0
eng/SourceBuild.props

@@ -43,6 +43,7 @@
     <ItemGroup>
       <!-- We need to flow FullAssemblySigningSupported even when building repo tasks because they use full signing -->
       <InnerBuildEnv Condition="'$(FullAssemblySigningSupported)' != ''" Include="FullAssemblySigningSupported=$(FullAssemblySigningSupported)" />
+      <InnerBuildEnv Include="DotNetBuildFromSource=true" />
     </ItemGroup>
 
     <!-- Call the build.sh script to build the repo tasks. Set IgnoreStandardErrorWarningFormat

+ 23 - 1
eng/SourceBuildPrebuiltBaseline.xml

@@ -1,5 +1,27 @@
 <UsageData>
   <IgnorePatterns>
-    <UsagePattern IdentityGlob="*/*" />
+    <UsagePattern IdentityGlob="Microsoft.SourceBuild.Intermediate.*/*" />
+
+    <!-- These are used in-build for repo-tasks and should come from previously source built -->
+    <UsagePattern IdentityGlob="NuGet.Common/*6.2.2*" />
+    <UsagePattern IdentityGlob="NuGet.Configuration/*6.2.2*" />
+    <UsagePattern IdentityGlob="NuGet.Frameworks/*6.2.2*" />
+    <UsagePattern IdentityGlob="NuGet.Packaging/*6.2.2*" />
+    <UsagePattern IdentityGlob="NuGet.Versioning/*6.2.2*" />
+
+    <!-- These are what the analyzers are built against. They are overridden in full source build.
+         It may be possible to generate SBRPs -->
+    <UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Analyzers/*2.9.4*" />
+    <UsagePattern IdentityGlob="Microsoft.CodeAnalysis.AnalyzerUtilities/*3.3.0*" />
+    <UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Common/*3.3.1*" />
+    <UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp/*3.3.1*" />
+    <UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp.Workspaces/*3.3.1*" />
+    <UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Workspaces.Common/*3.3.1*" />
+    <UsagePattern IdentityGlob="System.Composition/*1.0.31*" />
+    <UsagePattern IdentityGlob="System.Threading.Tasks.Extensions/*4.5.3*" />
+
+    <!-- These are coming in via runtime but the source-build infra isn't able to automatically pick up the right intermediate. -->
+    <UsagePattern IdentityGlob="Microsoft.NET.ILLink.Tasks/*8.0.*" />
+    <UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/*8.0.*" />
   </IgnorePatterns>
 </UsageData>

+ 41 - 0
eng/Version.Details.xml

@@ -285,6 +285,7 @@
     <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="8.0.0-preview.5.23227.1">
       <Uri>https://github.com/dotnet/runtime</Uri>
       <Sha>9ef03140e8e99f55f903e7caa48044c1a5885d85</Sha>
+      <SourceBuild RepoName="runtime" ManagedOnly="false" />
     </Dependency>
     <Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="8.0.0-preview.5.23227.1">
       <Uri>https://github.com/dotnet/runtime</Uri>
@@ -299,6 +300,29 @@
       <Sha>9a1c3e1b7f0c8763d4c96e593961a61a72679a7b</Sha>
       <SourceBuild RepoName="xdt" ManagedOnly="true" />
     </Dependency>
+    <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.23225.2">
+      <Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
+      <Sha>4bf273ec25cc3983d6a5991cf0a4aa082cb255a5</Sha>
+      <SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
+    </Dependency>
+    <!-- Not updated automatically -->
+    <Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.4.0-4.22520.2">
+      <Uri>https://github.com/dotnet/roslyn</Uri>
+      <Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
+      <SourceBuild RepoName="roslyn" ManagedOnly="true" />
+    </Dependency>
+    <Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.4.0-4.22520.2">
+      <Uri>https://github.com/dotnet/roslyn</Uri>
+      <Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
+    </Dependency>
+    <Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.4.0-4.22520.2">
+      <Uri>https://github.com/dotnet/roslyn</Uri>
+      <Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
+    </Dependency>
+    <Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0-4.22520.2">
+      <Uri>https://github.com/dotnet/roslyn</Uri>
+      <Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
+    </Dependency>
   </ProductDependencies>
   <ToolsetDependencies>
     <!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
@@ -311,6 +335,11 @@
       <Sha>d14c4adbdbb8c7ee060f9e333883fc9890939b66</Sha>
       <SourceBuild RepoName="arcade" ManagedOnly="true" />
     </Dependency>
+    <Dependency Name="Microsoft.SourceLink.GitHub" Version="8.0.0-beta.23218.3" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
+      <Uri>https://github.com/dotnet/sourcelink</Uri>
+      <Sha>47c52dd2ebf9edfd40abdcff999c13eb461f6ce2</Sha>
+      <SourceBuild RepoName="sourcelink" ManagedOnly="true" />
+    </Dependency>
     <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.23224.1">
       <Uri>https://github.com/dotnet/arcade</Uri>
       <Sha>d14c4adbdbb8c7ee060f9e333883fc9890939b66</Sha>
@@ -327,5 +356,17 @@
       <Uri>https://github.com/dotnet/arcade</Uri>
       <Sha>d14c4adbdbb8c7ee060f9e333883fc9890939b66</Sha>
     </Dependency>
+    <Dependency Name="NuGet.Frameworks" Version="6.2.2">
+      <Uri>https://github.com/nuget/nuget.client</Uri>
+      <Sha>027ca8b8ef4b4dc94995f87b9c441d2bcf742c1d</Sha>
+    </Dependency>
+    <Dependency Name="NuGet.Packaging" Version="6.2.2">
+      <Uri>https://github.com/nuget/nuget.client</Uri>
+      <Sha>027ca8b8ef4b4dc94995f87b9c441d2bcf742c1d</Sha>
+    </Dependency>
+    <Dependency Name="NuGet.Versioning" Version="6.2.2">
+      <Uri>https://github.com/nuget/nuget.client</Uri>
+      <Sha>027ca8b8ef4b4dc94995f87b9c441d2bcf742c1d</Sha>
+    </Dependency>
   </ToolsetDependencies>
 </Dependencies>

+ 19 - 7
eng/Versions.props

@@ -135,12 +135,25 @@
     <MicrosoftEntityFrameworkCoreToolsVersion>8.0.0-preview.4.23212.3</MicrosoftEntityFrameworkCoreToolsVersion>
     <MicrosoftEntityFrameworkCoreVersion>8.0.0-preview.4.23212.3</MicrosoftEntityFrameworkCoreVersion>
     <MicrosoftEntityFrameworkCoreDesignVersion>8.0.0-preview.4.23212.3</MicrosoftEntityFrameworkCoreDesignVersion>
+    <!-- Packages from dotnet/roslyn -->
+    <MicrosoftCodeAnalysisCommonVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCommonVersion>
+    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
+    <MicrosoftCodeAnalysisCSharpVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpVersion>
+    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
+    <!-- Packages from NuGet/Nuget.client -->
+    <NuGetPackagingVersion>6.2.2</NuGetPackagingVersion>
+    <NuGetVersioningVersion>6.2.2</NuGetVersioningVersion>
+    <NuGetFrameworksVersion>6.2.2</NuGetFrameworksVersion>
     <!-- Packages from dotnet/arcade -->
     <MicrosoftDotNetBuildTasksInstallersVersion>8.0.0-beta.23224.1</MicrosoftDotNetBuildTasksInstallersVersion>
     <MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23224.1</MicrosoftDotNetBuildTasksTemplatingVersion>
     <MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23224.1</MicrosoftDotNetRemoteExecutorVersion>
+    <!-- Packages from dotnet/source-link -->
+    <MicrosoftSourceLinkGitHubVersion>8.0.0-beta.23218.3</MicrosoftSourceLinkGitHubVersion>
     <!-- Packages from dotnet/source-build-externals -->
     <MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23221.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
+    <!-- Packages from dotnet/source-build-reference-packages -->
+    <MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23225.2</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>
     <!-- Packages from dotnet/xdt -->
     <MicrosoftWebXdtVersion>7.0.0-preview.22423.2</MicrosoftWebXdtVersion>
   </PropertyGroup>
@@ -166,6 +179,8 @@
     <MicrosoftExtensionsDiagnosticAdapterVersion>5.0.0-preview.3.20215.2</MicrosoftExtensionsDiagnosticAdapterVersion>
     <!-- Build tool dependencies -->
     <MicrosoftVSSDKBuildToolsVersion>15.9.3032</MicrosoftVSSDKBuildToolsVersion>
+    <!-- Manually updated version from 6.0.0 to address CVE-2021-43877 -->
+    <RepoTasksSystemSecurityCryptographyXmlVersion>6.0.1</RepoTasksSystemSecurityCryptographyXmlVersion>
     <!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 -->
     <MicrosoftCSharpVersion>4.7.0</MicrosoftCSharpVersion>
     <MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
@@ -212,10 +227,10 @@
     -->
     <Analyzer_MicrosoftCodeAnalysisCSharpVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpVersion>
     <Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>
-    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.4.0-3.22472.13</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
-    <MicrosoftCodeAnalysisCommonVersion>4.4.0-3.22472.13</MicrosoftCodeAnalysisCommonVersion>
-    <MicrosoftCodeAnalysisCSharpVersion>4.4.0-3.22472.13</MicrosoftCodeAnalysisCSharpVersion>
-    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.4.0-3.22472.13</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
+    <MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
+    <MicrosoftCodeAnalysisCommonVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCommonVersion>
+    <MicrosoftCodeAnalysisCSharpVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpVersion>
+    <MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
     <MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
     <MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.22531.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
     <MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.22531.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>
@@ -229,9 +244,6 @@
     <MicrosoftOwinTestingVersion>3.0.1</MicrosoftOwinTestingVersion>
     <MicrosoftWebAdministrationVersion>11.1.0</MicrosoftWebAdministrationVersion>
     <SystemIdentityModelTokensJwtVersion>6.21.0</SystemIdentityModelTokensJwtVersion>
-    <NuGetPackagingVersion>6.2.0</NuGetPackagingVersion>
-    <NuGetVersioningVersion>6.2.0</NuGetVersioningVersion>
-    <NuGetFrameworksVersion>6.2.0</NuGetFrameworksVersion>
     <SystemComponentModelAnnotationsVersion>5.0.0</SystemComponentModelAnnotationsVersion>
     <SystemNetExperimentalMsQuicVersion>5.0.0-alpha.20560.6</SystemNetExperimentalMsQuicVersion>
     <SystemSecurityPrincipalWindowsVersion>5.0.0</SystemSecurityPrincipalWindowsVersion>

+ 0 - 3
eng/Workarounds.targets

@@ -20,9 +20,6 @@
       '$(GenerateRazorAssemblyInfo)' == 'true'" />
   </ItemGroup>
 
-  <!-- Workaround https://github.com/dotnet/source-build/issues/1112. Source link is currently disabled in source build so define this dummy target which is required for pack. -->
-  <Import Condition="'$(DotNetBuildFromSource)' == 'true'" Project="WorkaroundsImported.targets" />
-
   <!-- Workaround for netstandard2.1 projects until we can get a preview 8 SDK containing https://github.com/dotnet/sdk/pull/3463 fix. -->
   <ItemGroup>
     <KnownFrameworkReference Update="NETStandard.Library">

+ 0 - 5
eng/WorkaroundsImported.targets

@@ -1,5 +0,0 @@
-<!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. -->
-<Project>
-  <!-- Workaround https://github.com/dotnet/source-build/issues/1112. Source link is currently disabled in source build so define this dummy target which is required for pack. -->
-  <Target Name="InitializeSourceControlInformation"/>
-</Project>

+ 0 - 5
eng/targets/CSharp.Common.props

@@ -6,11 +6,6 @@
     <Features>strict</Features>
   </PropertyGroup>
 
-  <ItemGroup>
-    <!-- Required to exist in the NuGet package cache to enable code-signing. -->
-    <PackageReference Include="MicroBuild.Core" Version="0.3.0" PrivateAssets="All" AllowExplicitReference="true" ExcludeAssets="All" />
-  </ItemGroup>
-
   <ItemGroup Condition=" $(IsTestProject) ">
     <Reference Include="Microsoft.AspNetCore.Testing" />
     <Reference Include="Moq" />

+ 2 - 0
eng/tools/RepoTasks/RepoTasks.csproj

@@ -23,6 +23,8 @@
     <PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
     <PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
     <PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" />
+    <!-- Manually updated version from 6.0.0 to address CVE-2021-43877 -->
+    <PackageReference Include="System.Security.Cryptography.Xml" Version="$(RepoTasksSystemSecurityCryptographyXmlVersion)" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'net472'">