Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21fb96b

Browse files
authored
Try to untangle the rid calculation. (#82832)
* Try to untangle the rid calculation. * Ignore __portableOS. * Add back musl detection. * Try fix AnyOS tests. * Try fix coreclr linux_musl_arm64 job. * src/tests/build.proj: use PackageRID for restore. * Use RuntimeOS as an override for _packageOS. * Remove (probably) out-dated override for non-portable ToolsRID. * CI cross-builds for linux-musl use linux. * Add missing arch to rid. * Try simplified ToolsRID. * Update comments. * Rename OutputRid to OutputRID. * Tweak comment. * Move TargetsLinux{Bionic,Musl} with the other Targets properties. * Don't use RuntimeOS for PackageRID for CrossBuilds. * Move RuntimeOS condition to ToolsRID assignment. * Clean up a few things. * Fix broken Condition. * Try fix the linux-bionic build. * Try fix the linux-bionic build, part II. * Try fix the linux-bionic build, part III. * Fix PackageRID. * Use RuntimeOS as _packageOS override. * Remove RuntimeOS. * Fix '-os linux-musl' mapping. * Clean up . * Rename __PortableOS to __PortableTargetOS. * Extend comments. * Extend OutputRID comment too. * build.sh: include linux-bionic, linux-musl in usage. * SourceBuild.props: no need to pass RuntimeOS. Only set ToolsOS, PackageOS when RuntimeOS is not empty. * Fix comment. * linux-bionic doesn't get built on linux-bionic. * Unconditionally assign TargetsLinuxBionic/TargetsLinuxMusl. * Remove SkipInferTargetOSName.
1 parent ab2b80d commit 21fb96b

File tree

41 files changed

+181
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+181
-281
lines changed

Directory.Build.props

Lines changed: 63 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -177,89 +177,86 @@
177177
<InstallWasmtimeForTests Condition="'$(InstallWasmtimeForTests)' == '' and !Exists($(WasmtimeDir))">true</InstallWasmtimeForTests>
178178
</PropertyGroup>
179179

180-
<PropertyGroup Label="CalculateOS">
181-
<!-- Default to portable build if not explicitly set -->
180+
<PropertyGroup Label="CalculatePortableBuild">
182181
<PortableBuild Condition="'$(PortableBuild)' == '' and '$(DotNetBuildFromSource)' == 'true'">false</PortableBuild>
183182
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
183+
</PropertyGroup>
184184

185-
<_hostRid Condition="'$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</_hostRid>
186-
<_hostRid Condition="'$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</_hostRid>
185+
<!-- _portableOS is the portable rid-OS corresponding to the target platform. -->
186+
<PropertyGroup Label="CalculatePortableOS">
187+
<!-- To determine _portableOS we use TargetOS.
188+
TargetOS is not a rid-OS. For example: for Windows it is 'windows' instead of 'win'.
189+
And, for flavors of Linux, like 'linux-musl' and 'linux-bionic', TargetOS is 'linux'. -->
187190

188-
<_parseDistroRid>$(__DistroRid)</_parseDistroRid>
189-
<_parseDistroRid Condition="'$(_parseDistroRid)' == ''">$(_hostRid)</_parseDistroRid>
190-
<_distroRidIndex>$(_parseDistroRid.LastIndexOf('-'))</_distroRidIndex>
191+
<_portableOS>$(TargetOS.ToLowerInvariant())</_portableOS>
192+
<_portableOS Condition="'$(_portableOS)' == 'windows'">win</_portableOS>
191193

192-
<_runtimeOS>$(RuntimeOS)</_runtimeOS>
193-
<_runtimeOS Condition="'$(_runtimeOS)' == ''">$(_parseDistroRid.SubString(0, $(_distroRidIndex)))</_runtimeOS>
194-
195-
<!-- _runtimeOS is calculated based on the build system OS, however if building for Browser/iOS/Android we need to let
196-
the build system to use browser/ios/android as the _runtimeOS for produced package RIDs. -->
197-
<_runtimeOS Condition="'$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</_runtimeOS>
198-
199-
<_portableOS>linux</_portableOS>
200-
<_portableOS Condition="'$(_runtimeOS)' == 'linux-musl' or $(_runtimeOS.StartsWith('alpine'))">linux-musl</_portableOS>
201-
<_portableOS Condition="'$(_runtimeOS)' == 'linux-bionic'">linux-bionic</_portableOS>
202-
<_portableOS Condition="'$(_hostOS)' == 'osx'">osx</_portableOS>
203-
<_portableOS Condition="'$(_runtimeOS)' == 'win' or '$(TargetOS)' == 'windows'">win</_portableOS>
204-
<_portableOS Condition="'$(_runtimeOS)' == 'freebsd' or '$(TargetOS)' == 'freebsd'">freebsd</_portableOS>
205-
<_portableOS Condition="'$(_runtimeOS)' == 'illumos' or '$(TargetOS)' == 'illumos'">illumos</_portableOS>
206-
<_portableOS Condition="'$(_runtimeOS)' == 'solaris' or '$(TargetOS)' == 'solaris'">solaris</_portableOS>
207-
<_portableOS Condition="'$(_runtimeOS)' == 'browser'">browser</_portableOS>
208-
<_portableOS Condition="'$(_runtimeOS)' == 'wasi'">wasi</_portableOS>
209-
<_portableOS Condition="'$(_runtimeOS)' == 'maccatalyst'">maccatalyst</_portableOS>
210-
<_portableOS Condition="'$(_runtimeOS)' == 'ios'">ios</_portableOS>
211-
<_portableOS Condition="'$(_runtimeOS)' == 'iossimulator'">iossimulator</_portableOS>
212-
<_portableOS Condition="'$(_runtimeOS)' == 'tvos'">tvos</_portableOS>
213-
<_portableOS Condition="'$(_runtimeOS)' == 'tvossimulator'">tvossimulator</_portableOS>
214-
<_portableOS Condition="'$(_runtimeOS)' == 'android'">android</_portableOS>
215-
216-
<_runtimeOS Condition="$(_runtimeOS.StartsWith('tizen'))">linux</_runtimeOS>
217-
<_runtimeOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_runtimeOS>
218-
<_runtimeOS Condition="'$(RuntimeOS)' == '' and '$(DotNetBuildFromSource)' == 'true'">$(_portableOS)</_runtimeOS>
219-
220-
<_packageLibc Condition="$(_runtimeOS.Contains('musl'))">-musl</_packageLibc>
221-
<_packageOS Condition="'$(CrossBuild)' == 'true'">$(_hostOS)$(_packageLibc)</_packageOS>
222-
<_packageOS Condition="'$(_packageOS)' == '' and '$(PortableBuild)' == 'true'">$(_portableOS)</_packageOS>
223-
<_packageOS Condition="'$(_packageOS)' == ''">$(_runtimeOS)</_packageOS>
194+
<!-- TargetOS=AnyOS is a sentinel value used by tests, ignore it. -->
195+
<_portableOS Condition="'$(_portableOS)' == 'anyos'">$(__PortableTargetOS)</_portableOS>
196+
197+
<!-- Detect linux flavors using __PortableTargetOS from the native script. -->
198+
<_portableOS Condition="'$(_portableOS)' == 'linux' and '$(__PortableTargetOS)' == 'linux-musl'">linux-musl</_portableOS>
199+
<_portableOS Condition="'$(_portableOS)' == 'linux' and '$(__PortableTargetOS)' == 'linux-bionic'">linux-bionic</_portableOS>
200+
</PropertyGroup>
201+
202+
<!-- PackageRID is used for packages needed for the target. -->
203+
<PropertyGroup Label="CalculatePackageRID">
204+
<_packageOS>$(_portableOS)</_packageOS>
205+
206+
<_packageOS Condition="'$(CrossBuild)' == 'true' and '$(_portableOS)' != 'linux-musl' and '$(_portableOS)' != 'linux-bionic'">$(_hostOS)</_packageOS>
207+
208+
<!-- source-build sets PackageOS to build with non-portable rid packages that were source-built previously. -->
209+
<PackageRID Condition="'$(PackageOS)' != ''">$(PackageOS)-$(TargetArchitecture)</PackageRID>
210+
<PackageRID>$(_packageOS)-$(TargetArchitecture)</PackageRID>
224211
</PropertyGroup>
225212

226-
<PropertyGroup Label="CalculateRID">
227-
<_toolsRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS)-$(_hostArch)</_toolsRID>
228-
<_toolsRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64</_toolsRID>
229-
<_toolsRID Condition="'$(_toolsRID)' == ''">$(_runtimeOS)-$(_hostArch)</_toolsRID>
213+
<!-- ToolsRID is used for packages needed on the build host. -->
214+
<PropertyGroup Label="CalculateToolsRID">
215+
<!-- _portableHostOS is the portable rid-OS corresponding to the build host platform.
230216
231-
<!-- There are no WebAssembly tools, so use the default ones -->
232-
<_toolsRID Condition="'$(_runtimeOS)' == 'browser' or '$(_runtimeOS)' == 'wasi'">linux-x64</_toolsRID>
233-
<_toolsRID Condition="('$(_runtimeOS)' == 'browser' or '$(_runtimeOS)' == 'wasi') and '$(HostOS)' == 'windows'">win-x64</_toolsRID>
234-
<_toolsRID Condition="('$(_runtimeOS)' == 'browser' or '$(_runtimeOS)' == 'wasi') and '$(HostOS)' == 'osx'">osx-x64</_toolsRID>
217+
To determine _portableHostOS we use _hostOS, similar to how _portableOS is calculated from TargetOS.
235218
236-
<!-- There are no Android tools, so use the default ones -->
237-
<_toolsRID Condition="'$(_runtimeOS)' == 'android' or '$(_runtimeOS)' == 'linux-bionic'">linux-x64</_toolsRID>
238-
<_toolsRID Condition="('$(_runtimeOS)' == 'android' or '$(_runtimeOS)' == 'linux-bionic') and '$(HostOS)' == 'windows'">win-x64</_toolsRID>
239-
<_toolsRID Condition="('$(_runtimeOS)' == 'android' or '$(_runtimeOS)' == 'linux-bionic') and '$(HostOS)' == 'osx'">osx-x64</_toolsRID>
219+
When we're not cross-building we can detect linux flavors by looking at _portableOS
220+
because the target platform and the build host platform are the same.
221+
For cross-builds, we're currently unable to detect the flavors. -->
222+
<_portableHostOS>$(_hostOS)</_portableHostOS>
223+
<_portableHostOS Condition="'$(_portableHostOS)' == 'windows'">win</_portableHostOS>
224+
<_portableHostOS Condition="'$(CrossBuild)' != 'true' and '$(_portableOS)' == 'linux-musl'">linux-musl</_portableHostOS>
240225

