Merge branch 'main' into TestProjectValidation

This commit is contained in:
Jackson Schuster 2024-03-20 15:15:05 -07:00 committed by GitHub
commit 4efaf69087
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 626 additions and 761 deletions

View file

@ -43,7 +43,10 @@ resources:
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
${{ else }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
containers:
alpine319WithNode:
@ -67,15 +70,6 @@ extends:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022
os: windows
# https://docs.opensource.microsoft.com/tools/cg/component-detection/variables/
componentgovernance:
# This should be uncommented when a fix is available.
# See: https://dev.azure.com/mseng/1ES/_workitems/edit/2159448
# failOnAlert: false
# This should be removed when failOnAlert works properly.
ignoreDirectories: '.packages'
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: Build
jobs:

View file

@ -5,21 +5,21 @@
Source-build uses transitive dependency resolution to determine correct build SHA of all product contributing repos.
The order of dependencies is important and should not be modified without approval from dotnet/source-build-internal.
-->
<Dependency Name="Microsoft.WindowsDesktop.App.Ref" Version="9.0.0-preview.3.24163.6" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.WindowsDesktop.App.Ref" Version="9.0.0-preview.3.24168.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/windowsdesktop</Uri>
<Sha>ce44ae8e4ccfe04ff6d6447370c6038732d11439</Sha>
<Sha>d29e67fd8b7e9d5385275f3a3a00e00903bb0c5c</Sha>
</Dependency>
<Dependency Name="VS.Redist.Common.WindowsDesktop.SharedFramework.x64.9.0" Version="9.0.0-preview.3.24163.6" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="VS.Redist.Common.WindowsDesktop.SharedFramework.x64.9.0" Version="9.0.0-preview.3.24168.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/windowsdesktop</Uri>
<Sha>ce44ae8e4ccfe04ff6d6447370c6038732d11439</Sha>
<Sha>d29e67fd8b7e9d5385275f3a3a00e00903bb0c5c</Sha>
</Dependency>
<Dependency Name="VS.Redist.Common.WindowsDesktop.TargetingPack.x64.9.0" Version="9.0.0-preview.3.24163.6" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="VS.Redist.Common.WindowsDesktop.TargetingPack.x64.9.0" Version="9.0.0-preview.3.24168.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/windowsdesktop</Uri>
<Sha>ce44ae8e4ccfe04ff6d6447370c6038732d11439</Sha>
<Sha>d29e67fd8b7e9d5385275f3a3a00e00903bb0c5c</Sha>
</Dependency>
<Dependency Name="Microsoft.WindowsDesktop.App.Runtime.win-x64" Version="9.0.0-preview.3.24163.6" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.WindowsDesktop.App.Runtime.win-x64" Version="9.0.0-preview.3.24168.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/windowsdesktop</Uri>
<Sha>ce44ae8e4ccfe04ff6d6447370c6038732d11439</Sha>
<Sha>d29e67fd8b7e9d5385275f3a3a00e00903bb0c5c</Sha>
</Dependency>
<Dependency Name="VS.Redist.Common.NetCore.SharedFramework.x64.9.0" Version="9.0.0-preview.3.24162.31" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/runtime</Uri>
@ -91,26 +91,26 @@
<Sha>268a2dfc29b33e3fdb73cbac6eb198c05314d77e</Sha>
<SourceBuild RepoName="aspnetcore" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Common.ItemTemplates" Version="9.0.100-preview.3.24165.9">
<Dependency Name="Microsoft.DotNet.Common.ItemTemplates" Version="9.0.100-preview.4.24169.5">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>d6d51df25f85dfee1e04752ac8ac104e38d2667f</Sha>
<Sha>20a37c521eae336f117a67feefb962a54f65f1b1</Sha>
</Dependency>
<Dependency Name="Microsoft.TemplateEngine.Cli" Version="9.0.100-preview.3.24165.9">
<Dependency Name="Microsoft.TemplateEngine.Cli" Version="9.0.100-preview.4.24169.5">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>d6d51df25f85dfee1e04752ac8ac104e38d2667f</Sha>
<Sha>20a37c521eae336f117a67feefb962a54f65f1b1</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Sdk" Version="9.0.100-preview.3.24165.9">
<Dependency Name="Microsoft.NET.Sdk" Version="9.0.100-preview.4.24169.5">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>d6d51df25f85dfee1e04752ac8ac104e38d2667f</Sha>
<Sha>20a37c521eae336f117a67feefb962a54f65f1b1</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.MSBuildSdkResolver" Version="9.0.100-preview.3.24165.9">
<Dependency Name="Microsoft.DotNet.MSBuildSdkResolver" Version="9.0.100-preview.4.24169.5">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>d6d51df25f85dfee1e04752ac8ac104e38d2667f</Sha>
<Sha>20a37c521eae336f117a67feefb962a54f65f1b1</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="9.0.100-preview.3.24165.9">
<Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="9.0.100-preview.4.24169.5">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>d6d51df25f85dfee1e04752ac8ac104e38d2667f</Sha>
<Sha>20a37c521eae336f117a67feefb962a54f65f1b1</Sha>
<SourceBuild RepoName="sdk" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Test.ProjectTemplates.2.1" Version="1.0.2-beta4.22406.1">
@ -144,22 +144,22 @@
<SourceBuild RepoName="test-templates" ManagedOnly="true" />
</Dependency>
<!-- For coherency purposes, these versions should be gated by the versions of winforms and wpf routed via windowsdesktop -->
<Dependency Name="Microsoft.Dotnet.WinForms.ProjectTemplates" Version="9.0.0-preview.3.24163.1" CoherentParentDependency="Microsoft.WindowsDesktop.App.Runtime.win-x64">
<Dependency Name="Microsoft.Dotnet.WinForms.ProjectTemplates" Version="9.0.0-preview.3.24166.1" CoherentParentDependency="Microsoft.WindowsDesktop.App.Runtime.win-x64">
<Uri>https://github.com/dotnet/winforms</Uri>
<Sha>ebb882931caa199ae9f797b341cebbdcee3be2d3</Sha>
<Sha>fd95fcd9771ffe9270c8c0280a2950e5434c250d</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Wpf.ProjectTemplates" Version="9.0.0-preview.3.24163.2" CoherentParentDependency="Microsoft.WindowsDesktop.App.Runtime.win-x64">
<Dependency Name="Microsoft.DotNet.Wpf.ProjectTemplates" Version="9.0.0-preview.3.24167.1" CoherentParentDependency="Microsoft.WindowsDesktop.App.Runtime.win-x64">
<Uri>https://github.com/dotnet/wpf</Uri>
<Sha>99172edf1f51a488d63119671dae80203e569a6f</Sha>
<Sha>85d908ce8599d12f5e16ce7d78083cfdc2e13af4</Sha>
</Dependency>
<Dependency Name="Microsoft.FSharp.Compiler" Version="12.8.300-beta.24163.4" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.FSharp.Compiler" Version="12.8.300-beta.24168.9" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/fsharp</Uri>
<Sha>2c03643199368f07a3326709fc68abcbfc482a06</Sha>
<Sha>e18404fcaf90b0ee9bbf588ec32d07f466f16fe7</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.fsharp" Version="8.0.300-beta.24163.4" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.SourceBuild.Intermediate.fsharp" Version="8.0.300-beta.24168.9" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/fsharp</Uri>
<Sha>2c03643199368f07a3326709fc68abcbfc482a06</Sha>
<Sha>e18404fcaf90b0ee9bbf588ec32d07f466f16fe7</Sha>
<SourceBuild RepoName="fsharp" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="17.10.0-preview-24163-01" CoherentParentDependency="Microsoft.NET.Sdk">
@ -176,29 +176,29 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>596a1f7b6429fc06cf71465238cb349cab4edc35</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.10.0-3.24164.3" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.10.0-3.24168.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>711e122c86db37658d2924f2499c775ce6007b68</Sha>
<Sha>2348a50bb566b39305c474793b43edb5635db6f4</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.10.0-3.24164.3" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.10.0-3.24168.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>711e122c86db37658d2924f2499c775ce6007b68</Sha>
<Sha>2348a50bb566b39305c474793b43edb5635db6f4</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Build" Version="17.10.0-preview-24164-03" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.Build" Version="17.10.0-preview-24165-03" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>0764e8979bd4e98c85d0ef9ef8220a8b52bfe4b3</Sha>
<Sha>00833d9f8772bc99c48ccbebc013aa0a6d5ee622</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.10.0-preview-24164-03" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.10.0-preview-24165-03" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>0764e8979bd4e98c85d0ef9ef8220a8b52bfe4b3</Sha>
<Sha>00833d9f8772bc99c48ccbebc013aa0a6d5ee622</Sha>
<SourceBuild RepoName="msbuild" ManagedOnly="true" />
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.10.0-preview.2.78" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="NuGet.Build.Tasks" Version="6.10.0-preview.2.81" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>2fdd0d41e33c3354de2750fe154b56751a6682aa</Sha>
<Sha>1845d6bd450a7453d573035371c9fec43683d1ef</Sha>
<SourceBuildTarball RepoName="nuget-client" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.ApplicationInsights" Version="2.0.0">
@ -215,20 +215,20 @@
<Sha>a5f4de78fca42544771977f8e8e04c4aa83e1d02</Sha>
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Deployment.DotNet.Releases" Version="2.0.0-preview.1.24113.2" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.Deployment.DotNet.Releases" Version="2.0.0-preview.1.24168.2" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/deployment-tools</Uri>
<Sha>822ff266c5f999ab9ceb6928df59d79285ea4a4f</Sha>
<Sha>2a7741c5a7cb49fbad797c4b2f7812d5620430ac</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.deployment-tools" Version="9.0.0-preview.1.24113.2" CoherentParentDependency="Microsoft.NET.Sdk">
<Dependency Name="Microsoft.SourceBuild.Intermediate.deployment-tools" Version="9.0.0-preview.1.24168.2" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/deployment-tools</Uri>
<Sha>822ff266c5f999ab9ceb6928df59d79285ea4a4f</Sha>
<Sha>2a7741c5a7cb49fbad797c4b2f7812d5620430ac</Sha>
<SourceBuild RepoName="deployment-tools" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="9.0.0-alpha.1.24162.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="9.0.0-alpha.1.24168.3">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
<Sha>3167c0a9379f52145af31057aca31f45528eb123</Sha>
<Sha>b46b7e6859f4094cd7f3e00dc0471d62f5d8d051</Sha>
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.24126.1" CoherentParentDependency="Microsoft.NET.Sdk">

View file

@ -18,7 +18,7 @@
<PreReleaseVersionLabel Condition="'$(StabilizePackageVersion)' != 'true'">preview</PreReleaseVersionLabel>
<PreReleaseVersionLabel Condition="'$(StabilizePackageVersion)' == 'true' and '$(VersionFeature)' == '00'">rtm</PreReleaseVersionLabel>
<PreReleaseVersionLabel Condition="'$(StabilizePackageVersion)' == 'true' and '$(VersionFeature)' != '00'">servicing</PreReleaseVersionLabel>
<PreReleaseVersionIteration Condition="'$(StabilizePackageVersion)' != 'true'">3</PreReleaseVersionIteration>
<PreReleaseVersionIteration Condition="'$(StabilizePackageVersion)' != 'true'">4</PreReleaseVersionIteration>
</PropertyGroup>
<PropertyGroup>
<VersionFeature21>30</VersionFeature21>
@ -47,11 +47,11 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/winforms -->
<MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>9.0.0-preview.3.24163.1</MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>
<MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>9.0.0-preview.3.24166.1</MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/wpf -->
<MicrosoftDotNetWpfProjectTemplatesPackageVersion>9.0.0-preview.3.24163.2</MicrosoftDotNetWpfProjectTemplatesPackageVersion>
<MicrosoftDotNetWpfProjectTemplatesPackageVersion>9.0.0-preview.3.24167.1</MicrosoftDotNetWpfProjectTemplatesPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/test-templates -->
@ -85,16 +85,16 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/sdk -->
<MicrosoftDotNetCommonItemTemplatesPackageVersion>9.0.100-preview.3.24165.9</MicrosoftDotNetCommonItemTemplatesPackageVersion>
<MicrosoftNETSdkPackageVersion>9.0.100-preview.3.24165.9</MicrosoftNETSdkPackageVersion>
<MicrosoftDotNetMSBuildSdkResolverPackageVersion>9.0.100-preview.3.24165.9</MicrosoftDotNetMSBuildSdkResolverPackageVersion>
<MicrosoftDotNetCommonItemTemplatesPackageVersion>9.0.100-preview.4.24169.5</MicrosoftDotNetCommonItemTemplatesPackageVersion>
<MicrosoftNETSdkPackageVersion>9.0.100-preview.4.24169.5</MicrosoftNETSdkPackageVersion>
<MicrosoftDotNetMSBuildSdkResolverPackageVersion>9.0.100-preview.4.24169.5</MicrosoftDotNetMSBuildSdkResolverPackageVersion>
<MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
<MicrosoftDotnetToolsetInternalPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftDotnetToolsetInternalPackageVersion>
<MicrosoftDotnetTemplateLocatorPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftDotnetTemplateLocatorPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/roslyn -->
<MicrosoftNetCompilersToolsetPackageVersion>4.10.0-3.24164.3</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>4.10.0-3.24168.1</MicrosoftNetCompilersToolsetPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/corefx -->
@ -111,10 +111,10 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/windowsdesktop -->
<VSRedistCommonWindowsDesktopSharedFrameworkx6490PackageVersion>9.0.0-preview.3.24163.6</VSRedistCommonWindowsDesktopSharedFrameworkx6490PackageVersion>
<VSRedistCommonWindowsDesktopTargetingPackx6490PackageVersion>9.0.0-preview.3.24163.6</VSRedistCommonWindowsDesktopTargetingPackx6490PackageVersion>
<MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion>9.0.0-preview.3.24163.6</MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion>
<MicrosoftWindowsDesktopAppRefPackageVersion>9.0.0-preview.3.24163.6</MicrosoftWindowsDesktopAppRefPackageVersion>
<VSRedistCommonWindowsDesktopSharedFrameworkx6490PackageVersion>9.0.0-preview.3.24168.1</VSRedistCommonWindowsDesktopSharedFrameworkx6490PackageVersion>
<VSRedistCommonWindowsDesktopTargetingPackx6490PackageVersion>9.0.0-preview.3.24168.1</VSRedistCommonWindowsDesktopTargetingPackx6490PackageVersion>
<MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion>9.0.0-preview.3.24168.1</MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion>
<MicrosoftWindowsDesktopAppRefPackageVersion>9.0.0-preview.3.24168.1</MicrosoftWindowsDesktopAppRefPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Runtime and Apphost pack versions are the same for all RIDs. We flow the x64 -->
@ -126,11 +126,11 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/NuGet/NuGet.Client -->
<NuGetBuildTasksPackageVersion>6.10.0-preview.2.78</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksPackageVersion>6.10.0-preview.2.81</NuGetBuildTasksPackageVersion>
</PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/deployment-tools -->
<PropertyGroup>
<MicrosoftDeploymentDotNetReleasesVersion>2.0.0-preview.1.24113.2</MicrosoftDeploymentDotNetReleasesVersion>
<MicrosoftDeploymentDotNetReleasesVersion>2.0.0-preview.1.24168.2</MicrosoftDeploymentDotNetReleasesVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Automated versions for asp.net templates -->

View file

@ -68,7 +68,7 @@ jobs:
matrix: $[ dependencies.Setup.outputs['GetMatrix.matrix'] ]
steps:
- script: $(Build.SourcesDirectory)/prep-source-build.sh --no-artifacts --no-bootstrap --no-prebuilts --no-binary-tooling
- script: $(Build.SourcesDirectory)/prep-source-build.sh --no-artifacts --no-bootstrap --no-prebuilts --no-binary-removal
displayName: 'Install .NET SDK'
- task: PipAuthenticate@1

View file

@ -50,7 +50,8 @@
<PropertyGroup Label="CalculateRID">
<!-- Use current machine distro RID if set. Otherwise, fall back to RuntimeInformation.RuntimeIdentifier -->
<BuildRid>$(__DistroRid)</BuildRid>
<BuildRid Condition="'$(BuildRid)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</BuildRid>
<BuildRid Condition="'$(BuildRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</BuildRid>
<BuildRid Condition="'$(BuildRid)' == '' and '$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</BuildRid>
<TargetRid Condition="'$(TargetRid)' == ''">$(BuildRid.Substring(0, $(BuildRid.LastIndexOf('-'))))-$(TargetArchitecture)</TargetRid>
<HostRid Condition="'$(HostRid)' == ''">$(TargetRid)</HostRid>

View file

@ -26,5 +26,11 @@
<PrivateSourceBuiltArtifactsVersion>9.0.100-preview.2.24104.1</PrivateSourceBuiltArtifactsVersion>
<!-- msbuild -->
<MicrosoftBuildVersion>15.7.179</MicrosoftBuildVersion>
<!-- runtime -->
<MicrosoftExtensionsFileSystemGlobbingVersion>9.0.0-preview.2.24128.5</MicrosoftExtensionsFileSystemGlobbingVersion>
<MicrosoftExtensionsLoggingConsoleVersion>9.0.0-preview.2.24128.5</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftExtensionsLoggingVersion>9.0.0-preview.2.24128.5</MicrosoftExtensionsLoggingVersion>
<!-- command-line-api -->
<SystemCommandLineVersion>2.0.0-beta4.24126.1</SystemCommandLineVersion>
</PropertyGroup>
</Project>

View file

@ -1,3 +1,8 @@
# Contains the binaries that are allowed for source build
# This file is used by the Binary Tool to remove binaries from the VMR
# If importing a file, include the relative path to the file
**/*.bmp
**/*.doc
**/*.docx
@ -18,48 +23,37 @@
**/*.icm
**/*.reg
**/test/**/*
**/Test/**/*
**/Test/**/*
**/testCert*.pfx
**/TestCert*.pfx
**/tests/**/*
eng/common/loc/*.lss # UTF16-LE text files
**/eng/common/loc/*.lss # UTF16-LE text files
src/aspnetcore/**/samples/**/*
src/aspnetcore/**/TestCertificates/**/*
src/aspnetcore/src/**/*.eot
src/aspnetcore/src/**/*.otf
src/aspnetcore/src/**/*.woff
src/aspnetcore/src/**/*.woff2
# aspnetcore
src/aspnetcore/src/**/samples/**/*.eot
src/aspnetcore/src/**/samples/**/*.pfx
src/aspnetcore/src/**/samples/**/*.woff*
src/aspnetcore/src/**/Samples/**/*.woff*
src/aspnetcore/src/Components/benchmarkapps/BlazingPizza.Server/wwwroot/css/font/quicksand-v8-latin-*.woff*
src/aspnetcore/src/Components/Web.JS/dist/Release/blazor.*.js # JavaScript files with a null bytes
src/aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/**/app.db
src/aspnetcore/src/submodules/spa-templates/**/app.db
src/aspnetcore/src/submodules/Node-Externals/cache/**/* # https://github.com/dotnet/source-build/issues/4161
src/fsharp/**/signedtests/**/*
# fsharp
src/fsharp/src/fsi/fsi.res # Icon
src/msbuild/src/Tasks.UnitTests/**/*
# razor
src/razor/**/SampleApp/**/fonts/**/*.eot
src/razor/**/SampleApp/**/fonts/**/*.otf
src/razor/**/SampleApp/**/fonts/**/*.woff
src/razor/**/SampleApp/**/fonts/**/*
# roslyn
src/roslyn/src/ExpressionEvaluator/Core/Source/ExpressionCompiler/Resources/WindowsProxy.winmd
src/roslyn/**/CodeAnalysisTest/**/*
src/roslyn/src/ExpressionEvaluator/Core/Source/ExpressionCompiler/Resources/WindowsProxy.winmd # https://github.com/dotnet/roslyn/issues/66718
src/runtime/src/**/*.woff
src/runtime/src/**/*.woff2
# runtime
src/runtime/src/libraries/System.Diagnostics.EventLog/src/Messages/EventLogMessages.res # Icon
src/runtime/src/libraries/System.Speech/src/**/*.upsmap # https://github.com/dotnet/runtime/issues/81692
src/runtime/src/libraries/System.Text.Encoding.CodePages/src/Data/codepages.nlp # https://github.com/dotnet/runtime/issues/81693
src/runtime/src/mono/wasm/testassets/**/*
src/runtime/src/native/external/brotli/common/dictionary.bin.br
src/sdk/src/Assets/TestProjects/**/*
# source-build-externals
src/source-build-externals/src/humanizer/src/Humanizer.Tests**/*.pfx
src/source-build-externals/src/newtonsoft-json/Src/Newtonsoft.Json.Tests/SpaceShipV2.bson
src/source-build-externals/src/azure-activedirectory-identitymodel-extensions-for-dotnet/build/strongNameBypass.reg # UTF16-LE text file
src/source-build-externals/src/azure-activedirectory-identitymodel-extensions-for-dotnet/build/strongNameBypass2.reg # UTF16-LE text file
src/source-build-externals/src/humanizer/src/Humanizer.Tests**/*
src/source-build-externals/src/newtonsoft-json/Src/Newtonsoft.Json.Tests/SpaceShipV2.bson
src/source-build-externals/src/azure-activedirectory-identitymodel-extensions-for-dotnet/test/Certs/*.pfx
src/source-build-externals/src/azure-activedirectory-identitymodel-extensions-for-dotnet/test/Certs/*.cer

View file

@ -0,0 +1,105 @@
# Contains the binaries that are allowed in the VMR
# This file is used by the Binary Tool to detect new binaries that get added to the VMR
# Import the allowed souce-build binaries (a stricter set).
import:allowed-sb-binaries.txt
**/testCert*.pfx
**/TestCert*.pfx
# arcade
src/arcade/src/Microsoft.DotNet.*.Tests/**/*
src/arcade/src/Microsoft.DotNet.NuGetRepack/tests/Resources/*.nupkg
src/arcade/src/Microsoft.DotNet.NuGetRepack/tests/Resources/.signature.p7s
# aspnetcore
src/aspnetcore/src/submodules/MessagePack-CSharp/**/*.dll
src/aspnetcore/src/SignalR/clients/java/signalr/gradle/wrapper/gradle-wrapper.jar
src/aspnetcore/src/Components/**/testassets/**/*.woff*
src/aspnetcore/src/Security/Authentication/Negotiate/test/Negotiate.FunctionalTest/negotiateAuthCert.pfx
src/aspnetcore/src/**/test/**/*.cer
src/aspnetcore/src/Shared/TestCertificates/*.pfx
src/aspnetcore/src/Shared/TestCertificates/*.crt
# cecil
src/cecil/Test/Resources/assemblies/*.netmodule
src/cecil/Test/Resources/assemblies/*.winmd
# fsharp
src/fsharp/tests/**/*.resources
src/fsharp/tests/fsharp/core/resources/chimes.wav
# msbuild
src/msbuild/src/Tasks.UnitTests/TestResources/*.pfx
src/msbuild/src/Tasks.UnitTests/AssemblyDependency/CacheFileSamples/Microsoft.VisualStudio.LanguageServices.Implementation.csprojAssemblyReference.cache
# nuget-client
src/nuget-client/test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Resources/customMetadata.jpeg
src/nuget-client/test/TestUtilities/Test.Utility/compiler/resources/*.crt
src/nuget-client/test/TestUtilities/Test.Utility/compiler/resources/.signature.p7s
src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/compiler/resources/EmptyCertificateStore.p7b
# razor
src/razor/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/TestFiles/BlazorProject.zip
# roslyn
src/roslyn/src/Workspaces/MSBuildTest/Resources/Dlls/*
src/roslyn/src/Compilers/Test/Resources/Core/**/*.metadata
src/roslyn/src/Compilers/Test/Resources/Core/**/*.winmd
src/roslyn/src/Compilers/Test/Resources/Core/**/*.mod
src/roslyn/src/Compilers/Test/Resources/Core/**/*.netmodule
src/roslyn/src/Compilers/Test/Resources/Core/**/*.obj
src/roslyn/**/CodeAnalysisTest/**/*.res
src/roslyn/**/CodeAnalysisTest/**/*.blah
src/roslyn/**/CodeAnalysisTest/**/*.RES
# runtime
src/runtime/src/mono/mono/eglib/test/*.txt
src/runtime/src/mono/mono/tests/exiting/*.out
src/runtime/src/**/tests/**/*.res
src/runtime/src/**/tests/**/*.resources
src/runtime/src/tests/FunctionalTests/Android/Device_Emulator/gRPC/grpc-dotnet/testassets/Certs/InteropTests/server1.pfx
src/runtime/src/tests/FunctionalTests/Android/Device_Emulator/AOT_PROFILED/*.mibc
src/runtime/src/tests/FunctionalTests/Android/Device_Emulator/AOT_PROFILED/*.nettrace
src/runtime/src/libraries/System.Runtime.Serialization.Xml/tests/Canonicalization/baselines/ReaderWriter_C14N_BaselineXML_Binary.xml
src/runtime/src/libraries/System.Reflection.Metadata/tests/Resources/NetModule/*.mod
src/runtime/src/libraries/System.Reflection.Metadata/tests/Resources/WinRT/Lib.winmd
src/runtime/src/libraries/System.Reflection.Metadata/tests/Resources/Misc/CPPClassLibrary2.obj
src/runtime/src/libraries/System.Console/tests/TestData/ncursesFormats/s/screen-256color
src/runtime/src/libraries/System.Console/tests/TestData/ncursesFormats/x/xterm
src/runtime/src/mono/wasm/testassets/**/*.dat
src/runtime/src/mono/wasm/testassets/**/*.o
# sdk
src/sdk/src/Assets/TestProjects/**/*.dat
src/sdk/src/Assets/TestProjects/**/*.cache
src/sdk/src/Assets/TestProjects/**/*.tlb
src/sdk/src/Assets/TestPackages/dotnet-new/nupkg_templates/*
# source-build-externals
src/source-build-externals/src/application-insights*/WEB/Src/WindowsServer/WindowsServer.Tests/**/*.dll
# symreader
src/symreader/src/PdbTestResources/Resources/*
# templating
src/templating/test/Microsoft.TemplateEngine.TestTemplates/nupkg_templates/*.nupkg
# test-templates
src/test-templates/Templates/**/*.nupkg
# vstest
src/vstest/samples/Microsoft.TestPlatform.*/Adapter/Microsoft.VisualStudio.TestPlatform.*.dll
src/vstest/temp/cpp/**/*.dll
src/vstest/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/TestAssets/*.exe
src/vstest/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/TestAssets/dotnetMac*
src/vstest/test/Microsoft.TestPlatform.Utilities.UnitTests/TestFiles/fullcovered.coverage
src/vstest/test/TestAssets/LegacySettingsUnitTestProject/DependencyAssembly/DependencyAssemblyForTest.dll
# winforms
src/winforms/src/System.Windows.Forms/tests/IntegrationTests/MauiTests/lib/*.dll
src/winforms/src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/Resources/media.mpg
src/winforms/src/System.Windows.Forms/tests/UnitTests/bitmaps/milkmateya01.emf
src/winforms/src/System.Windows.Forms/tests/UnitTests/TestResources/VB6/SimpleControl.vb6
src/winforms/src/System.Windows.Forms*/**/*.wmf

View file

@ -0,0 +1,139 @@
#!/usr/bin/env bash
### Usage: $0
###
### Prepares and runs the binary tooling to detect binaries in the VMR. Default behavior is to report any binaries
### not found in the allowed-binaries file. To remove binaries not specified in the allowed-binaries file, pass --clean.
###
### Options:
### --clean Clean the VMR of binaries not in the specified allowed-binaries file.
### --allowed-binaries-file Path to the file containing the list of binaries to be
### ignored for either cleaning or validating.
### Defaults to eng/allowed-vmr-binaries.txt.
### --log-level <level> Set the log level for the binary tooling. Defaults to Debug.
### --with-packages Use the specified directory as the packages source feed.
### Defaults to online dotnet-public and dotnet-libraries feeds.
### --with-sdk Use the specified directory as the dotnet SDK.
### Defaults to .dotnet.
set -euo pipefail
IFS=$'\n\t'
source="${BASH_SOURCE[0]}"
REPO_ROOT="$( cd -P "$( dirname "$0" )/../" && pwd )"
BINARY_TOOL="$REPO_ROOT/eng/tools/BinaryToolKit"
function print_help () {
sed -n '/^### /,/^$/p' "$source" | cut -b 5-
}
defaultDotnetSdk="$REPO_ROOT/.dotnet"
defaultAllowedBinariesFile="$REPO_ROOT/eng/allowed-vmr-binaries.txt"
# Set default values
allowedBinariesFile=$defaultAllowedBinariesFile
mode='validate'
logLevel='Debug'
propsDir=''
packagesDir=''
dotnetSdk=$defaultDotnetSdk
positional_args=()
while :; do
if [ $# -le 0 ]; then
break
fi
lowerI="$(echo "$1" | awk '{print tolower($0)}')"
case $lowerI in
"-?"|-h|--help)
print_help
exit 0
;;
--clean)
mode="clean"
;;
--allowed-binaries-file)
allowedBinariesFile=$2
shift
;;
--log-level)
logLevel=$2
shift
;;
--with-packages)
packagesDir=$2
if [ ! -d "$packagesDir" ]; then
echo "ERROR: The specified packages directory does not exist."
exit 1
elif [ ! -f "$packagesDir/PackageVersions.props" ]; then
echo "ERROR: The specified packages directory does not contain PackageVersions.props."
exit 1
fi
shift
;;
--with-sdk)
dotnetSdk=$2
if [ ! -d "$dotnetSdk" ]; then
echo "Custom SDK directory '$dotnetSdk' does not exist"
exit 1
fi
if [ ! -x "$dotnetSdk/dotnet" ]; then
echo "Custom SDK '$dotnetSdk/dotnet' does not exist or is not executable"
exit 1
fi
shift
;;
*)
positional_args+=("$1")
;;
esac
shift
done
function ParseBinaryArgs
{
# Check allowed binaries file
if [ ! -f "$allowedBinariesFile" ]; then
echo "ERROR: The specified allowed-binaries file does not exist."
exit 1
fi
# Check dotnet sdk
if [ "$dotnetSdk" == "$defaultDotnetSdk" ]; then
if [ ! -d "$dotnetSdk" ]; then
. "$REPO_ROOT/eng/common/tools.sh"
InitializeDotNetCli true
fi
else if [ ! -x "$dotnetSdk/dotnet" ]; then
echo "'$dotnetSdk/dotnet' does not exist or is not executable"
exit 1
fi
fi
# Check the packages directory
if [ -z "$packagesDir" ]; then
# Use dotnet-public and dotnet-libraries feeds as the default packages source feeds
export ARTIFACTS_PATH="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json"
else
packagesDir=$(realpath ${packagesDir})
export ARTIFACTS_PATH=$packagesDir
fi
}
function RunBinaryTool
{
targetDir="$REPO_ROOT"
outputDir="$REPO_ROOT/artifacts/log/binary-report"
BinaryToolCommand=""$dotnetSdk/dotnet" run --project "$BINARY_TOOL" -c Release "$mode" "$targetDir" -o "$outputDir" -ab "$allowedBinariesFile" -l "$logLevel""
if [ -n "$packagesDir" ]; then
BinaryToolCommand=""$BinaryToolCommand" -p CustomPackageVersionsProps="$packagesDir/PackageVersions.props""
fi
# Run the Binary Tool
eval "$BinaryToolCommand"
}
ParseBinaryArgs
RunBinaryTool

View file

@ -32,14 +32,10 @@ stages:
displayName: Tag the build
workingDirectory: $(Build.SourcesDirectory)/src/installer
- script: >
./.dotnet/dotnet darc vmr scan-binary-files
--vmr "$(Build.SourcesDirectory)"
--tmp "$(Agent.TempDirectory)"
--baseline-file "src/VirtualMonoRepo/allowed-binaries.txt"
|| (echo '##[error]Found binaries in the VMR' && exit 1)
- script: |
./eng/detect-binaries.sh
displayName: Scan for binaries
workingDirectory: $(Build.SourcesDirectory)/src/installer
workingDirectory: $(Build.SourcesDirectory)
continueOnError: true
- script: >
@ -49,4 +45,4 @@ stages:
|| (echo '##[error]Found cloaked files in the VMR' && exit 1)
displayName: Scan for cloaked files
workingDirectory: $(Build.SourcesDirectory)/src/installer
continueOnError: true
continueOnError: true

View file

@ -5,11 +5,10 @@ namespace BinaryToolKit;
public class BinaryTool
{
public async Task ExecuteAsync(
public async Task<int> ExecuteAsync(
string targetDirectory,
string outputReportDirectory,
string? allowedBinariesFile,
string? disallowedSbBinariesFile,
Modes mode)
{
DateTime startTime = DateTime.Now;
@ -35,31 +34,23 @@ public class BinaryTool
isDirectory: false,
createIfNotExist: false,
isRequired: false);
disallowedSbBinariesFile = GetAndValidateFullPath(
"DisallowedSbBinariesFile",
disallowedSbBinariesFile,
isDirectory: false,
createIfNotExist: false,
isRequired: false);
// Run the tooling
var detectedBinaries = await DetectBinaries.ExecuteAsync(targetDirectory);
var detectedBinaries = await DetectBinaries.ExecuteAsync(targetDirectory, outputReportDirectory, allowedBinariesFile);
var comparedBinaries = CompareBinariesAgainstBaselines
.Execute(
detectedBinaries,
allowedBinariesFile,
disallowedSbBinariesFile,
outputReportDirectory,
targetDirectory,
mode);
if (mode.HasFlag(Modes.Clean))
if (mode == Modes.Validate)
{
RemoveBinaries.Execute(comparedBinaries, targetDirectory);
ValidateBinaries(detectedBinaries, outputReportDirectory);
}
else if (mode == Modes.Clean)
{
RemoveBinaries(detectedBinaries, targetDirectory);
}
Log.LogInformation("Finished all binary tasks. Took " + (DateTime.Now - startTime).TotalSeconds + " seconds.");
return Log.GetExitCode();
}
private string? GetAndValidateFullPath(
@ -97,4 +88,36 @@ public class BinaryTool
}
return fullPath;
}
private static void ValidateBinaries(IEnumerable<string> newBinaries, string outputReportDirectory)
{
if (newBinaries.Any())
{
string newBinariesFile = Path.Combine(outputReportDirectory, "NewBinaries.txt");
Log.LogDebug("New binaries:");
File.WriteAllLines(newBinariesFile, newBinaries);
foreach (var binary in newBinaries)
{
Log.LogDebug($" {binary}");
}
Log.LogError($"ERROR: {newBinaries.Count()} new binaries. Check '{newBinariesFile}' for details.");
}
}
private static void RemoveBinaries(IEnumerable<string> binariesToRemove, string targetDirectory)
{
Log.LogInformation($"Removing binaries from '{targetDirectory}'...");
foreach (var binary in binariesToRemove)
{
File.Delete(Path.Combine(targetDirectory, binary));
Log.LogDebug($" {binary}");
}
Log.LogInformation($"Finished binary removal. Removed {binariesToRemove.Count()} binaries.");
}
}

View file

@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="CheckPackagesPropsDirectory">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="CheckCustomPackageVersionsProps">
<PropertyGroup>
<TargetFramework>$(NetCurrent)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackagesPropsDirectory></PackagesPropsDirectory>
<CustomPackageVersionsProps></CustomPackageVersionsProps>
<OutputType>Exe</OutputType>
</PropertyGroup>
<Target Name="CheckPackagesPropsDirectory">
<Error Condition="'$(PackagesPropsDirectory)' == ''" Text="PackagesPropsDirectory is not set. Please pass as an MSBuild Property" />
<Error Condition="!Exists('$(PackagesPropsDirectory)/PackageVersions.props')" Text="PackageVersions.props does not exist in $(PackagesPropsDirectory)." />
<Target Name="CheckCustomPackageVersionsProps">
<Error Condition="'$(CustomPackageVersionsProps)' != '' And !Exists('$(CustomPackageVersionsProps)')" Text="CustomPackageVersionsProps file '$(CustomPackageVersionsProps)' does not exist." />
</Target>
<!-- Need to condition this import because msbuild will complain about the project not being valid otherwise. -->
<!-- With the condition, the CheckPackagesPropsDirectory will run as expected and show the respective errors. -->
<Import Project="$(PackagesPropsDirectory)/PackageVersions.props" Condition="'$(PackagesPropsDirectory)' != ''" />
<!-- With the condition, the CheckCustomPackageVersionsProps will run as expected and show the respective errors. -->
<Import Project="$(CustomPackageVersionsProps)" Condition="'$(CustomPackageVersionsProps)' != ''" />
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(MicrosoftExtensionsFileSystemGlobbingVersion)" />

View file

@ -1,134 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.Extensions.FileSystemGlobbing;
namespace BinaryToolKit;
public static class CompareBinariesAgainstBaselines
{
public static List<string> Execute(
IEnumerable<string> detectedBinaries,
string? allowedBinariesFile,
string? disallowedSbBinariesFile,
string outputReportDirectory,
string targetDirectory,
Modes mode)
{
Log.LogInformation("Comparing detected binaries to baseline(s).");
var binariesToRemove = GetUnmatchedBinaries(
detectedBinaries,
allowedBinariesFile,
outputReportDirectory,
targetDirectory,
mode).ToList();
if (mode.HasFlag(Modes.Validate))
{
var nonSbBinariesToRemove = GetUnmatchedBinaries(
detectedBinaries,
disallowedSbBinariesFile,
outputReportDirectory,
targetDirectory,
mode).ToList();
var newBinaries = binariesToRemove.Intersect(nonSbBinariesToRemove);
if (newBinaries.Any())
{
string newBinariesFile = Path.Combine(outputReportDirectory, "NewBinaries.txt");
File.WriteAllLines(newBinariesFile, newBinaries);
Log.LogWarning($" {newBinaries.Count()} new binaries detected. Check '{newBinariesFile}' for details.");
}
}
Log.LogInformation("Finished comparing binaries.");
return binariesToRemove;
}
private static IEnumerable<string> GetUnmatchedBinaries(
IEnumerable<string> searchFiles,
string? baselineFile,
string outputReportDirectory,
string targetDirectory,
Modes mode)
{
var patterns = ParseBaselineFile(baselineFile);
if (mode.HasFlag(Modes.Validate))
{
// If validating in any mode (Mode == Validate or Mode == All),
// we need to detect both unused patterns and unmatched files.
// We simultaneously detect unused patterns and unmatched files for efficiency.
HashSet<string> unusedPatterns = new HashSet<string>(patterns);
HashSet<string> unmatchedFiles = new HashSet<string>(searchFiles);
foreach (string pattern in patterns)
{
Matcher matcher = new Matcher(StringComparison.Ordinal);
matcher.AddInclude(pattern);
var matches = matcher.Match(targetDirectory, searchFiles);
if (matches.HasMatches)
{
unusedPatterns.Remove(pattern);
unmatchedFiles.ExceptWith(matches.Files.Select(file => file.Path));
}
}
UpdateBaselineFile(baselineFile, outputReportDirectory, unusedPatterns);
return unmatchedFiles;
}
else if (mode == Modes.Clean)
{
// If only cleaning and not validating (Mode == Clean),
// we don't need to update the baseline files with unused patterns
// so we can just detect unmatched files.
Matcher matcher = new Matcher(StringComparison.Ordinal);
matcher.AddInclude("**/*");
matcher.AddExcludePatterns(patterns);
return matcher.Match(targetDirectory, searchFiles).Files.Select(file => file.Path);
}
else
{
// Unhandled mode
throw new ArgumentException($"Unhandled mode: {mode}");
}
}
private static IEnumerable<string> ParseBaselineFile(string? file) {
if (!File.Exists(file))
{
return Enumerable.Empty<string>();
}
// Read the baseline file and parse the patterns, ignoring comments and empty lines
return File.ReadLines(file)
.Select(line => line.Trim())
.Where(line => !string.IsNullOrWhiteSpace(line) && !line.StartsWith("#"))
.Select(line => line.Split('#')[0].Trim());
}
private static void UpdateBaselineFile(string? file, string outputReportDirectory, HashSet<string> unusedPatterns)
{
if(File.Exists(file))
{
var lines = File.ReadAllLines(file);
var newLines = lines.Where(line => !unusedPatterns.Contains(line)).ToList();
string updatedFile = Path.Combine(outputReportDirectory, "Updated" + Path.GetFileName(file));
File.WriteAllLines(updatedFile, newLines);
Log.LogInformation($" Updated baseline file '{file}' written to '{updatedFile}'");
}
}
}

