From 3e0a3b5b49caccf931d1437303fa1993561043f2 Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Fri, 22 Oct 2021 12:55:26 -0500 Subject: [PATCH 1/4] dotnet/format: Fix ref-only extensions package usage at runtime --- src/SourceBuild/tarball/content/repos/format.proj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/SourceBuild/tarball/content/repos/format.proj b/src/SourceBuild/tarball/content/repos/format.proj index 21734d18d..59cd432ce 100644 --- a/src/SourceBuild/tarball/content/repos/format.proj +++ b/src/SourceBuild/tarball/content/repos/format.proj @@ -9,6 +9,20 @@ false + + + + + + From e71e33d9cdcea32481301373edd6d366a1d24448 Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Fri, 22 Oct 2021 13:16:07 -0500 Subject: [PATCH 2/4] Add reference to dotnet/format issue --- src/SourceBuild/tarball/content/repos/format.proj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SourceBuild/tarball/content/repos/format.proj b/src/SourceBuild/tarball/content/repos/format.proj index 59cd432ce..cc5dae3f7 100644 --- a/src/SourceBuild/tarball/content/repos/format.proj +++ b/src/SourceBuild/tarball/content/repos/format.proj @@ -18,6 +18,8 @@ Pick an arbitrary representative package to pass in as MicrosoftExtensionsVersion so it uses the source-built version from the PVP. + + See https://github.com/dotnet/format/issues/1400 --> From 1dca86a6488be4cbd663cdf9973343ecfcb7d0fb Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Fri, 22 Oct 2021 13:27:36 -0500 Subject: [PATCH 3/4] Use a patch to fix up the dependency property --- .../tarball/content/repos/format.proj | 16 ------ .../0001-Fix-MicrosoftExtensionsVersion.patch | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch diff --git a/src/SourceBuild/tarball/content/repos/format.proj b/src/SourceBuild/tarball/content/repos/format.proj index cc5dae3f7..21734d18d 100644 --- a/src/SourceBuild/tarball/content/repos/format.proj +++ b/src/SourceBuild/tarball/content/repos/format.proj @@ -9,22 +9,6 @@ false - - - - - - diff --git a/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch b/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch new file mode 100644 index 000000000..7c09ff2db --- /dev/null +++ b/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch @@ -0,0 +1,50 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Davis Goodin +Date: Fri, 22 Oct 2021 13:26:33 -0500 +Subject: [PATCH] Fix MicrosoftExtensionsVersion + +Move it to eng/Versions.props to make it overridable, and rename it to match an actual package ID. + +See https://github.com/dotnet/format/issues/1400 +--- + Directory.Packages.props | 7 +++---- + eng/Versions.props | 1 + + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Directory.Packages.props b/Directory.Packages.props +index 6b628c2..9b579ea 100644 +--- a/Directory.Packages.props ++++ b/Directory.Packages.props +@@ -2,7 +2,6 @@ + + + +- 5.0.0 + + 6.0.0-preview.4.221 + +@@ -25,9 +24,9 @@ + + + +- +- +- ++ ++ ++ + + + +diff --git a/eng/Versions.props b/eng/Versions.props +index b1990aa..f6ddbbd 100644 +--- a/eng/Versions.props ++++ b/eng/Versions.props +@@ -15,6 +15,7 @@ + + 16.11.0 + 3.3.2 ++ 5.0.0 + + 4.0.0-6.21515.3 + From ff55f86ed6e196f9d16980059e3252e47e1d682a Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Fri, 22 Oct 2021 15:03:38 -0500 Subject: [PATCH 4/4] Fix nullability source compatibility after upgrade --- .../0001-Fix-MicrosoftExtensionsVersion.patch | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch b/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch index 7c09ff2db..7c19d6a40 100644 --- a/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch +++ b/src/SourceBuild/tarball/patches/format/0001-Fix-MicrosoftExtensionsVersion.patch @@ -3,13 +3,18 @@ From: Davis Goodin Date: Fri, 22 Oct 2021 13:26:33 -0500 Subject: [PATCH] Fix MicrosoftExtensionsVersion -Move it to eng/Versions.props to make it overridable, and rename it to match an actual package ID. +Move it to eng/Versions.props to make it overridable, and rename it to match an +actual package ID. + +Update paramater nullability in src/Logging/SimpleConsoleLogger.cs to be +source-compatible with the 6.0 version of these packages. See https://github.com/dotnet/format/issues/1400 --- - Directory.Packages.props | 7 +++---- - eng/Versions.props | 1 + - 2 files changed, 4 insertions(+), 4 deletions(-) + Directory.Packages.props | 7 +++---- + eng/Versions.props | 1 + + src/Logging/SimpleConsoleLogger.cs | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6b628c2..9b579ea 100644 @@ -48,3 +53,16 @@ index b1990aa..f6ddbbd 100644 4.0.0-6.21515.3 +diff --git a/src/Logging/SimpleConsoleLogger.cs b/src/Logging/SimpleConsoleLogger.cs +index c361f84..fd8015c 100644 +--- a/src/Logging/SimpleConsoleLogger.cs ++++ b/src/Logging/SimpleConsoleLogger.cs +@@ -37,7 +37,7 @@ namespace Microsoft.CodeAnalysis.Tools.Logging + _minimalErrorLevel = minimalErrorLevel; + } + +- public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) ++ public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) + { + if (!IsEnabled(logLevel)) + {