241-
<!-- There are no Mac Catalyst, iOS or tvOS tools and it can be built on OSX only, so use that -->
242-
<_toolsRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iossimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvossimulator'">osx-x64</_toolsRID>
226+
<!-- source-build sets ToolsOS to build with non-portable rid packages that were source-built previously. -->
227+
<ToolsRID Condition="'$(ToolsOS)' != ''">$(ToolsOS)-$(_hostArch)</ToolsRID>
228+
<ToolsRID Condition="'$(ToolsRID)' == ''">$(_portableHostOS)-$(_hostArch)</ToolsRID>
243229

244-
<!-- There are no non-portable builds for Ilasm, Ildasm, ILC etc. -->
245-
<ToolsRID Condition="'$(PortableBuild)' != 'true' and '$(_portableOS)' == 'linux'">linux-$(_hostArch)</ToolsRID>
246-
<ToolsRID Condition="'$(ToolsRID)' == ''">$(_toolsRID)</ToolsRID>
230+
<!-- Microsoft.NET.Sdk.IL SDK defaults to the portable host rid. Match it to ToolsRID (for source-build). -->
247231
<MicrosoftNetCoreIlasmPackageRuntimeId>$(ToolsRID)</MicrosoftNetCoreIlasmPackageRuntimeId>
232+
</PropertyGroup>
248233

