Skip to content

Commit 4e46ba6

Browse files
mikem8361Mike McLaughlinsteveisok
authored
Consume cDac package and other cleanup (#5482)
Create a InstallNativePackages.proj that downloads the native diasymreader and cdac packages. Note that cdac packages are opt in via `PackageWithCDac`. Add InstallNativePackages to native-prereqs.proj Move the native binary copies out of the build.sh/build-native.cmd scripts to the appropriate managed project Move the rest of the binary copying from the cmake files to the managed projects Switch the Windows native builds to use ninja. Add the -msbuild/-ninja build-native.cmd options. --------- Co-authored-by: Mike McLaughlin <[email protected]> Co-authored-by: Steve Pfister <[email protected]>
1 parent 1586391 commit 4e46ba6

26 files changed

+306
-159
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
cmake_minimum_required(VERSION 3.15)
66

77
cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default.
8+
if(POLICY CMP0177)
9+
cmake_policy(SET CMP0177 NEW) # install() paths are normalized
10+
endif(POLICY CMP0177)
11+
812

913
# Set the project name
1014
project(diagnostics)

Directory.Build.props

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,35 @@
2121
<RepositoryName>diagnostics</RepositoryName>
2222
</PropertyGroup>
2323

24+
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
25+
26+
<!--
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).
30+
$(Configuration) - configuration to test (Debug, Release). Defaults to Debug.
31+
$(ArtifactsBinDir) - artifacts\bin directory
32+
-->
33+
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+
41+
<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>
51+
</PropertyGroup>
52+
2453
<PropertyGroup>
2554
<DesktopTargetFramework>net462</DesktopTargetFramework>
2655
<!--
@@ -37,4 +66,5 @@
3766
<!-- This is the list of TFMs we build our unit tests as. -->
3867
<SupportedXUnitTestTargetFrameworks>net8.0</SupportedXUnitTestTargetFrameworks>
3968
</PropertyGroup>
69+
4070
</Project>

eng/Build-Native.cmd

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set __TargetOS=Windows_NT
2121
set __BuildNative=1
2222
set __CI=0
2323
set __Verbosity=minimal
24-
set __Ninja=0
24+
set __Ninja=1
2525

