Skip to content

Commit

Permalink
source-build: support building runtime using non-portable runtime pac…
Browse files Browse the repository at this point in the history
…kages. (#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 <viktor.hofer@microsoft.com>
  • Loading branch information
tmds and ViktorHofer committed Nov 15, 2022
1 parent dcd4e44 commit ba6fd5b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<Import Project="$(RepositoryEngineeringDir)generators.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
Expand Down

0 comments on commit ba6fd5b

Please sign in to comment.