249-
<PackageRID>$(_packageOS)-$(TargetArchitecture)</PackageRID>
234+
<!-- OutputRID is used to name the target platform.
235+
For portable builds, OutputRID matches _portableOS.
236+
For non-portable builds, it uses __DistroRid (from the native build script), or falls back to RuntimeInformation.RuntimeIdentifier.
237+
Source-build sets OutputRID directly. -->
238+
<PropertyGroup Label="CalculateOutputRID">
250239

251-
<OutputRid Condition="'$(OutputRid)' == '' and '$(DotNetBuildFromSource)' == 'true'">$(_hostRid)</OutputRid>
252-
<OutputRid Condition="'$(OutputRid)' == ''">$(PackageRID)</OutputRid>
253-
<OutputRid Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(TargetArchitecture)</OutputRid>
254-
<TargetsLinuxBionic Condition="$(OutputRid.StartsWith('linux-bionic'))">true</TargetsLinuxBionic>
255-
<TargetsLinuxMusl Condition="'$(_portableOS)' == 'linux-musl'">true</TargetsLinuxMusl>
240+
<_hostRid Condition="'$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</_hostRid>
241+
<_hostRid Condition="'$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</_hostRid>
242+
243+
<_parseDistroRid>$(__DistroRid)</_parseDistroRid>
244+
<_parseDistroRid Condition="'$(_parseDistroRid)' == ''">$(_hostRid)</_parseDistroRid>
245+
<_distroRidIndex>$(_parseDistroRid.LastIndexOf('-'))</_distroRidIndex>
246+
247+
<_outputOS>$(_parseDistroRid.SubString(0, $(_distroRidIndex)))</_outputOS>
248+
<_outputOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_outputOS>
249+
250+
<OutputRID Condition="'$(OutputRID)' == ''">$(_outputOS)-$(TargetArchitecture)</OutputRID>
256251
</PropertyGroup>
257252

