Skip to content

Commit

Permalink
Add non-portable RID to list of known runtime packs instead of overwr…
Browse files Browse the repository at this point in the history
…iting in source-build (#96858)

In #75597, for source-build we replace all the RIDs with only the `PackageRID` in the `KnownFrameworkReference` for `NetCurrent` when we should have only added an additional RID.

This was causing issues in crossbuilds of vertical builds. The crossgen and ilc projects that run within the build require a runtime for the build machine's RID, but it wasn't found in `KnownFrameworkReference` and the build failed during restore.

Part of reenabling Crossgen and ILC in arm64 crossbuild verticals dotnet/source-build#3698
  • Loading branch information
jtschuster committed Jan 12, 2024
1 parent 54530c7 commit 5e24539
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
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 Update="Microsoft.NETCore.App">
<RuntimePackRuntimeIdentifiers
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'">%(RuntimePackRuntimeIdentifiers);$(PackageRID)</RuntimePackRuntimeIdentifiers>
</KnownFrameworkReference>
<KnownCrossgen2Pack Update="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
<Crossgen2RuntimeIdentifiers>$(PackageRID)</Crossgen2RuntimeIdentifiers>
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2">
<Crossgen2RuntimeIdentifiers
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'" >%(Crossgen2RuntimeIdentifiers);$(PackageRID)</Crossgen2RuntimeIdentifiers>
</KnownCrossgen2Pack>
<!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
Expand Down

0 comments on commit 5e24539

Please sign in to comment.