8000 Use 'PortableTargetRid' property for the portable rid for the target.… · dkurepa/dotnet@caf8866 · GitHub
[go: up one dir, main page]

Skip to content

Commit caf8866

Browse files
authored
Use 'PortableTargetRid' property for the portable rid for the target. (dotnet#1130)
1 parent 9bcfe61 commit caf8866

File tree

25 files changed

+46
-78
lines changed

25 files changed

+46
-78
lines changed

docs/VMR-Controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ In addition to these default high level controls, there may be additional compon
6666
| BuildRid | Valid RIDs | RID of the the currently executing runtime | The RID of the runtime that is running the build |
6767
| TargetRid | Valid RIDs or custom RID | When building non-portable, the OS of build Rid + TargetArchitecture. When building portable, `TargetOS-TargetArchitecture`. | The RID of the runtime that will run the binary -> the end user’s machine. |
6868
| HostRid | Valid RIDs or `TargetRid` | `TargetRid` | The RID of the runtime that will run the produced tool (i.e. compiler) to generate the binary for the target operating system. |
69-
| BaseRid | Valid RIDs | OS portion of `NETCoreSdkPortableRuntimeIdentifier` appended with `-TargetArchitecture` | A known RID to use as a parent of a custom RID specified in `TargetRid` if `TargetRid` is unknown. |
69+
| PortableTargetRid | Valid RIDs | Portable rid for the target. | PortableTargetRid is a known rid from the graph that is compatible with the target. It is the same as `TargetRid` for portable builds, or usable as a parent rid for non-portable builds. |
7070
| BuildArchitecture | "x64", "x86", "arm", "arm64", ... | The architecture of the build environment | The architecture of the machine that is built on. Lower-case string. |
7171
| TargetArchitecture | Same as `BuildArchitecture` | `BuildArchitecture` | The architecture of the machine that will run the binary -> the end user's machine. |
7272
| HostArchitecture | Same as `BuildArchitecture` | `TargetArchitecture` | The architecture of the machine that will run the produced tool (i.e. compiler) to generate the binary for the target architecture |

eng/RuntimeIdentifier.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@
5555
<PortableBuild Condition="'$(PortableBuild)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(BuildArchitecture)' == '$(TargetArchitecture)'">false</PortableBuild>
5656
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
5757

58-
<PortableRid Condition="'$(__PortableTargetOS)' != ''">$(__PortableTargetOS)-$(TargetArchitecture)</PortableRid>
59-
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'freebsd'">freebsd-$(TargetArchitecture)</PortableRid>
60-
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'osx'">osx-$(TargetArchitecture)</PortableRid>
61-
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'linux'">linux-$(TargetArchitecture)</PortableRid>
62-
<PortableRid Condition="$(TargetRid.StartsWith('linux-musl')) or $(TargetRid.StartsWith('alpine'))">linux-musl-$(TargetArchitecture)</PortableRid>
63-
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</PortableRid>
58+
<PortableTargetRid Condition="'$(__PortableTargetOS)' != ''">$(__PortableTargetOS)-$(TargetArchitecture)</PortableTargetRid>
59+
<PortableTargetRid Condition="'$(PortableTargetRid)' == '' and '$(TargetOS)' == 'freebsd'">freebsd-$(TargetArchitecture)</PortableTargetRid>
60+
<PortableTargetRid Condition="'$(PortableTargetRid)' == '' and '$(TargetOS)' == 'osx'">osx-$(TargetArchitecture)</PortableTargetRid>
61+
<PortableTargetRid Condition="'$(PortableTargetRid)' == '' and '$(TargetOS)' == 'linux'">linux-$(TargetArchitecture)</PortableTargetRid>
62+
<PortableTargetRid Condition="$(TargetRid.StartsWith('linux-musl')) or $(TargetRid.StartsWith('alpine'))">linux-musl-$(TargetArchitecture)</PortableTargetRid>
63+
<PortableTargetRid Condition="'$(PortableTargetRid)' == '' and '$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</PortableTargetRid>
64+
<PortableTargetRid Condition="'$(ShortStack)' == 'true' and '$(TargetOS)' != 'windows'">$(TargetOS)-$(TargetArchitecture)</PortableTargetRid>
65+
<PortableTargetRid Condition="'$(ShortStack)' == 'true' and '$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</PortableTargetRid>
6466

65-
<TargetRid Condition="'$(PortableBuild)' == 'true' and '$(PortableRid)' != ''">$(PortableRid)</TargetRid>
66-
<TargetRid Condition="'$(ShortStack)' == 'true' and '$(TargetOS)' != 'windows'">$(TargetOS)-$(TargetArchitecture)</TargetRid>
67-
<TargetRid Condition="'$(ShortStack)' == 'true' and '$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</TargetRid>
67+
<TargetRid Condition="'$(PortableBuild)' == 'true' or '$(ShortStack)' == 'true'">$(PortableTargetRid)</TargetRid>
6868
</PropertyGroup>
6969
</Project>

eng/bootstrap/buildBootstrapPreviouslySB.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
(e.g. Microsoft.AspNetCore.App.Runtime.linux-x64)
4040
-->
4141
<PackageWithName Include="@(RuntimePack)">
42-
<PackageName>%(RuntimePack.Identity).$(PortableRid)</PackageName>
42+
<PackageName>%(RuntimePack.Identity).$(PortableTargetRid)</PackageName>
4343
</PackageWithName>
4444

4545
<!--
@@ -56,10 +56,10 @@
5656
Do this for two groups: native and non-native packages. They have different naming conventions.
5757
-->
5858
<PackageWithName Include="@(PortablePackage)" Condition=" '%(PortablePackage.IsNative)' != 'true' ">
59-
<PackageName>runtime.$(PortableRid).%(PortablePackage.Identity)</PackageName>
59+
<PackageName>runtime.$(PortableTargetRid).%(PortablePackage.Identity)</PackageName>
6060
</PackageWithName>
6161
<PackageWithName Include="@(PortablePackage)" Condition=" '%(PortablePackage.IsNative)' == 'true' ">
62-
<PackageName>runtime.$(PortableRid).runtime.native.%(PortablePackage.Identity)</PackageName>
62+
<PackageName>runtime.$(PortableTargetRid).runtime.native.%(PortablePackage.Identity)</PackageName>
6363
</PackageWithName>
6464
</ItemGroup>
6565

eng/pipelines/templates/jobs/sdk-diff-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
/p:SdkTarballPath=$(SdkTarballPath)
135135
/p:SourceBuiltArtifactsPath=$(SourceBuiltArtifactsPath)
136136
/p:TargetRid=${{ parameters.sbTargetRid }}
137-
/p:PortableRid=${{ parameters.msftTargetRid }}
137+
/p:PortableTargetRid=${{ parameters.msftTargetRid }}
138138
displayName: Run Tests
139139
workingDirectory: $(Build.SourcesDirectory)
140140

eng/pipelines/vmr-license-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ extends:
126126
-clp:v=m
127127
/p:SourceBuildTestsLicenseScanPath=$(repoPath)
128128
/p:TargetRid=linux-x64
129-
/p:PortableRid=linux-x64
129+
/p:PortableTargetRid=linux-x64
130130
/p:SkipPrepareSdkArchive=true
131131
displayName: Run Tests
132132
workingDirectory: $(Build.SourcesDirectory)

prep-source-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function BootstrapArtifacts {
222222

223223
properties=( "/p:ArchiveDir=$packagesArchiveDir" )
224224
if [[ -n "$bootstrap_rid" ]]; then
225-
properties+=( "/p:PortableRid=$bootstrap_rid" )
225+
properties+=( "/p:PortableTargetRid=$bootstrap_rid" )
226226
fi
227227

228228
# Run restore on project to initiate download of bootstrap packages

repo-projects/Directory.Build.targets

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,8 @@
2525
<CommonArgs>$(CommonArgs) /p:UsingToolMicrosoftNetCompilers=false</CommonArgs>
2626

2727
<!-- Pass RID and Portable/non-portable information -->
28-
<_platformIndex>$(NETCoreSdkRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
29-
<RuntimeOS>$(NETCoreSdkRuntimeIdentifier.Substring(0, $(_platformIndex)))</RuntimeOS>
30-
31-
<_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
32-
<BaseRid>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))-$(TargetArchitecture)</BaseRid>
3328
<CommonArgs>$(CommonArgs) /p:PortableBuild=$(PortableBuild)</CommonArgs>
34-
<CommonArgs Condition="'$(ShortStack)' != 'true' and '$(TargetOS)' != 'linux-musl'">$(CommonArgs) /p:BaseRid=$(BaseRid)</CommonArgs>
29+
<CommonArgs>$(CommonArgs) /p:PortableTargetRid=$(PortableTargetRid)</CommonArgs>
3530
<CommonArgs Condition="'$(DefaultArtifactVisibility)' != ''">$(CommonArgs) /p:DefaultArtifactVisibility=$(DefaultArtifactVisibility)</CommonArgs>
3631

3732
<!-- Only pass these properites through when necessary to reduce command line noise. -->

repo-projects/scenario-tests.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<PropertyGroup>
4343
<ScenarioTestsResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsTestResultsDir)', 'scenario-tests'))</ScenarioTestsResultsDir>
4444
<TestXmlOutputPath>$(ScenarioTestsResultsDir)$([System.DateTime]::Now.ToString("yyyy-MM-dd_HH_mm_ss")).xml</TestXmlOutputPath>
45-
<ScenarioTestsAdditionalArgs>--xml $(TestXmlOutputPath) --target-rid $(TargetRid) --portable-rid $(PortableRid) --no-cleanup --no-traits Category=MultiTFM</ScenarioTestsAdditionalArgs>
45+
<ScenarioTestsAdditionalArgs>--xml $(TestXmlOutputPath) --target-rid $(TargetRid) --portable-rid $(PortableTargetRid) --no-cleanup --no-traits Category=MultiTFM</ScenarioTestsAdditionalArgs>
4646
<ScenarioTestsAdditionalArgs Condition="'$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'">$(ScenarioTestsAdditionalArgs) --no-traits Category=RequiresNonTargetRidPackages</ScenarioTestsAdditionalArgs>
4747
<ScenarioTestsAdditionalArgs Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(OfficialBuild)' != 'true'">$(ScenarioTestsAdditionalArgs) --no-traits SkipIfBuild=SourceOnlyUnofficialBuild</ScenarioTestsAdditionalArgs>
4848
</PropertyGroup>

