diff --git a/src/SourceBuild/patches/fsharp/0001-fix-fsharp-r2r-rid.patch b/src/SourceBuild/patches/fsharp/0001-fix-fsharp-r2r-rid.patch new file mode 100644 index 000000000000..3ac9106a9b98 --- /dev/null +++ b/src/SourceBuild/patches/fsharp/0001-fix-fsharp-r2r-rid.patch @@ -0,0 +1,115 @@ +From fce21126577f80d2c06db54ac3be4cba5329b33c Mon Sep 17 00:00:00 2001 +From: Viktor Hofer +Date: Tue, 28 May 2024 07:24:18 +0000 +Subject: [PATCH] Fix full source-build product build when running R2R + +See https://github.com/dotnet/source-build/issues/4410 +When building from source, we must set the +RuntimeIdentifier property explicitly as otherwise +the SDK defaults to the portable RID. + +Also make the SDK aware of the R2R build by updating +the Known* items in Directory.Build.targets and +remove the AspNetCore framework references. + +Backport: https://github.com/dotnet/fsharp/pull/17259 + +--- + Directory.Build.targets | 16 ++++++++++++++++ + buildtools/AssemblyCheck/AssemblyCheck.fsproj | 2 +- + buildtools/fslex/fslex.fsproj | 2 +- + buildtools/fsyacc/fsyacc.fsproj | 2 +- + src/fsc/fscProject/fsc.fsproj | 2 +- + src/fsi/fsiProject/fsi.fsproj | 2 +- + 6 files changed, 21 insertions(+), 5 deletions(-) + +diff --git a/Directory.Build.targets b/Directory.Build.targets +index cd8633771..8a1a1fa4a 100644 +--- a/Directory.Build.targets ++++ b/Directory.Build.targets +@@ -21,4 +21,20 @@ + + + ++ ++ ++ ++ ++ %(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier) ++ ++ ++ %(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier) ++ ++ ++ + +diff --git a/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/buildtools/AssemblyCheck/AssemblyCheck.fsproj +index 6cfd3b110..bb4b9dd2b 100644 +--- a/buildtools/AssemblyCheck/AssemblyCheck.fsproj ++++ b/buildtools/AssemblyCheck/AssemblyCheck.fsproj +@@ -8,7 +8,7 @@ + + + true +- true ++ $(NETCoreSdkRuntimeIdentifier) + + + +diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj +index 03ed6a77a..f93c26d55 100644 +--- a/buildtools/fslex/fslex.fsproj ++++ b/buildtools/fslex/fslex.fsproj +@@ -9,7 +9,7 @@ + + + true +- true ++ $(NETCoreSdkRuntimeIdentifier) + + + +diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj +index 621a2f3c7..8dd8f9f7d 100644 +--- a/buildtools/fsyacc/fsyacc.fsproj ++++ b/buildtools/fsyacc/fsyacc.fsproj +@@ -9,7 +9,7 @@ + + + true +- true ++ $(NETCoreSdkRuntimeIdentifier) + + + +diff --git a/src/fsc/fscProject/fsc.fsproj b/src/fsc/fscProject/fsc.fsproj +index 5f30ad305..1f22c8531 100644 +--- a/src/fsc/fscProject/fsc.fsproj ++++ b/src/fsc/fscProject/fsc.fsproj +@@ -11,7 +11,7 @@ + + $(FSharpNetCoreProductTargetFramework) + true +- true ++ $(NETCoreSdkRuntimeIdentifier) + + + +diff --git a/src/fsi/fsiProject/fsi.fsproj b/src/fsi/fsiProject/fsi.fsproj +index 639ab45af..634ed56a9 100644 +--- a/src/fsi/fsiProject/fsi.fsproj ++++ b/src/fsi/fsiProject/fsi.fsproj +@@ -11,7 +11,7 @@ + + $(FSharpNetCoreProductTargetFramework) + true +- true ++ $(NETCoreSdkRuntimeIdentifier) + + +