View file

@ -13,9 +13,12 @@ public static class DetectBinaries
private const int ChunkSize = 4096;
private static readonly Regex GitCleanRegex = new Regex(@"Would (remove|skip)( repository)? (.*)");
public static async Task<List<string>> ExecuteAsync(string targetDirectory)
public static async Task<List<string>> ExecuteAsync(
string targetDirectory,
string outputReportDirectory,
string? allowedBinariesFile)
{
Log.LogInformation($"Detecting binaries in '{targetDirectory}'...");
Log.LogInformation($"Detecting binaries in '{targetDirectory}' not listed in '{allowedBinariesFile}'...");
var matcher = new Matcher(StringComparison.Ordinal);
matcher.AddInclude("**/*");
@ -29,11 +32,17 @@ public static class DetectBinaries
return await IsBinaryAsync(file) ? file.Substring(targetDirectory.Length + 1) : null;
});
var binaryFiles = (await Task.WhenAll(tasks)).OfType<string>().ToList();
var binaryFiles = (await Task.WhenAll(tasks)).OfType<string>();
var unmatchedBinaryFiles = GetUnmatchedBinaries(
binaryFiles,
allowedBinariesFile,
outputReportDirectory,
targetDirectory).ToList();
Log.LogInformation($"Finished binary detection.");
return binaryFiles;
return unmatchedBinaryFiles;
}
private static async Task<List<string>> GetIgnoredPatternsAsync(string targetDirectory)
@ -140,4 +149,97 @@ public static class DetectBinaries
return output;
}
private static IEnumerable<string> GetUnmatchedBinaries(
IEnumerable<string> searchFiles,
string? allowedBinariesFile,
string outputReportDirectory,
string targetDirectory)
{
HashSet<string> unmatchedFiles = new HashSet<string>(searchFiles);
var filesToPatterns = new Dictionary<string, HashSet<string>>();
ParseAllowedBinariesFile(allowedBinariesFile, ref filesToPatterns);
foreach (var fileToPatterns in filesToPatterns)
{
var patterns = fileToPatterns.Value;
HashSet<string> unusedPatterns = new HashSet<string>(patterns);
foreach (string pattern in patterns)
{
Matcher matcher = new Matcher(StringComparison.Ordinal);
matcher.AddInclude(pattern);
var matches = matcher.Match(targetDirectory, searchFiles);
if (matches.HasMatches)
{
unusedPatterns.Remove(pattern);
unmatchedFiles.ExceptWith(matches.Files.Select(file => file.Path));
}
}
UpdateAllowedBinariesFile(fileToPatterns.Key, outputReportDirectory, unusedPatterns);
}
return unmatchedFiles;
}
private static void ParseAllowedBinariesFile(string? file, ref Dictionary<string, HashSet<string>> result)
{
if (!File.Exists(file))
{
return;
}
if (!result.ContainsKey(file))
{
result[file] = new HashSet<string>();
}
foreach (var line in File.ReadLines(file))
{
var trimmedLine = line.Trim();
if (string.IsNullOrWhiteSpace(trimmedLine) || trimmedLine.StartsWith("#"))
{
continue;
}
if (trimmedLine.StartsWith("import:"))
{
var importFile = trimmedLine.Substring("import:".Length).Trim();
if (!Path.IsPathFullyQualified(importFile))
{
var currentDirectory = Path.GetDirectoryName(file)!;
importFile = Path.Combine(currentDirectory, importFile);
}
if (result.ContainsKey(importFile))
{
Log.LogWarning($" Duplicate import {importFile}. Skipping.");
continue;
}
ParseAllowedBinariesFile(importFile, ref result);
}
else
{
result[file].Add(trimmedLine.Split('#')[0].Trim());
}
}
}
private static void UpdateAllowedBinariesFile(string? file, string outputReportDirectory, HashSet<string> unusedPatterns)
{
if(File.Exists(file) && unusedPatterns.Any())
{
var lines = File.ReadAllLines(file);
var newLines = lines.Where(line => !unusedPatterns.Contains(line)).ToList();
string updatedFile = Path.Combine(outputReportDirectory, "Updated" + Path.GetFileName(file));
File.WriteAllLines(updatedFile, newLines);
Log.LogInformation($" Updated allowed binaries file '{Path.GetFileName(file)}' written to '{updatedFile}'");
}
}
}