repo-projects/sdk.proj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
<!-- Tests are only building on Windows - https://github.com/dotnet/source-build/issues/4882 -->
55
<DotNetBuildTestsOptOut Condition="'$(OS)' != 'Windows_NT'">true</DotNetBuildTestsOptOut>
66

7-
<BuildArgs>$(BuildArgs) /p:PortableRid=$(PortableRid)</BuildArgs>
8-
9-
<!-- We need to extract the non-portable OS name from the non-portable RID and pass that to installer build script.
10-
This should not happen except when building non-portable. installer generally extracts the OSName from the host OS,
11-
or from the Rid if supplied. -->
12-
<BuildArgs Condition="$(PortableBuild) != 'true'">$(BuildArgs) /p:OSName=$(TargetRid.Substring(0, $(TargetRid.IndexOf("-"))))</BuildArgs>
13-
<BuildArgs>$(BuildArgs) /p:PortableOSName=$(__PortableTargetOS)</BuildArgs>
14-
157
<!-- sdk always wants to build portable on FreeBSD etc. -->
168
<BuildArgs Condition="('$(TargetOS)' == 'freebsd' or '$(TargetOS)' == 'solaris') and '$(DotNetBuildSourceOnly)' == 'true'">$(BuildArgs) /p:PortableBuild=true</BuildArgs>
179
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:NetRuntimeRid=$(TargetRid)</BuildArgs>

src/arcade/eng/common/core-templates/steps/source-build.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ steps:
3838
targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}'
3939
fi
4040
41-
baseRidArgs=
42-
if [ '${{ parameters.platform.baseRID }}' != '' ]; then
43-
baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}'
44-
fi
45-
4641
portableBuildArgs=
4742
if [ '${{ parameters.platform.portableBuild }}' != '' ]; then
4843
portableBuildArgs='/p:PortableBuild=${{ parameters.platform.portableBuild }}'
@@ -55,7 +50,6 @@ steps:
5550
${{ parameters.platform.buildArguments }} \
5651
$internalRuntimeDownloadArgs \
5752
$targetRidArgs \
58-
$baseRidArgs \
5953
$portableBuildArgs \
6054
displayName: Build
6155

0 commit comments

Comments
 (0)
0