Skip to content

Commit fdee73e

Browse files
committed
Tweak to align to output control variables
1 parent 5747f07 commit fdee73e

29 files changed

+142
-128
lines changed

Directory.Build.props

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,16 @@
2323

2424
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
2525

26+
<Import Project="eng/OSArch.props" />
27+
<Import Project="eng/RuntimeIdentifiers.props" />
28+
2629
<!--
27-
$(TargetOS) - target operating system (win, linux, osx). Defaults to host OS.
28-
$(TargetArch) - architecture to test (x64, x86, arm, arm64). Defaults to host architecture.
29-
$(TargetRid) - the runtime identifier (rid) to against (win-x64, linux-arm64, linux-musl-x64, etc).
3030
$(Configuration) - configuration to test (Debug, Release). Defaults to Debug.
3131
$(ArtifactsBinDir) - artifacts\bin directory
3232
-->
3333

34-
<PropertyGroup Condition="'$(TargetOS)' == ''">
35-
<TargetOS>linux</TargetOS>
36-
<TargetOS Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">Windows_NT</TargetOS>
37-
<TargetOS Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">linux</TargetOS>
38-
<TargetOS Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">osx</TargetOS>
39-
</PropertyGroup>
40-
4134
<PropertyGroup>
42-
<TargetArch Condition="'$(TargetArch)' == ''">$(Platform)</TargetArch>
43-
<TargetArch Condition="'$(TargetArch)' == 'AnyCpu'">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</TargetArch>
44-
<ArtifactsBinNativeDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(TargetOS).$(TargetArch).$(Configuration)'))</ArtifactsBinNativeDir>
45-
</PropertyGroup>
46-
47-
<PropertyGroup Condition="'$(TargetRid)' == ''">
48-
<TargetRidOS>$(TargetOS)</TargetRidOS>
49-
<TargetRidOS Condition="'$(TargetOS)' == 'Windows_NT'">win</TargetRidOS>
50-
<TargetRid>$(TargetRidOS)-$(TargetArch)</TargetRid>
35+
<ArtifactsBinNativeDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(TargetOS).$(TargetArchitecture).$(Configuration)'))</ArtifactsBinNativeDir>
5136
</PropertyGroup>
5237

5338
<PropertyGroup>

diagnostics.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ extends:
7777
artifactUploadPath: bin
7878
- configuration: Release
7979
architecture: x86
80-
artifactUploadPath: bin/Windows_NT.x86.Release
80+
artifactUploadPath: bin/windows.x86.Release
8181
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
8282
- configuration: Release
8383
architecture: arm64
84-
artifactUploadPath: bin/Windows_NT.arm64.Release
84+
artifactUploadPath: bin/windows.arm64.Release
8585

8686
- template: /eng/pipelines/build.yml
8787
parameters:

