Cherry-pick: Create 0001-Disable-APICompat-for-DotNetBuild.patch (#19612) (#19687)

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
This commit is contained in:
Michael Simons 2024-05-07 08:32:41 -05:00 committed by GitHub
parent 5abace6823
commit d2677a64e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Michael Simons <msimons@microsoft.com>
Date: Thu, 2 May 2024 21:52:54 +0000
Subject: [PATCH] Avoid ambiguous call site
---
.../GenerateType/AbstractGenerateTypeService.Editor.cs | 4 ++--
.../Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.Editor.cs b/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.Editor.cs
index 8adaaeda551..b099e092c7b 100644
--- a/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.Editor.cs
+++ b/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.Editor.cs
@@ -525,7 +525,7 @@ private async Task<ImmutableArray<CodeActionOperation>> GetGenerateIntoContainin
AddFoldersToNamespaceContainers(containerList, folders);
containers = [.. containerList];
- includeUsingsOrImports = string.Join(".", [.. containerList]);
+ includeUsingsOrImports = string.Join(".", containerList);
}
// Case 4 : If the type is generated into the same VB project or
@@ -539,7 +539,7 @@ private async Task<ImmutableArray<CodeActionOperation>> GetGenerateIntoContainin
// Populate the ContainerList
AddFoldersToNamespaceContainers(containerList, folders);
containers = [.. containerList];
- includeUsingsOrImports = string.Join(".", [.. containerList]);
+ includeUsingsOrImports = string.Join(".", containerList);
if (!string.IsNullOrWhiteSpace(rootNamespaceOfTheProjectGeneratedInto))
{
includeUsingsOrImports = string.IsNullOrEmpty(includeUsingsOrImports)
diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs
index 3839eb370eb..8d272db6b1b 100644
--- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs
+++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs
@@ -71,7 +71,7 @@ internal static class CodeGenerationHelpers
break;
}
- name = string.Join(".", [.. names]);
+ name = string.Join(".", names);
}
else
{

View file

@ -0,0 +1,25 @@
From 3892dc913e63b0f617127c2183aab294de170031 Mon Sep 17 00:00:00 2001
From: Viktor Hofer <viktor.hofer@microsoft.com>
Date: Tue, 30 Apr 2024 17:49:47 +0200
Subject: [PATCH] Disable APICompat for DotNetBuild
---
eng/DotNetBuild.props | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props
index 9d68b8265b0..387ff9082dc 100644
--- a/eng/DotNetBuild.props
+++ b/eng/DotNetBuild.props
@@ -85,6 +85,10 @@
<InnerBuildArgs Condition="'$(SourceBuiltAssetManifestsDir)' != ''">$(InnerBuildArgs) /p:SourceBuiltAssetManifestsDir=$(SourceBuiltAssetManifestsDir)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuiltSymbolsDir)' != ''">$(InnerBuildArgs) /p:SourceBuiltSymbolsDir=$(SourceBuiltSymbolsDir)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(GitHubRepositoryName)' != ''">$(InnerBuildArgs) /p:GitHubRepositoryName=$(GitHubRepositoryName)</InnerBuildArgs>
+
+ <!-- TODO: Remove this when a new source-build product build got produced. -->
+ <InnerBuildArgs>$(InnerBuildArgs) /p:EnablePackageValidation=false</InnerBuildArgs>
+ <InnerBuildArgs>$(InnerBuildArgs) /p:ApiCompatValidateAssemblies=false</InnerBuildArgs>
</PropertyGroup>
</Target>
--