From a94bcfb173d85111b90b311f66b0ea1581851bf3 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 17 Apr 2024 07:06:27 -0700 Subject: [PATCH] Enable efcore in the VMR build (#19313) --- .../WritePackageVersionsProps.cs | 2 +- .../content/repo-projects/aspnetcore.proj | 4 ++ .../content/repo-projects/efcore.proj | 8 ++++ ...es-for-issues-in-efcore-in-VMR-build.patch | 37 +++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/SourceBuild/content/repo-projects/efcore.proj create mode 100644 src/SourceBuild/patches/efcore/0001-Various-fixes-for-issues-in-efcore-in-VMR-build.patch diff --git a/src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/WritePackageVersionsProps.cs b/src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/WritePackageVersionsProps.cs index 4c1413756..f17b4d6b3 100644 --- a/src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/WritePackageVersionsProps.cs +++ b/src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/WritePackageVersionsProps.cs @@ -172,7 +172,7 @@ namespace Microsoft.DotNet.UnifiedBuild.Tasks if (VersionPropsFlowType == DependenciesOnlyVersionPropsFlowType && (string.IsNullOrEmpty(VersionDetails) || !File.Exists(VersionDetails))) { Log.LogError($"When version flow type is DependenciesOnly, the VersionDetails task parameter must point to a valid path to the Version.Details.xml file for the repo. " + - "Provided file path '{VersionDetails}' does not exist."); + $"Provided file path '{VersionDetails}' does not exist."); return !Log.HasLoggedErrors; } diff --git a/src/SourceBuild/content/repo-projects/aspnetcore.proj b/src/SourceBuild/content/repo-projects/aspnetcore.proj index f6d9f7bd5..007f9a643 100644 --- a/src/SourceBuild/content/repo-projects/aspnetcore.proj +++ b/src/SourceBuild/content/repo-projects/aspnetcore.proj @@ -36,6 +36,10 @@ + + + + diff --git a/src/SourceBuild/content/repo-projects/efcore.proj b/src/SourceBuild/content/repo-projects/efcore.proj new file mode 100644 index 000000000..6813e941e --- /dev/null +++ b/src/SourceBuild/content/repo-projects/efcore.proj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/SourceBuild/patches/efcore/0001-Various-fixes-for-issues-in-efcore-in-VMR-build.patch b/src/SourceBuild/patches/efcore/0001-Various-fixes-for-issues-in-efcore-in-VMR-build.patch new file mode 100644 index 000000000..9b1bf007c --- /dev/null +++ b/src/SourceBuild/patches/efcore/0001-Various-fixes-for-issues-in-efcore-in-VMR-build.patch @@ -0,0 +1,37 @@ +From a6d02a6f3859f341707a8c5fd76b68e2f13a5a86 Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Mon, 15 Apr 2024 12:16:14 -0700 +Subject: [PATCH] Various fixes for issues in efcore-in-VMR build (#33540) + +Backport: https://github.com/dotnet/efcore/pull/33540 + +--- + Directory.Build.props | 1 + + src/dotnet-ef/Project.cs | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 3a445c23b9d..80858aaddfc 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -10,6 +10,7 @@ + ( $(MSBuildProjectName.EndsWith('.Tests')) OR + $(MSBuildProjectName.EndsWith('.FunctionalTests'))) ">true + false ++ true + $(MSBuildThisFileDirectory) + + +diff --git a/src/dotnet-ef/Project.cs b/src/dotnet-ef/Project.cs +index 1296a2d1c41..4b923364899 100644 +--- a/src/dotnet-ef/Project.cs ++++ b/src/dotnet-ef/Project.cs +@@ -58,7 +58,7 @@ public Project(string file, string? framework, string? configuration, string? ru + "Microsoft.EntityFrameworkCore.Tools.Resources.EntityFrameworkCore.targets")!) + { + efTargets = new byte[input.Length]; +- input.Read(efTargets); ++ input.ReadExactly(efTargets); + } + + var efTargetsPath = Path.Combine(