Skip to content

Commit 5e24539

Browse files
authored
Add non-portable RID to list of known runtime packs instead of overwriting in source-build (dotnet#96858)
In dotnet#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
1 parent 54530c7 commit 5e24539

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Directory.Build.targets

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
2323
-->
2424
<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
25-
<KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
26-
<RuntimePackRuntimeIdentifiers>$(PackageRID)</RuntimePackRuntimeIdentifiers>
25+
<KnownFrameworkReference Update="Microsoft.NETCore.App">
26+
<RuntimePackRuntimeIdentifiers
27+
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'">%(RuntimePackRuntimeIdentifiers);$(PackageRID)</RuntimePackRuntimeIdentifiers>
2728
</KnownFrameworkReference>
28-
<KnownCrossgen2Pack Update="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
29-
<Crossgen2RuntimeIdentifiers>$(PackageRID)</Crossgen2RuntimeIdentifiers>
29+
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2">
30+
<Crossgen2RuntimeIdentifiers
31+
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'" >%(Crossgen2RuntimeIdentifiers);$(PackageRID)</Crossgen2RuntimeIdentifiers>
3032
</KnownCrossgen2Pack>
3133
<!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
3234
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />

0 commit comments

Comments
 (0)