View file

@ -9,6 +9,10 @@ public static class Log
{
public static LogLevel Level = LogLevel.Information;
private static bool WarningLogged = false;
private static bool ErrorLogged = false;
private static readonly Lazy<ILogger> _logger = new Lazy<ILogger>(ConfigureLogger);
public static void LogDebug(string message)
@ -24,11 +28,13 @@ public static class Log
public static void LogWarning(string message)
{
_logger.Value.LogWarning(message);
WarningLogged = true;
}
public static void LogError(string message)
{
_logger.Value.LogError(message);
ErrorLogged = true;
}
private static ILogger ConfigureLogger()
@ -44,4 +50,19 @@ public static class Log
.SetMinimumLevel(Level));
return loggerFactory.CreateLogger("BinaryTool");
}
public static int GetExitCode()
{
if (ErrorLogged)
{
return 1;
}
if (WarningLogged)
{
return 2;
}
return 0;
}
}

View file

@ -3,10 +3,8 @@
namespace BinaryToolKit;
[Flags]
public enum Modes
{
Validate = 1,
Clean = 2,
All = Validate | Clean
Validate,
Clean
}

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!-- %ARTIFACTS_PATH% must be set via an environment variable (export ARTIFACTS_PATH=<path-to-sources>). -->
<add key="artifactsPath" value="%ARTIFACTS_PATH%" />
</packageSources>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!-- %ARTIFACTS_PATH% must be set via an environment variable (export ARTIFACTS_PATH=<path-to-sources>). -->
<add key="artifactsPath" value="%ARTIFACTS_PATH%" />
</packageSources>
</configuration>

