ayaports/user/dotnet6-build/runtime_75597-support-building-runtime-with-non-portable-runtime.patch

49 lines
2.2 KiB
Diff
Raw Normal View History

2023-02-22 04:48:17 +00:00
From 9a05b184f74fc299ddd33bccb74d153e0692d8c8 Mon Sep 17 00:00:00 2001
From: Tom Deseyn <tom.deseyn@gmail.com>
Date: Wed, 14 Sep 2022 11:06:42 +0200
Subject: [PATCH 1/8] source-build: support building runtime using non-portable
runtime packages.
Currently source-build performs a 'runtime-portable' build that produces
'linux-{arch}' packages that are used when building target runtime (non-portable).
With this change, we can use the non-portable packages that are produced by
a previous (non-portable) 'runtime' build. This helps eliminate the
'runtime-portable' build.
---
src/runtime/Directory.Build.targets | 15 ++++
src/runtime/Directory.Build.targets.orig | 96 ++++++++++++++++++++++++
2 files changed, 111 insertions(+)
create mode 100644 src/runtime/Directory.Build.targets.orig
diff --git a/src/runtime/Directory.Build.targets b/src/runtime/Directory.Build.targets
index d0c698797..4337207a4 100644
--- a/src/runtime/Directory.Build.targets
+++ b/src/runtime/Directory.Build.targets
@@ -11,6 +11,21 @@
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
<Import Project="$(RepositoryEngineeringDir)python.targets" />
+ <!--
+ When .NET gets built from source, make the SDK aware there are bootstrap packages
+ for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
+ -->
+ <ItemGroup Condition=" '$(DotNetBuildFromSource)' == 'true' " >
+ <KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
+ <RuntimePackRuntimeIdentifiers>$(PackageRID)</RuntimePackRuntimeIdentifiers>
+ </KnownFrameworkReference>
+ <KnownCrossgen2Pack Update="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
+ <Crossgen2RuntimeIdentifiers>$(PackageRID)</Crossgen2RuntimeIdentifiers>
+ </KnownCrossgen2Pack>
+ <!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
+ <KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
+ </ItemGroup>
+
<PropertyGroup>
<!--
Define this here (not just in Versions.props) because the SDK resets it
--
2.38.0