2626
:: Set the various build properties here so that CMake and MSBuild can pick them up
2727
set "__RepoRootDir=%~dp0"
@@ -46,6 +46,8 @@ if /i "%1" == "--help" goto Usage
4646
if /i "%1" == "-configuration" (set __BuildType=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
4747
if /i "%1" == "-architecture" (set __TargetArch=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
4848
if /i "%1" == "-verbosity" (set __Verbosity=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
49+
if /i "%1" == "-msbuild" (set __Ninja=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
50+
if /i "%1" == "-ninja" (set __Ninja=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
4951
if /i "%1" == "-ci" (set __CI=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
5052

5153
:: These options are ignored for a native build
@@ -105,7 +107,7 @@ set "__CMakeBinDir=%__BinDir%"
105107
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
106108

107109
:: Common msbuild arguments
108-
set "__CommonBuildArgs=/v:!__Verbosity! /p:Configuration=%__BuildType% /p:BuildArch=%__TargetArch% %__UnprocessedBuildArgs%"
110+
set "__CommonBuildArgs=/v:!__Verbosity! /p:Configuration=%__BuildType% /p:TargetOS=%__TargetOS% /p:TargetArch=%__TargetArch% %__UnprocessedBuildArgs%"
109111

110112
if not exist "%__BinDir%" md "%__BinDir%"
111113
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
@@ -162,13 +164,9 @@ if %__BuildNative% EQU 1 (
162164
goto ExitWithError
163165
)
164166

165-
if %__Ninja% EQU 1 (
166-
set __ExtraCmakeArgs="-DCMAKE_BUILD_TYPE=!__BuildType!"
167-
)
168-
169167
echo Generating Version Header
170168
set __GenerateVersionLog="%__LogDir%\GenerateVersion.binlog"
171-
powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" "%__RepoRootDir%\eng\native-prereqs.proj" /bl:!__GenerateVersionLog! /t:BuildPrereqs /restore %__CommonBuildArgs%
169+
powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" "%__RepoRootDir%\eng\native-prereqs.proj" /bl:!__GenerateVersionLog! /t:Build /restore %__CommonBuildArgs%
172170
if not !errorlevel! == 0 (
173171
echo Generate Version Header FAILED
174172
goto ExitWithError
@@ -177,9 +175,11 @@ if %__BuildNative% EQU 1 (
177175

178176
echo %__MsgPrefix%Regenerating the Visual Studio solution
179177

180-
set "__ManagedBinaryDir=%__RootBinDir%\bin"
181-
set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!"
182-
set __ExtraCmakeArgs=!__ExtraCmakeArgs! "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__TargetArch%" "-DNUGET_PACKAGES=%NUGET_PACKAGES:\=/%"
178+
if %__Ninja% EQU 1 (
179+
set __ExtraCmakeArgs="-DCMAKE_BUILD_TYPE=!__BuildType!"
180+
)
181+
182+
set __ExtraCmakeArgs=!__ExtraCmakeArgs! "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__TargetArch%"
183183

184184
pushd "%__IntermediatesDir%"
185185
call "%__RepoRootDir%\eng\native\gen-buildsys.cmd" "%__RepoRootDir%" "%__IntermediatesDir%" %VisualStudioVersion% %__HostArch% %__TargetOS% !__ExtraCmakeArgs!
@@ -194,9 +194,16 @@ if %__BuildNative% EQU 1 (
194194
goto ExitWithError
195195
)
196196
set __BuildLog="%__LogDir%\Native.Build.binlog"
197+
set __CmakeBuildToolArgs=
198+
if %__Ninja% EQU 1 (
199+
set __CmakeBuildToolArgs=
200+
) else (
201+
REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds.
202+
set __CmakeBuildToolArgs=/bl:!__BuildLog! !__CommonBuildArgs!
203+
)
197204

198-
echo running "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs!
199-
"%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs!
205+
echo running "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- !__CmakeBuildToolArgs!
206+
"%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- !__CmakeBuildToolArgs!
200207

201208
if not !ERRORLEVEL! == 0 (
202209
echo %__MsgPrefix%Error: native component build failed. Refer to the build log files for details:
@@ -209,20 +216,6 @@ if %__BuildNative% EQU 1 (
209216
endlocal
210217
)
211218

212-
REM Copy the native SOS binaries to where these tools expect for CI & VS testing
213-
214-
set "__targetFramework=net8.0"
215-
set "__dotnet_sos=%__RootBinDir%\bin\dotnet-sos\%__BuildType%\%__targetFramework%"
216-
set "__dotnet_dump=%__RootBinDir%\bin\dotnet-dump\%__BuildType%\%__targetFramework%"
217-
mkdir %__dotnet_sos%\win-%__TargetArch%
218-
mkdir %__dotnet_sos%\publish\win-%__TargetArch%
219-
mkdir %__dotnet_dump%\win-%__TargetArch%
220-
mkdir %__dotnet_dump%\publish\win-%__TargetArch%
221-
xcopy /y /q /i %__BinDir% %__dotnet_sos%\win-%__TargetArch%
222-
xcopy /y /q /i %__BinDir% %__dotnet_sos%\publish\win-%__TargetArch%
223-
xcopy /y /q /i %__BinDir% %__dotnet_dump%\win-%__TargetArch%
224-
xcopy /y /q /i %__BinDir% %__dotnet_dump%\publish\win-%__TargetArch%
225-
226219
REM =========================================================================================
227220
REM ===
228221
REM === All builds complete!

eng/CdacPackageItems.props

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project>
2+
<!--
3+
*MicrosoftDotNetCdacTransportVersion is from Versions.props. This is how we integrate the cDAC transport packs into our builds
4+
-->
5+
<PropertyGroup>
6+
<_cdacPackageVersion Condition="'$(TargetRid)' == 'win-x64'">$(runtimewinx64MicrosoftDotNetCdacTransportVersion)</_cdacPackageVersion>
7+
<_cdacPackageVersion Condition="'$(TargetRid)' == 'win-arm64'">$(runtimewinarm64MicrosoftDotNetCdacTransportVersion)</_cdacPackageVersion>
8+
<_cdacPackageVersion Condition="'$(TargetRid)' == 'linux-x64'">$(runtimelinuxx64MicrosoftDotNetCdacTransportVersion)</_cdacPackageVersion>
9+
<_cdacPackageVersion Condition="'$(TargetRid)' == 'linux-arm64'">$(runtimelinuxarm64MicrosoftDotNetCdacTransportVersion)</_cdacPackageVersion>
10+
<_cdacPackageVersion Condition="'$(TargetRid)' == 'osx-x64'">$(runtimeosxx64MicrosoftDotNetCdacTransportVersion)</_cdacPackageVersion>
11+
<_cdacPackageVersion Condition="'$(TargetRid)' == 'osx-arm64'">$(runtimeosxarm64MicrosoftDotNetCdacTransportVersion)</_cdacPackageVersion>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageDownload Condition="'$(_cdacPackageVersion)' != ''"
16+
Include="runtime.$(TargetRid).Microsoft.DotNet.Cdac.Transport"
17+
Version="[$(_cdacPackageVersion)]" />
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<PackageSourceFiles Condition="'$(_cdacPackageVersion)' != ''"
22+
Include="$(NuGetPackageRoot)runtime.$(TargetRid).microsoft.dotnet.cdac.transport\$(_cdacPackageVersion)\runtimes\$(TargetRid)\native\*" />
23+
</ItemGroup>
24+
</Project>

eng/Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<Project>
22
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props"/>
3-
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
4-
</Project>
3+
</Project>

eng/InstallNativePackages.targets

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!-- 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. -->
2+
<Project>
3+
<!--
4+
$(ArtifactsBinNativeDir) - Native artifacts directory (e.g. artifacts\bin\Windows_NT.x64.Debug).
5+
$(TargetRid) - Target runtime identifier (e.g. win-x64, linux-x64, osx-x64).
6+
7+
From Versions.props:
8+
9+
$(MicrosoftDiaSymReaderNativeVersion)
10+
11+
From Arcade:
12+
13+
$(NuGetPackageRoot) - nuget packages root directory
14+
-->
15+
16+
<ItemGroup>
17+
<PackageDownload Include="Microsoft.DiaSymReader.Native" Version="[$(MicrosoftDiaSymReaderNativeVersion)]" Condition="'$(OS)' == 'Windows_NT'" />
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<PackageSourceFiles Include="$(NuGetPackageRoot)microsoft.diasymreader.native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\$(TargetRid)\native\*" Condition="'$(OS)' == 'Windows_NT'" />
22+
</ItemGroup>
23+
24+
<Import Condition="'$(PackageWithCDac)' == 'true'" Project="$(RepositoryEngineeringDir)CdacPackageItems.props" />
25+
26+
<!--
27+
Installs the above packages into the $(ArtifactsBinNativeDir) directory.
28+
-->
29+
<Target Name="InstallNativePackages">
30+
<Message Importance="High" Text="Installing packages to $(ArtifactsBinNativeDir)..." />
31+
32+
<Copy SourceFiles="@(PackageSourceFiles)" DestinationFolder="$(ArtifactsBinNativeDir)" SkipUnchangedFiles="false">
33+
<Output TaskParameter="CopiedFiles" ItemName="CopiedPackageFiles" />
34+
</Copy>
35+
36+
<Message Importance="High" Text="Installed packages: @(CopiedPackageFiles)" />
37+
</Target>
38+
</Project>

eng/InstallRuntimes.proj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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-
$(BuildArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
4+
$(TargetArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
5+
$(LiveRuntimeDir) - path to the locally built runtime to use for testing.
56
67
From Versions.props:
78
@@ -18,23 +19,21 @@
1819
-->
1920

2021
<PropertyGroup>
21-
<BuildArch Condition="'$(BuildArch)' == ''">$(Platform)</BuildArch>
22-
<BuildArch Condition="'$(BuildArch)' == 'AnyCpu'">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</BuildArch>
2322
<LiveRuntimeDir Condition="'$(LiveRuntimeDir)' != ''">$([MSBuild]::NormalizePath('$(LiveRuntimeDir)'))</LiveRuntimeDir>
2423
</PropertyGroup>
2524

26-
<PropertyGroup Condition="'$(BuildArch)' != 'x86'">
25+
<PropertyGroup Condition="'$(TargetArch)' != 'x86'">
2726
<DotNetInstallRoot>$(RepoRoot).dotnet-test\</DotNetInstallRoot>
2827
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE</RegistryRoot>
2928
</PropertyGroup>
3029

31-
<PropertyGroup Condition="'$(BuildArch)' == 'x86'">
30+
<PropertyGroup Condition="'$(TargetArch)' == 'x86'">
3231
<DotNetInstallRoot>$(RepoRoot).dotnet-test\x86\</DotNetInstallRoot>
3332
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node</RegistryRoot>
3433
</PropertyGroup>
3534

3635
<PropertyGroup>
37-
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(BuildArch) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
36+
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(TargetArch) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
3837
<DotNetInstallDir>$([MSBuild]::NormalizeDirectory('$(DotNetInstallRoot)', 'shared', 'Microsoft.NETCore.App', '$(MicrosoftNETCoreAppRefVersion)'))</DotNetInstallDir>
3938
<TestConfigFileName>$(DotNetInstallRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
4039
</PropertyGroup>

eng/Version.Details.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@
4343
<Uri>https://github.com/dotnet/dotnet</Uri>
4444
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
4545
</Dependency>
46+
<Dependency Name="runtime.win-x64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.7.25351.106">
47+
<Uri>https://github.com/dotnet/dotnet</Uri>
48+
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
49+
</Dependency>
50+
<Dependency Name="runtime.win-arm64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.7.25351.106">
51+
<Uri>https://github.com/dotnet/dotnet</Uri>
52+
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
53+
</Dependency>
54+
<Dependency Name="runtime.linux-x64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.7.25351.106">
55+
<Uri>https://github.com/dotnet/dotnet</Uri>
56+
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
57+
</Dependency>
58+
<Dependency Name="runtime.linux-arm64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.7.25351.106">
59+
<Uri>https://github.com/dotnet/dotnet</Uri>
60+
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
61+
</Dependency>
62+
<Dependency Name="runtime.osx-x64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.7.25351.106">
63+
<Uri>https://github.com/dotnet/dotnet</Uri>
64+
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
65+
</Dependency>
66+
<Dependency Name="runtime.osx-arm64.Microsoft.DotNet.Cdac.Transport" Version="10.0.0-preview.7.25351.106">
67+
<Uri>https://github.com/dotnet/dotnet</Uri>
68+
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
69+
</Dependency>
4670
<Dependency Name="Microsoft.CodeAnalysis" Version="5.0.0-1.25351.106">
4771
<Uri>https://github.com/dotnet/dotnet</Uri>
4872
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>

eng/Versions.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
<!-- dotnet/installer: Testing version of the SDK. Needed for the signed & entitled host. -->
2828
<MicrosoftNETSdkVersion>10.0.100-preview.7.25351.106</MicrosoftNETSdkVersion>
2929
</PropertyGroup>
30+
<PropertyGroup>
31+
<runtimewinx64MicrosoftDotNetCdacTransportVersion>10.0.0-preview.7.25351.106</runtimewinx64MicrosoftDotNetCdacTransportVersion>
32+
<runtimewinarm64MicrosoftDotNetCdacTransportVersion>10.0.0-preview.7.25351.106</runtimewinarm64MicrosoftDotNetCdacTransportVersion>
33+
<runtimelinuxx64MicrosoftDotNetCdacTransportVersion>10.0.0-preview.7.25351.106</runtimelinuxx64MicrosoftDotNetCdacTransportVersion>
34+
<runtimelinuxarm64MicrosoftDotNetCdacTransportVersion>10.0.0-preview.7.25351.106</runtimelinuxarm64MicrosoftDotNetCdacTransportVersion>
35+
<runtimeosxx64MicrosoftDotNetCdacTransportVersion>10.0.0-preview.7.25351.106</runtimeosxx64MicrosoftDotNetCdacTransportVersion>
36+
<runtimeosxarm64MicrosoftDotNetCdacTransportVersion>10.0.0-preview.7.25351.106</runtimeosxarm64MicrosoftDotNetCdacTransportVersion>
37+
</PropertyGroup>
3038
<PropertyGroup>
3139
<!-- Opt-in/out repo features -->
3240
<UsingToolXliff>false</UsingToolXliff>

eng/build.ps1

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Param(
77
[switch] $installruntimes,
88
[switch] $privatebuild,
99
[switch] $ci,
10+
[switch][Alias('bl')]$binaryLog,
1011
[switch] $skipmanaged,
1112
[switch] $skipnative,
1213
[switch] $bundletools,
@@ -38,9 +39,12 @@ switch ($configuration.ToLower()) {
3839
$reporoot = Join-Path $PSScriptRoot ".."
3940
$engroot = Join-Path $reporoot "eng"
4041
$artifactsdir = Join-Path $reporoot "artifacts"
42+
$os = "Windows_NT"
4143
$logdir = Join-Path $artifactsdir "log"
4244
$logdir = Join-Path $logdir Windows_NT.$architecture.$configuration
4345

46+
$bl = if ($binaryLog) { '-binaryLog' } else { '' }
47+
4448
if ($ci) {
4549
$remainingargs = "-ci " + $remainingargs
4650
}
@@ -53,17 +57,18 @@ if ($bundletools) {
5357
$test = $False
5458
}
5559

56-
# Install sdk for building, restore and build managed components.
57-
if (-not $skipmanaged) {
58-
Invoke-Expression "& `"$engroot\common\build.ps1`" -configuration $configuration -verbosity $verbosity /p:BuildArch=$architecture /p:TestArchitectures=$architecture $remainingargs"
60+
# Build native components
61+
if (-not $skipnative) {
62+
Invoke-Expression "& `"$engroot\Build-Native.cmd`" -architecture $architecture -configuration $configuration -verbosity $verbosity $remainingargs"
5963
if ($lastExitCode -ne 0) {
6064
exit $lastExitCode
6165
}
6266
}
6367

64-
# Build native components
65-
if (-not $skipnative) {
66-
Invoke-Expression "& `"$engroot\Build-Native.cmd`" -architecture $architecture -configuration $configuration -verbosity $verbosity $remainingargs"
68+
# Install sdk for building, restore and build managed components.
69+
if (-not $skipmanaged) {
70+
Invoke-Expression "& `"$engroot\common\build.ps1`" -configuration $configuration -verbosity $verbosity $bl /p:TargetOS=$os /p:TargetArch=$architecture /p:TestArchitectures=$architecture $remainingargs"
71+
6772
if ($lastExitCode -ne 0) {
6873
exit $lastExitCode
6974
}
@@ -81,7 +86,8 @@ if ($installruntimes -or $privatebuild) {
8186
/t:InstallTestRuntimes `
8287
/bl:$logdir\InstallRuntimes.binlog `
8388
/p:PrivateBuildTesting=$privatebuildtesting `
84-
/p:BuildArch=$architecture `
89+
/p:TargetOS=$os `
90+
/p:TargetArch=$architecture `
8591
/p:TestArchitectures=$architecture `
8692
/p:LiveRuntimeDir="$liveRuntimeDir"
8793
}
@@ -92,14 +98,14 @@ if ($test) {
9298
if ($useCdac) {
9399
$env:SOS_TEST_CDAC="true"
94100
}
95-
96101
& "$engroot\common\build.ps1" `
97102
-test `
98103
-configuration $configuration `
99104
-verbosity $verbosity `
100105
-ci:$ci `
101106
/bl:$logdir\Test.binlog `
102-
/p:BuildArch=$architecture `
107+
/p:TargetOS=$os `
108+
/p:TargetArch=$architecture `
103109
/p:TestArchitectures=$architecture `
104110
/p:DotnetRuntimeVersion="$dotnetruntimeversion" `
105111
/p:DotnetRuntimeDownloadVersion="$dotnetruntimedownloadversion" `

0 commit comments

Comments
 (0)