View file

@ -9,68 +9,78 @@ namespace BinaryToolKit;
public class Program
{
public static readonly CliArgument<string> TargetDirectory = new("target-directory")
{
Description = "The directory to run the binary tooling on.",
Arity = ArgumentArity.ExactlyOne
};
public static readonly CliOption<string> OutputReportDirectory = new("--output-directory", "-o")
{
Description = "The directory to output the report to.",
Arity = ArgumentArity.ZeroOrOne,
DefaultValueFactory = _ => Path.Combine(Directory.GetCurrentDirectory(), "binary-report")
};
public static readonly CliOption<LogLevel> Level = new("--log-level", "-l")
{
Description = "The log level to run the tool in.",
Arity = ArgumentArity.ZeroOrOne,
DefaultValueFactory = _ => LogLevel.Information,
Recursive = true
};
public static readonly CliOption<string> AllowedBinariesFile = new("--allowed-binaries-file", "-ab")
{
Description = "The file containing the list of allowed binaries that are ignored for cleaning or validating.\n",
Arity = ArgumentArity.ZeroOrOne
};
public static int ExitCode = 0;
public static async Task<int> Main(string[] args)
{
CliArgument<string> TargetDirectory = new("target-directory")
{
Description = "The directory to run the binary tooling on."
};
CliArgument<string> OutputReportDirectory = new("output-report-directory")
{
Description = "The directory to output the report to."
};
CliOption<string> AllowedBinariesFile = new("--allowed-binaries", "-ab")
{
Description = "The file containing the list of known binaries " +
"that are allowed in the VMR and can be kept for source-building."
};
CliOption<string> DisallowedSbBinariesFile = new("--disallowed-sb-binaries", "-db")
{
Description = "The file containing the list of known binaries " +
"that are allowed in the VMR but cannot be kept for source-building."
};
CliOption<Modes> Mode = new("--mode", "-m")
{
Description = "The mode to run the tool in.",
Arity = ArgumentArity.ZeroOrOne,
DefaultValueFactory = _ => Modes.All
};
CliOption<LogLevel> Level = new("--log-level", "-l")
{
Description = "The log level to run the tool in.",
Arity = ArgumentArity.ZeroOrOne,
DefaultValueFactory = _ => LogLevel.Information
};
var cleanCommand = CreateCommand("clean", "Clean the binaries in the target directory.");
var validateCommand = CreateCommand("validate", "Detect new binaries in the target directory.");
var rootCommand = new CliRootCommand("Tool for detecting, validating, and cleaning binaries in the target directory.")
{
TargetDirectory,
OutputReportDirectory,
AllowedBinariesFile,
DisallowedSbBinariesFile,
Mode,
Level
Level,
cleanCommand,
validateCommand
};
rootCommand.SetAction(async (result, CancellationToken) =>
SetCommandAction(cleanCommand, Modes.Clean);
SetCommandAction(validateCommand, Modes.Validate);
await rootCommand.Parse(args).InvokeAsync();
return ExitCode;
}
private static CliCommand CreateCommand(string name, string description)
{
return new CliCommand(name, description)
{
TargetDirectory,
OutputReportDirectory,
AllowedBinariesFile
};
}
private static void SetCommandAction(CliCommand command, Modes mode)
{
command.SetAction(async (result, CancellationToken) =>
{
Log.Level = result.GetValue(Level);
var binaryTool = new BinaryTool();
await binaryTool.ExecuteAsync(
ExitCode = await binaryTool.ExecuteAsync(
result.GetValue(TargetDirectory)!,
result.GetValue(OutputReportDirectory)!,
result.GetValue(AllowedBinariesFile),
result.GetValue(DisallowedSbBinariesFile),
result.GetValue(Mode));
mode);
});
return await rootCommand.Parse(args).InvokeAsync();
}
}

View file

@ -1,22 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.Extensions.Logging;
namespace BinaryToolKit;
public static class RemoveBinaries
{
public static void Execute(IEnumerable<string> binariesToRemove, string targetDirectory)
{
Log.LogInformation($"Removing binaries from '{targetDirectory}'...");
foreach (var binary in binariesToRemove)
{
File.Delete(Path.Combine(targetDirectory, binary));
Log.LogDebug($" Removed '{binary}'");
}
Log.LogInformation($"Finished binary removal. Removed {binariesToRemove.Count()} binaries.");
}
}

View file

@ -18,19 +18,11 @@
### --runtime-source-feed-key Key for accessing the above server, if necessary
###
### Binary-Tooling options:
### --no-binary-tooling Don't run the binary tooling
### --allowed-binaries Path to the file containing the list of known binaries that are allowed
### in the VMR and can be kept for source-building.
### Default is src/installer/src/VirtualMonoRepo/allowed-binaries.txt
### --disallowed-sb-binaries Path to the file containing the list of known binaries that are allowed
### in the VMR but cannot be kept for source-building.
### Default is null.
### --no-binary-removal Don't remove non-SB allowed binaries
### --with-sdk Use the SDK in the specified directory
### Default is the .NET SDK
### --with-packages URL or specified directory to use as the source feed for packages
### Default is the previously source-built artifacts archive
### --no-validate Do not run validation. Only remove the binaries.
### --no-clean Do not remove the binaries. Only run the validation.
### --with-packages Specified directory to use as the source feed for packages
### Default is the previously source-built artifacts archive.
set -euo pipefail
IFS=$'\n\t'
@ -46,27 +38,22 @@ function print_help () {
defaultArtifactsRid='centos.8-x64'
# Binary Tooling default arguments
defaultAllowedBinaries="$REPO_ROOT/src/installer/src/VirtualMonoRepo/allowed-binaries.txt"
defaultDotnetSdk="$REPO_ROOT/.dotnet"
defaultPackagesDir="$REPO_ROOT/prereqs/packages"
defaultMode="All"
defaultPackagesDir="$REPO_ROOT/prereqs/packages/previously-source-built"
# SB prep arguments
buildBootstrap=true
downloadArtifacts=true
downloadPrebuilts=true
removeBinaries=true
installDotnet=true
artifactsRid=$defaultArtifactsRid
runtime_source_feed='' # IBM requested these to support s390x scenarios
runtime_source_feed_key='' # IBM requested these to support s390x scenarios
# Binary Tooling arguments
runBinaryTool=true
allowedBinaries=$defaultAllowedBinaries
disallowedSbBinaries=''
dotnetSdk=$defaultDotnetSdk
packagesSourceFeed=$defaultPackagesDir
mode=$defaultMode
packagesDir=$defaultPackagesDir
positional_args=()
while :; do
@ -102,47 +89,17 @@ while :; do
runtime_source_feed_key=$2
shift
;;
--no-binary-tooling)
runBinaryTool=false
;;
--allowed-binaries)
allowedBinaries=$2
if [ ! -f "$allowedBinaries" ]; then
echo "Allowed binaries file '$allowedBinaries' does not exist"
exit 1
fi
shift
;;
--disallowed-sb-binaries)
disallowedSbBinaries=$2
if [ ! -f "$disallowedSbBinaries" ]; then
echo "Disallowed source build binaries file '$disallowedSbBinaries' does not exist"
exit 1
fi
shift
--no-binary-removal)
removeBinaries=false
;;
--with-sdk)
dotnetSdk=$2
if [ ! -d "$dotnetSdk" ]; then
echo "Custom SDK directory '$dotnetSdk' does not exist"
exit 1
fi
if [ ! -x "$dotnetSdk/dotnet" ]; then
echo "Custom SDK '$dotnetSdk/dotnet' does not exist or is not executable"
exit 1
fi
shift
;;
--with-packages)
packagesSourceFeed=$2
packagesDir=$2
shift
;;
--no-clean)
mode="Validate"
;;
--no-validate)
mode="Clean"
;;
*)
positional_args+=("$1")
;;
@ -186,56 +143,6 @@ if [ "$installDotnet" == true ] && [ -d "$REPO_ROOT/.dotnet" ]; then
installDotnet=false;
fi
function ParseBinaryArgs {
# Attempting to run the binary tooling without an SDK will fail. So either the --with-sdk flag must be passed
# or a pre-existing .dotnet SDK directory must exist.
if [ "$dotnetSdk" == "$defaultDotnetSdk" ] && [ ! -d "$dotnetSdk" ]; then
echo " ERROR: A pre-existing .dotnet SDK directory is needed if --with-sdk is not provided. \
Please either supply an SDK using --with-sdk or execute ./prep-source-build.sh before proceeding. Exiting..."
exit 1
fi
## Attemping to run the binary tooling without a packages directory or source-feed will fail. So either the
## --with-packages flag must be passed with a valid directory or a pre-existing packages directory must exist.
if [ "$packagesSourceFeed" == "$defaultPackagesDir" ] && [ ! -d "$packagesSourceFeed" ]; then
echo " ERROR: A pre-existing packages directory is needed if --with-packages is not provided. \
Please either supply a packages directory using --with-packages or \
execute ./prep-source-build.sh with download artifacts enabled before proceeding. Exiting..."
exit 1
fi
# Attempting to run the binary tooling with a custom packages feed that does not
# have PackageVersions.props in the packages directory or source-feed will fail.
if [ "$packagesSourceFeed" != "$defaultPackagesDir" ] && [ ! -f "$packagesSourceFeed/PackageVersions.props" ]; then
echo " ERROR: PackageVersions.props is needed in the packages directory or source-feed. Exiting..."
exit 1
fi
# Set up the packages source feed if we're using the default artifacts
previouslyBuiltPackagesDir="$defaultPackagesDir/previously-source-built"
packageArtifacts="$defaultPackagesDir/archive/Private.SourceBuilt.Artifacts.*.tar.gz"
if [ "$packagesSourceFeed" == "$defaultPackagesDir" ]; then
if [ -d "$previouslyBuiltPackagesDir" ]; then
echo " Previously source built packages directory exists..."
echo " Using $previouslyBuiltPackagesDir as the source-feed for the binary tooling..."
packagesSourceFeed="$previouslyBuiltPackagesDir"
elif [ -f ${packageArtifacts} ]; then
echo " Unpacking Private.SourceBuilt.Artifacts.*.tar.gz to $previouslyBuiltPackagesDir..."
mkdir -p "$previouslyBuiltPackagesDir"
tar -xzf ${packageArtifacts} -C "$previouslyBuiltPackagesDir"
tar -xzf ${packageArtifacts} -C "$previouslyBuiltPackagesDir" PackageVersions.props
echo " Using $previouslyBuiltPackagesDir as the source-feed for the binary tooling..."
packagesSourceFeed="$previouslyBuiltPackagesDir"
else
echo " ERROR: A pre-existing package archive is needed if --with-packages is not provided. \
Please either supply a source-feed using --with-packages or execute ./prep-source-build.sh \
with download artifacts enabled before proceeding. Exiting..."
exit 1
fi
fi
}
function DownloadArchive {
archiveType="$1"
isRequired="$2"
@ -295,18 +202,6 @@ function BootstrapArtifacts {
rm -rf "$workingDir"
}
function RunBinaryTool {
BinaryTool="$REPO_ROOT/eng/tools/BinaryToolKit"
TargetDir="$REPO_ROOT"
OutputDir="$REPO_ROOT/artifacts/log/binary-report"
# Set the environment variable for the packages source feed
export ARTIFACTS_PATH="$packagesSourceFeed"
# Run the BinaryDetection tool
"$dotnetSdk/dotnet" run --project "$BinaryTool" -c Release -p PackagesPropsDirectory="$packagesSourceFeed" "$TargetDir" "$OutputDir" -ab "$allowedBinaries" -db "$disallowedSbBinaries" -m $mode -l Debug
}
# Check for the version of dotnet to install
if [ "$installDotnet" == true ]; then
echo " Installing dotnet..."
@ -326,7 +221,30 @@ if [ "$downloadPrebuilts" == true ]; then
DownloadArchive Prebuilts false $artifactsRid
fi
if [ "$runBinaryTool" == true ]; then
ParseBinaryArgs
RunBinaryTool
if [ "$removeBinaries" == true ]; then
# If --with-packages is not passed, unpack PSB artifacts
if [[ $packagesDir == $defaultPackagesDir ]]; then
sourceBuiltArchive=$(find "$packagesArchiveDir" -maxdepth 1 -name 'Private.SourceBuilt.Artifacts*.tar.gz')
if [ ! -d "$packagesDir" ] && [ -f "$sourceBuiltArchive" ]; then
echo " Unpacking Private.SourceBuilt.Artifacts.*.tar.gz into $packagesDir"
mkdir -p "$packagesDir"
tar -xzf "$sourceBuiltArchive" -C "$packagesDir"
elif [ ! -f "$packagesDir/PackageVersions.props" ] && [ -f "$sourceBuiltArchive" ]; then
echo " Creating $packagesDir/PackageVersions.props..."
tar -xzf "$sourceBuiltArchive" -C "$packagesDir" PackageVersions.props
elif [ ! -f "$sourceBuiltArchive" ]; then
echo " ERROR: Private.SourceBuilt.Artifacts.*.tar.gz does not exist..."\
"Cannot remove non-SB allowed binaries. Either pass --with-packages or download the artifacts."
exit 1
fi
fi
"$REPO_ROOT/eng/detect-binaries.sh" \
--clean \
--allowed-binaries-file "$REPO_ROOT/eng/allowed-sb-binaries.txt" \
--with-packages $packagesDir \
--with-sdk $dotnetSdk \
fi

View file

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="command-line-api" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="runtime" />
</ItemGroup>
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="roslyn-analyzers" />
<RepositoryReference Include="source-build-externals" />
<RepositoryReference Include="source-build-reference-packages" />
<RepositoryReference Include="symreader" />
</ItemGroup>
</Project>

View file

@ -19,7 +19,6 @@
<RepositoryReference Include="command-line-api" />
<RepositoryReference Include="deployment-tools" />
<RepositoryReference Include="emsdk" />
<RepositoryReference Include="format" />
<RepositoryReference Include="fsharp" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="nuget-client" />

View file

@ -63,13 +63,6 @@ src/deployment-tools/THIRD-PARTY-NOTICES.TXT|unknown-license-reference
# False positive
src/diagnostics/THIRD-PARTY-NOTICES.TXT|codesourcery-2004
#
# format
#
# False positive
src/format/THIRD-PARTY-NOTICES.TXT|unknown-license-reference
#
# fsharp
#
@ -198,6 +191,13 @@ src/runtime/src/libraries/System.Text.Json/roadmap/images/higher-level-component
# Sample data
src/runtime/src/mono/sample/wasm/browser-webpack/package-lock.json
#
# sdk
#
# False positive
src/sdk/THIRD-PARTY-NOTICES.TXT|unknown-license-reference
#
# source-build-externals
#

View file

@ -1,109 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Thu, 7 Mar 2024 21:20:16 +0000
Subject: [PATCH] Enable publishing in VMR
Backport: https://github.com/NuGet/NuGet.Client/pull/5673
---
Directory.Packages.props | 1 +
eng/Publishing.props | 31 ++++++++++++++++++++++++++
eng/source-build/source-build.proj | 35 ++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+)
create mode 100644 eng/Publishing.props
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 5de784200..789f9493f 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -179,6 +179,7 @@
<_allowBuildFromSourcePackage Include="Microsoft.Build.Utilities.Core" />
<_allowBuildFromSourcePackage Include="Microsoft.Build" />
<_allowBuildFromSourcePackage Include="Microsoft.CSharp" />
+ <_allowBuildFromSourcePackage Include="Microsoft.DotNet.Build.Tasks.Feed" />
<_allowBuildFromSourcePackage Include="Microsoft.Extensions.CommandLineUtils.Sources" />
<_allowBuildFromSourcePackage Include="Microsoft.Extensions.FileProviders.Abstractions" />
<_allowBuildFromSourcePackage Include="Microsoft.Extensions.FileSystemGlobbing" />
diff --git a/eng/Publishing.props b/eng/Publishing.props
new file mode 100644
index 000000000..81f0204a7
--- /dev/null
+++ b/eng/Publishing.props
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+ <PropertyGroup>
+ <PublishingVersion>3</PublishingVersion>
+ <ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
+ <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishPackages</PublishDependsOnTargets>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_PackagesToPublish Remove="@(_PackagesToPublish)" />
+ <_PackagesToPublish Include="$(ArtifactsDir)nupkgs/*.nupkg" UploadPathSegment="nuget-client" Condition="'$(DotNetBuildFromSource)' == 'true'" />
+ <_SymbolsPackages Include="$(ArtifactsDir)nupkgs/*.symbols.nupkg" />
+ <_PackagesToPublish Remove="@(_SymbolsPackages)" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
+ </ItemGroup>
+
+ <Target Name="_PublishPackages">
+ <ItemGroup>
+ <!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
+ Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
+ the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
+ to be published. Use DotNetBuildRepo as DotNetBuildFromSource is only set in the internal source build,
+ and Build.proj is invoked from the wrapper build. -->
+ <ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(DotNetBuildRepo)' != 'true'" />
+
+ <ItemsToPushToBlobFeed Include="@(_PackagesToPublish)">
+ <IsShipping>true</IsShipping>
+ </ItemsToPushToBlobFeed>
+ </ItemGroup>
+ </Target>
+
+</Project>
\ No newline at end of file
diff --git a/eng/source-build/source-build.proj b/eng/source-build/source-build.proj
index 612811d81..3485a4212 100644
--- a/eng/source-build/source-build.proj
+++ b/eng/source-build/source-build.proj
@@ -62,6 +62,41 @@
Properties="Configuration=$(BuildConfiguration);DotNetBuildFromSource=true"
Targets="PackXPlat" />
+ <ItemGroup>
+ <_AfterSourceBuildProperties Include="_NETCORE_ENGINEERING_TELEMETRY=AfterSourceBuild" />
+ <_AfterSourceBuildProperties Include="ArcadeBuildFromSource=true"/>
+ <_AfterSourceBuildProperties Include="ArcadeInnerBuildFromSource=true"/>
+ </ItemGroup>
+
+ <MSbuild Projects="$(ArcadeDir)/SourceBuild/AfterSourceBuild.proj"
+ Properties="@(_AfterSourceBuildProperties)"
+ />
+
+ <ItemGroup>
+ <_PublishProperties Include="_NETCORE_ENGINEERING_TELEMETRY=Publish" />
+ <_PublishProperties Include="Configuration=$(Configuration)" />
+ <_PublishProperties Include="ArcadeBuildFromSource=$(ArcadeBuildFromSource)" />
+ <_PublishProperties Include="ArcadeInnerBuildFromSource=true" />
+ <_PublishProperties Include="DotNetBuildFromSource=$(DotNetBuildFromSource)" />
+ <_PublishProperties Include="DotNetBuildFromSourceFlavor=$(DotNetBuildFromSourceFlavor)" />
+ <_PublishProperties Include="DotNetBuildInnerRepo=true" />
+ <_PublishProperties Include="DotNetBuildOrchestrator=$(DotNetBuildOrchestrator)" />
+ <_PublishProperties Include="DotNetBuildPhase=InnerRepo" />
+ <_PublishProperties Include="DotNetBuildRepo=$(DotNetBuildRepo)" />
+ <_PublishProperties Include="DotNetBuildSourceOnly=$(DotNetBuildSourceOnly)" />
+ <_PublishProperties Include="DotNetPublishUsingPipelines=true" />
+ <_PublishProperties Include="PublishToSymbolServer=false" />
+ <_PublishProperties Include="AssetsLocalStorageDir=$(SourceBuiltAssetsDir)" />
+ <_PublishProperties Include="ShippingPackagesLocalStorageDir=$(SourceBuiltShippingPackagesDir)" />
+ <_PublishProperties Include="NonShippingPackagesLocalStorageDir=$(SourceBuiltNonShippingPackagesDir)" />
+ <_PublishProperties Include="AssetManifestsLocalStorageDir=$(SourceBuiltAssetManifestsDir)" />
+ </ItemGroup>
+
+ <MSBuild Projects="$(ArcadeDir)Publish.proj"
+ Properties="@(_PublishProperties)"
+ Targets="Publish"
+ Condition="'$(DotNetBuildOrchestrator)' == 'true'" />
+
</Target>
<Target Name="ApplySourceBuildPatchFiles">