258-
<PropertyGroup Label="CalculateTargetOSName" Condition="'$(SkipInferTargetOSName)' != 'true'">
253+
<PropertyGroup Label="CalculateTargetOSName">
259254
<TargetsFreeBSD Condition="'$(TargetOS)' == 'freebsd'">true</TargetsFreeBSD>
260255
<Targetsillumos Condition="'$(TargetOS)' == 'illumos'">true</Targetsillumos>
261256
<TargetsSolaris Condition="'$(TargetOS)' == 'solaris'">true</TargetsSolaris>
262257
<TargetsLinux Condition="'$(TargetOS)' == 'linux' or '$(TargetOS)' == 'android'">true</TargetsLinux>
258+
<TargetsLinuxBionic Condition="'$(_portableOS)' == 'linux-bionic'">true</TargetsLinuxBionic>
259+
<TargetsLinuxMusl Condition="'$(_portableOS)' == 'linux-musl'">true</TargetsLinuxMusl>
263260
<TargetsNetBSD Condition="'$(TargetOS)' == 'netbsd'">true</TargetsNetBSD>
264261
<TargetsOSX Condition="'$(TargetOS)' == 'osx'">true</TargetsOSX>
265262
<TargetsMacCatalyst Condition="'$(TargetOS)' == 'maccatalyst'">true</TargetsMacCatalyst>
@@ -279,14 +276,14 @@
279276
<MicrosoftNetCoreAppRefPackRefDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'ref', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRefPackRefDir>
280277
<MicrosoftNetCoreAppRefPackDataDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'data'))</MicrosoftNetCoreAppRefPackDataDir>
281278

282-
<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(OutputRid)', '$(LibrariesConfiguration)'))</MicrosoftNetCoreAppRuntimePackDir>
283-
<MicrosoftNetCoreAppRuntimePackRidDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(OutputRid)'))</MicrosoftNetCoreAppRuntimePackRidDir>
279+
<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(OutputRID)', '$(LibrariesConfiguration)'))</MicrosoftNetCoreAppRuntimePackDir>
280+
<MicrosoftNetCoreAppRuntimePackRidDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(OutputRID)'))</MicrosoftNetCoreAppRuntimePackRidDir>
284281
<MicrosoftNetCoreAppRuntimePackRidLibTfmDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'lib', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRuntimePackRidLibTfmDir>
285282
<MicrosoftNetCoreAppRuntimePackNativeDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'native'))</MicrosoftNetCoreAppRuntimePackNativeDir>
286283
</PropertyGroup>
287284

