Skip to content

Commit 14e1f35

Browse files
committed
Don't use BaseOS as the RID for publishing NativeAOT'd assets when OutputRID is the SDK's RID
This fixes SourceBuild Stage2 failures in dotnet/sdk#48523
1 parent e901a03 commit 14e1f35

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
<PropertyGroup>
44
<_IsPublishing>true</_IsPublishing>
55
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
6-
<RuntimeIdentifier Condition="'$(BaseOS)' != ''">$(BaseOS)</RuntimeIdentifier>
6+
<!--
7+
If the output RID isn't the current SDK RID and we have a "base" RID, then the output RID isn't known to the SDK.
8+
In that case, we need to set the RuntimeIdentifier to the base RID so the SDK can find a runtime pack for publishing.
9+
-->
10+
<RuntimeIdentifier Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)' and '$(BaseOS)' != '' ">$(BaseOS)</RuntimeIdentifier>
711
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
812
<SelfContained>true</SelfContained>
913
<PublishTrimmed>true</PublishTrimmed>

src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
<PropertyGroup>
44
<_IsPublishing>true</_IsPublishing>
55
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
6-
<RuntimeIdentifier Condition="'$(BaseOS)' != ''">$(BaseOS)</RuntimeIdentifier>
6+
<!--
7+
If the output RID isn't the current SDK RID and we have a "base" RID, then the output RID isn't known to the SDK.
8+
In that case, we need to set the RuntimeIdentifier to the base RID so the SDK can find a runtime pack for publishing.
9+
-->
10+
<RuntimeIdentifier Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)' and '$(BaseOS)' != '' ">$(BaseOS)</RuntimeIdentifier>
711
<PublishDir>$(RuntimeBinDir)crossgen2-published/</PublishDir>
812
<SelfContained>true</SelfContained>
913
<PublishTrimmed>true</PublishTrimmed>

0 commit comments

Comments
 (0)