View file

@ -1,50 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Thu, 7 Mar 2024 21:52:02 +0000
Subject: [PATCH] Enable publishing in VMR
Backport: https://github.com/dotnet/roslyn-analyzers/pull/7233
---
eng/Publishing.props | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/eng/Publishing.props b/eng/Publishing.props
index 579a1360d..c71638ecb 100644
--- a/eng/Publishing.props
+++ b/eng/Publishing.props
@@ -1,7 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
- <PropertyGroup>
- <PublishingVersion>3</PublishingVersion>
- <ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
- </PropertyGroup>
-</Project>
+ <PropertyGroup>
+ <PublishingVersion>3</PublishingVersion>
+ <ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
+ <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishPackages</PublishDependsOnTargets>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_PackagesToPublish Remove="@(_PackagesToPublish)" />
+ <_PackagesToPublish Include="$(ArtifactsPackagesDir)**\*.nupkg" UploadPathSegment="Roslyn-analyzers" Condition="'$(DotNetBuildRepo)' == 'true'" />
+ </ItemGroup>
+
+ <Target Name="_PublishPackages">
+ <ItemGroup>
+ <!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
+ Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
+ the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
+ to be published. Use DotNetBuildRepo as DotNetBuildFromSource is only set in the internal source build,
+ and Build.proj is invoked from the wrapper build. -->
+ <ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(DotNetBuildRepo)' != 'true'" />
+
+ <ItemsToPushToBlobFeed Include="@(_PackagesToPublish)">
+ <IsShipping>true</IsShipping>
+ </ItemsToPushToBlobFeed>
+ </ItemGroup>
+ </Target>
+
+</Project>
\ No newline at end of file