288285
<PropertyGroup>
289-
<DotNetHostBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(OutputRid).$(HostConfiguration)', 'corehost'))</DotNetHostBinDir>
286+
<DotNetHostBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(OutputRID).$(HostConfiguration)', 'corehost'))</DotNetHostBinDir>
290287
</PropertyGroup>
291288

292289
<!--Feature switches -->

docs/coding-guidelines/project-guidelines.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ The following are the properties associated with each build pivot
2929
- `$(TargetOS) -> windows | linux | osx | freebsd | ... | [defaults to running OS when empty]`
3030
- `$(Configuration) -> Debug | Release | [defaults to Debug when empty]`
3131
- `$(TargetArchitecture) - x86 | x64 | arm | arm64 | [defaults to x64 when empty]`
32-
- `$(RuntimeOS) - win7 | osx10.10 | ubuntu.14.04 | [any other RID OS+version] | [defaults to running OS when empty]` See [RIDs](https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.NETCore.Platforms) for more info.
3332

3433
## Aggregate build properties
3534
Each project will define a set of supported TargetFrameworks
@@ -63,8 +62,6 @@ A full or individual project build is centered around BuildTargetFramework, Targ
6362
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `net8.0-[TargetOS Running On]-Debug-x64`.
6463
3. When building an individual project (either from the CLI or an IDE), all target frameworks are built.
6564

66-
We also have `RuntimeOS` which can be passed to customize the specific OS and version needed for native package builds as well as package restoration. If not passed it will default based on the OS you are running on.
67-
6865
Any of the mentioned properties can be set via `/p:<Property>=<Value>` at the command line. When building using any of the wrapper scripts around it (i.e. build.cmd) a number of these properties have aliases which make them easier to pass (run build.cmd/sh -? for the aliases).
6966

7067
## Selecting the correct BuildSettings

eng/SourceBuild.props

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
<InnerBuildArgs>$(InnerBuildArgs) --nodereuse false</InnerBuildArgs>
3232
<InnerBuildArgs>$(InnerBuildArgs) --warnAsError false</InnerBuildArgs>
3333
<InnerBuildArgs>$(InnerBuildArgs) --outputrid $(TargetRid)</InnerBuildArgs>
34-
<!-- RuntimeOS is the build host rid OS. -->
35-
<InnerBuildArgs>$(InnerBuildArgs) /p:RuntimeOS=$(RuntimeOS)</InnerBuildArgs>
34+
<!-- PackageOS and ToolsOS control the rids of prebuilts consumed by the build.
35+
They are set to RuntimeOS so they match with the build SDK rid. -->
36+
<InnerBuildArgs Condition="'$(RuntimeOS)' != ''">$(InnerBuildArgs) /p:PackageOS=$(RuntimeOS) /p:ToolsOS=$(RuntimeOS)</InnerBuildArgs>
3637
<!-- BaseOS is an expected known rid in the graph that TargetRid is compatible with.
37-
It's used to add TargetRid in the graph if the parent can't be detected. -->
38+
It's used to add TargetRid in the graph if the parent can't be detected. -->
3839
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
3940
<InnerBuildArgs Condition="'$(OfficialBuildId)' != ''">$(InnerBuildArgs) /p:OfficialBuildId=$(OfficialBuildId)</InnerBuildArgs>
4041
<InnerBuildArgs Condition="'$(ContinuousIntegrationBuild)' != ''">$(InnerBuildArgs) /p:ContinuousIntegrationBuild=$(ContinuousIntegrationBuild)</InnerBuildArgs>

