From b6641f0bffbec5a405365296fe2f4d0dbbaeb4d0 Mon Sep 17 00:00:00 2001
From: "dotnet-maestro[bot]"
<42748379+dotnet-maestro[bot]@users.noreply.github.com>
Date: Mon, 6 Jun 2022 01:58:08 +0000
Subject: [PATCH 1/3] [release/6.0.1xx] Update dependencies from
dotnet/source-build-reference-packages (#13852)
[release/6.0.1xx] Update dependencies from dotnet/source-build-reference-packages
---
NuGet.config | 18 ------------------
eng/Version.Details.xml | 4 ++--
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/NuGet.config b/NuGet.config
index 35b2341fd..9ee0fa704 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -7,23 +7,14 @@
-
-
-
-
-
-
-
-
-
@@ -46,18 +37,9 @@
-
-
-
-
-
-
-
-
-
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index ae88123fd..432852f6a 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -211,9 +211,9 @@
https://github.com/dotnet/arcade
e3cbecc5b0e51374e3d71dbb976004ab9cc90430
-
+
https://github.com/dotnet/source-build-reference-packages
- 07eecddb8505ad0dccb6ff6f23379d6b67aedc64
+ 6eb1f46c315e850c8ac318fa56a0f3e05c2214c5
From 5fcd191cd021cf7e4028d20dd20322d6fcc1c266 Mon Sep 17 00:00:00 2001
From: Sean Reeser
Date: Tue, 7 Jun 2022 10:00:12 -0700
Subject: [PATCH 2/3] Update branding to 6.0.107
---
eng/Versions.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 10fc6f219..7f0eb29d5 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -8,7 +8,7 @@
6
0
1
- 06
+ 07
$(VersionMajor).$(VersionMinor).$(VersionSDKMinor)$(VersionFeature)
servicing
$(VersionMajor).$(VersionMinor)
From 17c1d67be5da71b1c385a6155e9181f26ec7eb3c Mon Sep 17 00:00:00 2001
From: Chris Rummel
Date: Thu, 9 Jun 2022 12:57:38 -0500
Subject: [PATCH 3/3] [release/6.0.3xx] Handle NuGet package source mapping in
source-build tasks. (#13733)
---
.../job/source-build-run-tarball-build.yml | 12 +--
.../content/repos/Directory.Build.targets | 31 +++++--
...UpdateNuGetConfigPackageSourcesMappings.cs | 91 +++++++++++++++++++
...ild-and-Microsoft.Extensions.Command.patch | 33 +++++++
4 files changed, 155 insertions(+), 12 deletions(-)
create mode 100644 src/SourceBuild/tarball/content/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/UpdateNuGetConfigPackageSourcesMappings.cs
create mode 100644 src/SourceBuild/tarball/patches/nuget-client/0001-Pin-Microsoft.Build-and-Microsoft.Extensions.Command.patch
diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml
index c8a0a71f1..2cf4ad628 100644
--- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml
+++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml
@@ -44,13 +44,13 @@ jobs:
_EnablePoison: false
_ExcludeOmniSharpTests: true
_RunOnline: true
- CentOS7-Offline:
- _BootstrapPrep: false
- _Container: ${{ parameters.centOS7Container }}
- _EnablePoison: false
- _ExcludeOmniSharpTests: true
- _RunOnline: false
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
+ CentOS7-Offline:
+ _BootstrapPrep: false
+ _Container: ${{ parameters.centOS7Container }}
+ _EnablePoison: false
+ _ExcludeOmniSharpTests: true
+ _RunOnline: false
CentOS8-Offline:
_BootstrapPrep: false
_Container: ${{ parameters.centOS8Container }}
diff --git a/src/SourceBuild/tarball/content/repos/Directory.Build.targets b/src/SourceBuild/tarball/content/repos/Directory.Build.targets
index ab338c52e..b52e87c52 100644
--- a/src/SourceBuild/tarball/content/repos/Directory.Build.targets
+++ b/src/SourceBuild/tarball/content/repos/Directory.Build.targets
@@ -11,6 +11,7 @@
+
@@ -176,6 +177,19 @@
Condition="'$(NuGetConfigFile)' != '' OR '@(NuGetConfigFiles)' != ''"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(RepoCompletedSemaphorePath)UpdateNuGetConfig.complete">
+
+
+ prebuilt
+ previously-source-built
+ reference-packages
+ source-built
+ ExtraSources
+ dotnet5-internal-transport
+ $(PrebuiltNuGetSourceName);$(PreviouslySourceBuiltNuGetSourceName);$(ReferencePackagesNuGetSourceName);$(SourceBuiltNuGetSourceName)
+ $(SourceBuildSources);$(ExtraSourcesNuGetSourceName)
+ $(SourceBuildSources);$(DotNet5InternalTransportNuGetSourceName)
+
+
@@ -187,26 +201,26 @@
KeepFeedPrefixes="@(KeepFeedPrefixes)" />
@@ -219,9 +233,14 @@
'$(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)' != '' and
'$(SetUpInternalTransportFeed)' == 'true'"
NuGetConfigFile="%(NuGetConfigFiles.Identity)"
- SourceName="dotnet5-internal-transport"
+ SourceName="$(DotNet5InternalTransportNuGetSourceName)"
SourcePath="https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v3/index.json" />
+
+
+ /// Whether to work in offline mode (remove all internet sources) or online mode (remove only authenticated sources)
+ ///
+ public bool BuildWithOnlineSources { get; set; }
+
+ ///
+ /// A list of all source-build specific NuGet sources.
+ ///
+ public string[] SourceBuildSources { get; set; }
+
+ public override bool Execute()
+ {
+ string xml = File.ReadAllText(NuGetConfigFile);
+ string newLineChars = FileUtilities.DetectNewLineChars(xml);
+ XDocument document = XDocument.Parse(xml);
+ XElement pkgSrcMappingElement = document.Root.Descendants().FirstOrDefault(e => e.Name == "packageSourceMapping");
+
+ if (pkgSrcMappingElement == null)
+ {
+ return true;
+ }
+
+ // Union all package sources to get the distinct list. These will get added to the source-build sources.
+ IEnumerable packagePatterns = pkgSrcMappingElement.Descendants()
+ .Where(e => e.Name == "packageSource")
+ .SelectMany(e => e.Descendants().Where(e => e.Name == "package"))
+ .Select(e => e.Attribute("pattern").Value)
+ .Distinct();
+
+ if (!BuildWithOnlineSources)
+ {
+ // When building offline remove all packageSourceMappings.
+ pkgSrcMappingElement?.ReplaceNodes(new XElement("clear"));
+ }
+
+ XElement pkgSrcMappingClearElement = pkgSrcMappingElement.Descendants().FirstOrDefault(e => e.Name == "clear");
+
+ foreach (string packageSource in SourceBuildSources)
+ {
+ XElement pkgSrc = new XElement("packageSource", new XAttribute("key", packageSource));
+ foreach (string packagePattern in packagePatterns)
+ {
+ pkgSrc.Add(new XElement("package", new XAttribute("pattern", packagePattern)));
+ }
+
+ if (pkgSrcMappingClearElement != null)
+ {
+ pkgSrcMappingClearElement.AddAfterSelf(pkgSrc);
+ }
+ else
+ {
+ pkgSrcMappingElement.AddFirst(pkgSrc);
+ pkgSrcMappingElement.AddFirst(new XElement("clear"));
+ }
+ }
+
+ using (var writer = XmlWriter.Create(NuGetConfigFile, new XmlWriterSettings { NewLineChars = newLineChars, Indent = true }))
+ {
+ document.Save(writer);
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/SourceBuild/tarball/patches/nuget-client/0001-Pin-Microsoft.Build-and-Microsoft.Extensions.Command.patch b/src/SourceBuild/tarball/patches/nuget-client/0001-Pin-Microsoft.Build-and-Microsoft.Extensions.Command.patch
new file mode 100644
index 000000000..1d284c47e
--- /dev/null
+++ b/src/SourceBuild/tarball/patches/nuget-client/0001-Pin-Microsoft.Build-and-Microsoft.Extensions.Command.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: MichaelSimons
+Date: Wed, 11 May 2022 21:16:46 +0000
+Subject: [PATCH] Pin Microsoft.Build and
+ Microsoft.Extensions.CommandLineUtils.Sources versions in source-build
+
+Update package version reference to not pick up the source-build PVP versions and instead utilize SBRP versions
+so that source-build builds closer to the normal repo build.
+---
+ build/packages.targets | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/build/packages.targets b/build/packages.targets
+index 0ca4b1309..dc3db5b8e 100644
+--- a/build/packages.targets
++++ b/build/packages.targets
+@@ -1,6 +1,6 @@
+
+
+- 16.8.0
++ 16.8.0
+ 13.0.1
+ 3.0.0
+ 4.5.0
+@@ -10,7 +10,7 @@
+ 5.0.0
+ 2.14.0-rtm-832
+ 17.0.0-beta1-10402-05
+- 3.0.0-preview6.19253.5
++ 3.0.0-preview6.19253.5
+
+
+