View file

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Thu, 7 Mar 2024 22:10:43 +0000
Subject: [PATCH] Enable publishing in VMR
Backport: https://github.com/dotnet/source-build-externals/pull/275
---
eng/Publishing.props | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/eng/Publishing.props b/eng/Publishing.props
index d3aa836..3629bb8 100644
--- a/eng/Publishing.props
+++ b/eng/Publishing.props
@@ -2,5 +2,27 @@
<Project>
<PropertyGroup>
<PublishingVersion>3</PublishingVersion>
+ <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishPackages</PublishDependsOnTargets>
</PropertyGroup>
+
+ <ItemGroup>
+ <_PackagesToPublish Remove="@(_PackagesToPublish)" />
+ <_PackagesToPublish Include="$(ArtifactsPackagesDir)**\*.nupkg" UploadPathSegment="Runtime" Condition="'$(DotNetBuildRepo)' == 'true'" />
+ </ItemGroup>
+
+ <Target Name="_PublishPackages">
+ <ItemGroup>
+ <!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
+ Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
+ the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
+ to be published. Use DotNetBuildRepo as DotNetBuildFromSource is only set in the internal source build,
+ and Build.proj is invoked from the wrapper build. -->
+ <ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(DotNetBuildRepo)' != 'true'" />
+
+ <ItemsToPushToBlobFeed Include="@(_PackagesToPublish)">
+ <IsShipping>true</IsShipping>
+ </ItemsToPushToBlobFeed>
+ </ItemGroup>
+ </Target>
+
</Project>