eng/build.ps1

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,6 @@ foreach ($config in $configuration) {
304304
$argumentsWithConfig = $arguments + " -configuration $((Get-Culture).TextInfo.ToTitleCase($config))";
305305
foreach ($singleArch in $arch) {
306306
$argumentsWithArch = "/p:TargetArchitecture=$singleArch " + $argumentsWithConfig
307-
if ($os -eq "browser") {
308-
$env:__DistroRid="browser-$singleArch"
309-
} elseif ($os -eq "wasi") {
310-
$env:__DistroRid="wasi-$singleArch"
311-
} else {
312-
$env:__DistroRid="win-$singleArch"
313-
}
314307
Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $argumentsWithArch"
315308
if ($lastExitCode -ne 0) {
316309
$failedBuilds += "Configuration: $config, Architecture: $singleArch"

eng/build.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ usage()
3131
echo " --librariesConfiguration (-lc) Libraries build configuration: Debug or Release."
3232
echo " [Default: Debug]"
3333
echo " --os Target operating system: windows, linux, freebsd, osx, maccatalyst, tvos,"
34-
echo " tvossimulator, ios, iossimulator, android, browser, wasi, netbsd, illumos or solaris."
34+
echo " tvossimulator, ios, iossimulator, android, browser, wasi, netbsd, illumos, solaris"
35+
echo " linux-musl or linux-bionic."
3536
echo " [Default: Your machine's OS.]"
3637
echo " --outputrid <rid> Optional argument that overrides the target rid name."
3738
echo " --projects <value> Project or solution file(s) to build."
@@ -134,15 +135,15 @@ initDistroRid()
134135

135136
local passedRootfsDir=""
136137
local targetOs="$1"
137-
local buildArch="$2"
138+
local targetArch="$2"
138139
local isCrossBuild="$3"
139140
local isPortableBuild="$4"
140141

141142
# Only pass ROOTFS_DIR if __DoCrossArchBuild is specified and the current platform is not OSX that doesn't use rootfs
142143
if [[ $isCrossBuild == 1 && "$targetOs" != "osx" ]]; then
143144
passedRootfsDir=${ROOTFS_DIR}
144145
fi
145-
initDistroRidGlobal ${targetOs} ${buildArch} ${isPortableBuild} ${passedRootfsDir}
146+
initDistroRidGlobal "${targetOs}" "${targetArch}" "${isPortableBuild}" "${passedRootfsDir}"
146147
}
147148

148149
showSubsetHelp()
@@ -286,6 +287,14 @@ while [[ $# > 0 ]]; do
286287
os="illumos" ;;
287288
solaris)
288289
os="solaris" ;;
290+
linux-bionic)
291+
os="linux"
292+
__PortableTargetOS=linux-bionic
293+
;;
294+
linux-musl)
295+
os="linux"
296+
__PortableTargetOS=linux-musl
297+
;;
289298
*)
290299
echo "Unsupported target OS '$2'."
291300
echo "The allowed values are windows, linux, freebsd, osx, maccatalyst, tvos, tvossimulator, ios, iossimulator, android, browser, wasi, illumos and solaris."
@@ -438,7 +447,7 @@ while [[ $# > 0 ]]; do
438447
echo "No value for outputrid is supplied. See help (--help) for supported values." 1>&2
439448
exit 1
440449
fi
441-
arguments="$arguments /p:OutputRid=$(echo "$2" | tr "[:upper:]" "[:lower:]")"
450+
arguments="$arguments /p:OutputRID=$(echo "$2" | tr "[:upper:]" "[:lower:]")"
442451
shift 2
443452
;;
444453

@@ -516,7 +525,7 @@ if [[ "${TreatWarningsAsErrors:-}" == "false" ]]; then
516525
arguments="$arguments -warnAsError 0"
517526
fi
518527

519-
initDistroRid $os $arch $crossBuild $portableBuild
528+
initDistroRid "$os" "$arch" "$crossBuild" "$portableBuild"
520529

521530
# Disable targeting pack caching as we reference a partially constructed targeting pack and update it later.
522531
# The later changes are ignored when using the cache.

eng/common/templates/steps/source-build.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ steps:
6363
targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}'
6464
fi
6565
66-
runtimeOsArgs=
67-
if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then
68-
runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}'
69-
fi
70-
7166
publishArgs=
7267
if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then
7368
publishArgs='--publish'
@@ -85,7 +80,6 @@ steps:
8580
$internalRuntimeDownloadArgs \
8681
$internalRestoreArgs \
8782
$targetRidArgs \
88-
$runtimeOsArgs \
8983
/p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \
9084
/p:ArcadeBuildFromSource=true \
9185
/p:AssetManifestFileName=$assetManifestFileName

0 commit comments

Comments
 (0)