From 290df5778ee9ba16dbec27794faeddf0a7cd137d Mon Sep 17 00:00:00 2001 From: Dan Seefeldt Date: Wed, 1 Sep 2021 03:31:15 -0500 Subject: [PATCH] [ArPow] Reduce the size of the tarball. (#11662) * Copy instead of clone and remove .git/objects directories * Add depth 1 to fetch command * Add commit count to git-info for installer repo * Update targets to fix dependency ordering Some repos take a dependency on PrepareInnerSourceBuildRepoRoot, assuming that the inner repo will be setup. The condition for copy instead of clone caused a conflict. Keep PrepareInnerSourceBuildRepoRoot and make it depend on either copy or clone completing. * Don't copy artifacts dir * Actually don't remove artifacts directory * Update prebuilt version --- .../src/Tarball_WriteSourceRepoProperties.cs | 7 +++++- .../tools/SourceBuildArcadeTarball.targets | 16 +++++++++++- .../SourceBuildArcadeBuild.targets | 25 ++++++++++++++++++- .../content/repos/Directory.Build.props | 1 + 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs b/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs index 39fe823e8..9792857d3 100644 --- a/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs +++ b/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs @@ -57,7 +57,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks SourceBuildRepoName = dep.GetMetadata("SourceBuildRepoName"), Version = dep.GetMetadata("ExactVersion"), Sha = dep.GetMetadata("Sha"), - Uri = dep.GetMetadata("Uri") + Uri = dep.GetMetadata("Uri"), + GitCommitCount = dep.GetMetadata("GitCommitCount") })) { string repoName = dependency.SourceBuildRepoName; @@ -72,6 +73,10 @@ namespace Microsoft.DotNet.SourceBuild.Tasks ["PreReleaseVersionLabel"] = derivedVersion.PreReleaseVersionLabel, ["IsStable"] = string.IsNullOrWhiteSpace(derivedVersion.PreReleaseVersionLabel) ? "true" : "false", }; + if (!string.IsNullOrEmpty(dependency.GitCommitCount)) + { + repoProps.Add("GitCommitCount", dependency.GitCommitCount); + } WritePropsFile(propsPath, repoProps); allRepoProps[$"{safeRepoName}GitCommitHash"] = dependency.Sha; allRepoProps[$"{safeRepoName}OutputPackageVersion"] = dependency.Version; diff --git a/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets b/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets index 321c0013b..a21bbaea9 100644 --- a/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets +++ b/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets @@ -60,6 +60,14 @@ + + + + + @@ -70,6 +78,7 @@ 1.0.0 @(RootRepoCommitSha) @(RootRepoUri) + @(RootRepoCommitCount) $(GitHubRepositoryName) true @@ -133,7 +142,7 @@ @@ -146,6 +155,11 @@ Command="git submodule update --init --recursive" WorkingDirectory="$(TarballRepoSourceDir)" /> + + + + + + + + + + + + + + + + + - +