Skip to content

Commit ba6fd5b

Browse files
tmdsViktorHofer
andcommitted
source-build: support building runtime using non-portable runtime packages. (#75597)
* 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. * Avoid references to Microsoft.AspNetCore.App.<rid>. * crossgen2: set RuntimeIdentifier explicitly. * PR feedback * Revert "crossgen2: set RuntimeIdentifier explicitly." This reverts commit 10be274. * PR feedback. * Revert changes to ILCompiler.csproj. * Update Directory.Build.targets Co-authored-by: Viktor Hofer <[email protected]>
1 parent dcd4e44 commit ba6fd5b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Directory.Build.targets

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@
1212
<Import Project="$(RepositoryEngineeringDir)generators.targets" />
1313
<Import Project="$(RepositoryEngineeringDir)python.targets" />
1414

15+
<!--
16+
When .NET gets built from source, make the SDK aware there are bootstrap packages
17+
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
18+
-->
19+
<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
20+
<KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
21+
<RuntimePackRuntimeIdentifiers>$(PackageRID)</RuntimePackRuntimeIdentifiers>
22+
</KnownFrameworkReference>
23+
<KnownCrossgen2Pack Update="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
24+
<Crossgen2RuntimeIdentifiers>$(PackageRID)</Crossgen2RuntimeIdentifiers>
25+
</KnownCrossgen2Pack>
26+
<!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
27+
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
28+
</ItemGroup>
29+
1530
<PropertyGroup>
1631
<!--
1732
Define this here (not just in Versions.props) because the SDK resets it

0 commit comments

Comments
 (0)