View file

@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Thu, 7 Mar 2024 22:19:59 +0000
Subject: [PATCH] Enable publishing in VMR
Backport: https://github.com/dotnet/windowsdesktop/pull/4215
---
eng/Publishing.props | 40 ++++++++++++++++++++++++++++++++++++----
1 file changed, 36 insertions(+), 4 deletions(-)
diff --git a/eng/Publishing.props b/eng/Publishing.props
index a2ad9884..0426da4f 100644
--- a/eng/Publishing.props
+++ b/eng/Publishing.props
@@ -1,5 +1,37 @@
<Project>
- <PropertyGroup>
- <ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
- </PropertyGroup>
-</Project>
\ No newline at end of file
+
+ <PropertyGroup>
+ <ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
+ <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallers</PublishDependsOnTargets>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_InstallersToPublish Remove="@(_InstallersToPublish)" />
+ <_InstallersToPublish Include="$(ArtifactsPackagesDir)**\*.zip" UploadPathSegment="WindowsDesktop" Condition="'$(DotNetBuildRepo)' == 'true'" />
+ <_InstallersToPublish Include="$(ArtifactsPackagesDir)**\*.exe" UploadPathSegment="WindowsDesktop" Condition="'$(DotNetBuildRepo)' == 'true'" />
+ <_InstallersToPublish Include="$(ArtifactsPackagesDir)**\*.msi" UploadPathSegment="WindowsDesktop" Condition="'$(DotNetBuildRepo)' == 'true'" />
+ </ItemGroup>
+
+ <Target Name="_PublishInstallers">
+
+ <ItemGroup>
+ <!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
+ Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
+ the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
+ to be published. Use DotNetBuildRepo as DotNetBuildFromSource is only set in the internal source build,
+ and Build.proj is invoked from the wrapper build. -->
+ <ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(DotNetBuildRepo)' != 'true'" />
+
+ <!--
+ MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion is x64 version - there is no Rid-specific property.
+ TODO: This will need to be updated to support arm64.
+ -->
+ <ItemsToPushToBlobFeed Include="@(_InstallersToPublish)">
+ <ManifestArtifactData>NonShipping=false</ManifestArtifactData>
+ <PublishFlatContainer>true</PublishFlatContainer>
+ <RelativeBlobPath>%(_InstallersToPublish.UploadPathSegment)/$(MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
+ </ItemsToPushToBlobFeed>
+ </ItemGroup>
+ </Target>
+
+</Project>

View file

@ -77,10 +77,6 @@
"name": "emsdk",
"defaultRemote": "https://github.com/dotnet/emsdk"
},
{
"name": "format",
"defaultRemote": "https://github.com/dotnet/format"
},
{
"name": "fsharp",
"defaultRemote": "https://github.com/dotnet/fsharp"

View file

@ -99,10 +99,6 @@
"name": "emsdk",
"defaultRemote": "https://github.com/dotnet/emsdk"
},
{
"name": "format",
"defaultRemote": "https://github.com/dotnet/format"
},
{
"name": "fsharp",
"defaultRemote": "https://github.com/dotnet/fsharp"