Skip to content

Commit 1ce8836

Browse files
committed
BundledVersions: update portable rid logic (backport #14647)
1 parent dd13351 commit 1ce8836

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/SourceBuild/tarball/content/repos/installer.proj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>
1111
<OSNameOverride>$(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-"))))</OSNameOverride>
1212

13+
<!-- Determine target portable rid based on bootstrap SDK's portable rid -->
14+
<_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
15+
<PortableOS Condition="'$(PortableOS)' == ''">$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))</PortableOS>
16+
1317
<RuntimeArg>--runtime-id $(OverrideTargetRid)</RuntimeArg>
1418
<RuntimeArg Condition="'$(TargetOS)' == 'Linux'">--runtime-id $(TargetRid)</RuntimeArg>
1519

@@ -22,6 +26,7 @@
2226
-->
2327
<BuildCommandArgs>$(BuildCommandArgs) /p:NETCoreAppMaximumVersion=99.9</BuildCommandArgs>
2428
<BuildCommandArgs>$(BuildCommandArgs) /p:OSName=$(OSNameOverride)</BuildCommandArgs>
29+
<BuildCommandArgs>$(BuildCommandArgs) /p:PortableOSName=$(PortableOS)</BuildCommandArgs>
2530
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
2631
<BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>
2732

src/redist/targets/GetRuntimeInformation.targets

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('OSX')) ">osx</HostOSName>
1010
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD')) ">freebsd</HostOSName>
1111
<HostOSName Condition=" '$(HostOSName)' == '' AND '$(IsLinux)' == 'True' ">linux</HostOSName>
12-
12+
13+
<OSName Condition=" '$(OSName)' == '' AND $(Rid) != '' ">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
1314
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
1415

15-
<Rid Condition=" '$(Rid)' == '' ">$(OSName)-$(Architecture)</Rid>
16+
<PortableOSName Condition=" '$(PortableOSName)' == '' ">$(OSName)</PortableOSName>
17+
18+
<Rid>$(OSName)-$(Architecture)</Rid>
19+
20+
<PortableRid>$(PortableOSName)-$(Architecture)</PortableRid>
1621
</PropertyGroup>
1722

1823
<PropertyGroup>
@@ -23,10 +28,9 @@
2328
</PropertyGroup>
2429

2530
<PropertyGroup>
26-
<ProductMonikerRid Condition=" '$(Rid)' == 'ubuntu.16.04-x64' OR
27-
'$(Rid)' == 'rhel.6-x64' OR
28-
'$(Rid)' == 'linux-musl-x64' ">$(Rid)</ProductMonikerRid>
29-
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
31+
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(Rid)</ProductMonikerRid>
32+
33+
<PortableProductMonikerRid Condition=" '$(PortableProductMonikerRid)' == '' ">$(PortableRid)</PortableProductMonikerRid>
3034

3135
<PortableProductMonikerRid Condition=" '$(PortableProductMonikerRid)' == '' ">$(HostOSName)-$(Architecture)</PortableProductMonikerRid>
3236

0 commit comments

Comments
 (0)