documentation/building/windows-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ build.cmd
9494
[Lots of build spew]
9595
9696
BUILD: Repo sucessfully built.
97-
BUILD: Product binaries are available at c:\git\diagnostics\artifacts\Debug\bin\Windows_NT.x64
97+
BUILD: Product binaries are available at c:\git\diagnostics\artifacts\Debug\bin\windows.x64
9898
```
9999

100100
To build for x86:

documentation/using-sos-private-build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Before we can use the private build, of course, we must build it first. [Here](h
99
On Windows, [Debugging Tools for Windows](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools) (aka WinDBG) automatically loads a shipped version of sos.dll from the extension gallery whenever it notices a managed runtime is loaded. In order to avoid that behavior, we need to make sure sos is loaded before it encounters the managed runtime, for the launch scenario, we can do this before running anything.
1010

1111
```
12-
0:000> .load <reporoot>\artifacts\bin\Windows_NT.x64.Debug\sos.dll
12+
0:000> .load <reporoot>\artifacts\bin\windows.x64.Debug\sos.dll
1313
```
1414

1515
In the attach scenario, we need to do things differently. We couldn't stop WinDBG from loading the shipped sos, but we can replace it.
1616

1717
```
1818
0:000> .unload sos
19-
0:000> .load <reporoot>\artifacts\bin\Windows_NT.x64.Debug\sos.dll
19+
0:000> .load <reporoot>\artifacts\bin\windows.x64.Debug\sos.dll
2020
```
2121

2222
This will ensure you are using your own sos.dll, of course you might have a different full path to `sos.dll`.

eng/Build-Native.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if /i "%PROCESSOR_ARCHITECTURE%" == "arm64" set __TargetArch=arm64
3535
if /i "%PROCESSOR_ARCHITECTURE%" == "x86" set __TargetArch=x86
3636
set __HostArch=
3737
set __BuildType=Debug
38-
set __TargetOS=Windows_NT
38+
set __TargetOS=windows
3939
set __BuildNative=1
4040
set __CI=0
4141
set __Verbosity=minimal
@@ -118,7 +118,7 @@ set "__CMakeBinDir=%__BinDir%"
118118
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
119119

120120
:: Common msbuild arguments
121-
set "__CommonBuildArgs=/v:!__Verbosity! /p:Configuration=%__BuildType% /p:TargetOS=%__TargetOS% /p:TargetArch=%__TargetArch% %__UnprocessedBuildArgs%"
121+
set "__CommonBuildArgs=/v:!__Verbosity! /p:Configuration=%__BuildType% /p:TargetOS=%__TargetOS% /p:TargetArchitecture=%__TargetArch% %__UnprocessedBuildArgs%"
122122

123123
if not exist "%__BinDir%" md "%__BinDir%"
124124
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"

eng/InstallNativePackages.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- All Rights Reserved. Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
22
<Project>
33
<!--
4-
$(ArtifactsBinNativeDir) - Native artifacts directory (e.g. artifacts\bin\Windows_NT.x64.Debug).
4+
$(ArtifactsBinNativeDir) - Native artifacts directory (e.g. artifacts\bin\windows.x64.Debug).
55
$(TargetRid) - Target runtime identifier (e.g. win-x64, linux-x64, osx-x64).
66
77
From Versions.props:
@@ -21,7 +21,7 @@
2121
-->
2222

2323
<ItemGroup>
24-
<PackageDownload Include="Microsoft.DiaSymReader.Native" Version="[$(MicrosoftDiaSymReaderNativeVersion)]" Condition="'$(OS)' == 'Windows_NT'" />
24+
<PackageDownload Include="Microsoft.DiaSymReader.Native" Version="[$(MicrosoftDiaSymReaderNativeVersion)]" Condition="'$(BuildOS)' == 'windows'" />
2525
<PackageDownload Include="runtime.win-x64.Microsoft.DotNet.Cdac.Transport" Version="[$(runtimewinx64MicrosoftDotNetCdacTransportVersion)]" Condition="'$(TargetRid)' == 'win-x64'"/>
2626
<PackageDownload Include="runtime.win-arm64.Microsoft.DotNet.Cdac.Transport" Version="[$(runtimewinarm64MicrosoftDotNetCdacTransportVersion)]" Condition="'$(TargetRid)' == 'win-arm64'"/>
2727
<PackageDownload Include="runtime.linux-x64.Microsoft.DotNet.Cdac.Transport" Version="[$(runtimelinuxx64MicrosoftDotNetCdacTransportVersion)]" Condition="'$(TargetRid)' == 'linux-x64'"/>
@@ -31,7 +31,7 @@
3131
</ItemGroup>
3232

3333
<ItemGroup>
34-
<PackageSourceFiles Include="$(NuGetPackageRoot)microsoft.diasymreader.native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\$(TargetRid)\native\*" Condition="'$(OS)' == 'Windows_NT'" />
34+
<PackageSourceFiles Include="$(NuGetPackageRoot)microsoft.diasymreader.native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\$(TargetRid)\native\*" Condition="'$(BuildOS)' == 'windows'" />
3535
<PackageSourceFiles Include="$(NuGetPackageRoot)runtime.win-x64.microsoft.dotnet.cdac.transport\$(runtimewinx64MicrosoftDotNetCdacTransportVersion)\runtimes\win-x64\native\*" Condition="'$(TargetRid)' == 'win-x64'" />
3636
<PackageSourceFiles Include="$(NuGetPackageRoot)runtime.win-arm64.microsoft.dotnet.cdac.transport\$(runtimewinarm64MicrosoftDotNetCdacTransportVersion)\runtimes\win-arm64\native\*" Condition="'$(TargetRid)' == 'win-arm64'" />
3737
<PackageSourceFiles Include="$(NuGetPackageRoot)runtime.linux-x64.microsoft.dotnet.cdac.transport\$(runtimelinuxx64MicrosoftDotNetCdacTransportVersion)\runtimes\linux-x64\native\*" Condition="'$(TargetRid)' == 'linux-x64'" />

eng/InstallRuntimes.proj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- All Rights Reserved. Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
22
<Project Sdk="Microsoft.Build.NoTargets">
33
<!--
4-
$(TargetArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
4+
$(TargetArchitecture) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
55
$(LiveRuntimeDir) - path to the locally built runtime to use for testing.
66
77
From Versions.props:
@@ -22,18 +22,18 @@
2222
<LiveRuntimeDir Condition="'$(LiveRuntimeDir)' != ''">$([MSBuild]::NormalizePath('$(LiveRuntimeDir)'))</LiveRuntimeDir>
2323
</PropertyGroup>
2424

25-
<PropertyGroup Condition="'$(TargetArch)' != 'x86'">
25+
<PropertyGroup Condition="'$(TargetArchitecture)' != 'x86'">
2626
<DotNetInstallRoot>$(RepoRoot).dotnet-test\</DotNetInstallRoot>
2727
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE</RegistryRoot>
2828
</PropertyGroup>
2929

30-
<PropertyGroup Condition="'$(TargetArch)' == 'x86'">
30+
<PropertyGroup Condition="'$(TargetArchitecture)' == 'x86'">
3131
<DotNetInstallRoot>$(RepoRoot).dotnet-test\x86\</DotNetInstallRoot>
3232
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node</RegistryRoot>
3333
</PropertyGroup>
3434

3535
<PropertyGroup>
36-
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(BuildArch) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
36+
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(TargetArchitecture) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
3737
<DotNetInstallDir>$([MSBuild]::NormalizeDirectory('$(DotNetInstallRoot)', 'shared', 'Microsoft.NETCore.App', '$(MicrosoftNETCoreAppRefVersion)'))</DotNetInstallDir>
3838
<TestConfigFileName>$(DotNetInstallRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
3939
</PropertyGroup>

eng/OSArch.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
<!--
3+
$(TargetOS) - target operating system (win, linux, osx). Defaults to host OS.
4+
$(TargetArchitecture) - architecture to test (x64, x86, arm, arm64). Defaults to host architecture.
5+
-->
6+
<PropertyGroup>
7+
<BuildOS>linux</BuildOS>
8+
<BuildOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx</BuildOS>
9+
<BuildOS Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">windows</BuildOS>
10+
11+
<TargetOS Condition="'$(TargetOS)' == ''">$(BuildOS)</TargetOS>
12+
<HostOS Condition="'$(HostOS)' == ''">$(TargetOS)</HostOS>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">$(Platform)</TargetArchitecture>
17+
<TargetArchitecture Condition="'$(TargetArchitecture)' == 'AnyCpu'">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</TargetArchitecture>
18+
</PropertyGroup>
19+
</Project>

eng/RuntimeIdentifiers.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<!--
3+
$(TargetRid) - the runtime identifier (rid) to against (win-x64, linux-arm64, linux-musl-x64, etc).
4+
-->
5+
<PropertyGroup Condition="'$(TargetRid)' == ''">
6+
<TargetRidOS>$(TargetOS)</TargetRidOS>
7+
<TargetRidOS Condition="'$(TargetOS)' == 'windows'">win</TargetRidOS>
8+
<TargetRid>$(TargetRidOS)-$(TargetArchitecture)</TargetRid>
9+
</PropertyGroup>
10+
</Project>

eng/build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ switch ($configuration.ToLower()) {
3838
$reporoot = Join-Path $PSScriptRoot ".."
3939
$engroot = Join-Path $reporoot "eng"
4040
$artifactsdir = Join-Path $reporoot "artifacts"
41-
$os = "Windows_NT"
41+
$os = "windows"
4242
$logdir = Join-Path $artifactsdir "log"
43-
$logdir = Join-Path $logdir Windows_NT.$architecture.$configuration
43+
$logdir = Join-Path $logdir windows.$architecture.$configuration
4444

4545
if ($ci) {
4646
$remainingargs = "-ci " + $remainingargs
@@ -64,7 +64,7 @@ if (-not $skipnative) {
6464

6565
# Install sdk for building, restore and build managed components.
6666
if (-not $skipmanaged) {
67-
Invoke-Expression "& `"$engroot\common\build.ps1`" -configuration $configuration -verbosity $verbosity /p:TargetOS=$os /p:TargetArch=$architecture /p:TestArchitectures=$architecture $remainingargs"
67+
Invoke-Expression "& `"$engroot\common\build.ps1`" -configuration $configuration -verbosity $verbosity /p:TargetOS=$os /p:TargetArchitecture=$architecture /p:TestArchitectures=$architecture $remainingargs"
6868

6969
if ($lastExitCode -ne 0) {
7070
exit $lastExitCode
@@ -84,7 +84,7 @@ if ($installruntimes -or $privatebuild) {
8484
/bl:$logdir\InstallRuntimes.binlog `
8585
/p:PrivateBuildTesting=$privatebuildtesting `
8686
/p:TargetOS=$os `
87-
/p:TargetArch=$architecture `
87+
/p:TargetArchitecture=$architecture `
8888
/p:TestArchitectures=$architecture `
8989
/p:LiveRuntimeDir="$liveRuntimeDir"
9090
}
@@ -102,7 +102,7 @@ if ($test) {
102102
-ci:$ci `
103103
/bl:$logdir\Test.binlog `
104104
/p:TargetOS=$os `
105-
/p:TargetArch=$architecture `
105+
/p:TargetArchitecture=$architecture `
106106
/p:TestArchitectures=$architecture `
107107
/p:DotnetRuntimeVersion="$dotnetruntimeversion" `
108108
/p:DotnetRuntimeDownloadVersion="$dotnetruntimedownloadversion" `

0 commit comments

Comments
 (0)