Skip to content

Commit b7a6fe8

Browse files
author
Mike McLaughlin
committed
Use darc runtime subscription versions for testing
Update arcade to version 5.0.0-beta.19608.1 Replace install scripts with InstallRuntimes.proj (thanks to Juan). Add build.ps1 on Windows. Build-Native.cmd just builds the native bits now. Combine build.sh and build-native.sh scripts. Remove -publish from scripts Add running sosstatus command on SOSRunner errors. Always set the host runtime (SOSHostRuntime) in test configs Fix RuntimeFrameworkVersion config property usage Sign, package and publish only if build legs successful Issues: #423 #480
1 parent 6206c62 commit b7a6fe8

File tree

93 files changed

+5011
-1778
lines changed

Some content is hidden

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

93 files changed

+5011
-1778
lines changed

.vsts-dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
- MacOS
213213
- Linux_cross
214214
- Linux_cross64
215-
condition: ne(variables['Build.Reason'], 'Schedule')
215+
condition: and(succeeded(), ne(variables['Build.Reason'], 'Schedule'))
216216
pool:
217217
name: NetCoreInternal-Pool
218218
queue: BuildPool.Windows.10.Amd64.VS2017

Build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
call %~dp0eng\Build.cmd -restore -build -build-native %*
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -restore -build -native %*"
33
exit /b %ErrorLevel%

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,7 @@ endif(WIN32)
455455

456456
# CLR_ADDITIONAL_LINKER_FLAGS - used for passing additional arguments to linker
457457
# CLR_ADDITIONAL_COMPILER_OPTIONS - used for passing additional arguments to compiler
458-
#
459-
# For example:
460-
# ./build-native.sh cmakeargs "-DCLR_ADDITIONAL_COMPILER_OPTIONS=<...>" cmakeargs "-DCLR_ADDITIONAL_LINKER_FLAGS=<...>"
461-
#
458+
462459
if(CLR_CMAKE_PLATFORM_UNIX)
463460
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CLR_ADDITIONAL_LINKER_FLAGS}")
464461
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLR_ADDITIONAL_LINKER_FLAGS}" )

NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<!-- Only specify feed for Arcade SDK (see https://github.com/Microsoft/msbuild/issues/2982) -->
77
<packageSources>
88
<clear />
9+
<add key="dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
910
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
1011
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
1112
</packageSources>

Restore.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
call %~dp0eng\Build.cmd -restore %*
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -restore %*"
33
exit /b %ErrorLevel%

Test.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
call %~dp0eng\Build.cmd -test %*
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -test %*"
33
exit /b %ErrorLevel%

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ while [[ -h $source ]]; do
1313
done
1414

1515
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
16-
"$scriptroot/eng/build.sh" --restore --build --build-native $@
16+
"$scriptroot/eng/build.sh" --restore --build --native $@

eng/Build-Native.cmd

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,16 @@ if defined VS160COMNTOOLS (
2222
set __VSVersion=vs2017
2323
)
2424

25-
:: Work around Jenkins CI + msbuild problem: Jenkins sometimes creates very large environment
26-
:: variables, and msbuild can't handle environment blocks with such large variables. So clear
27-
:: out the variables that might be too large.
28-
set ghprbCommentBody=
29-
30-
:: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
31-
:: __BuildArch -- default: x64
32-
:: __BuildType -- default: Debug
33-
:: __BuildOS -- default: Windows_NT
34-
:: __ProjectDir -- default: directory of the dir.props file
35-
:: __SourceDir -- default: %__ProjectDir%\src\
36-
:: __RootBinDir -- default: %__ProjectDir%\artifacts\
37-
:: __IntermediatesDir -- default: %__RootBinDir%\obj\%__BuildOS%.%__BuildArch.%__BuildType%\
38-
:: __BinDir -- default: %__RootBinDir%\bin\%__BuildOS%.%__BuildArch.%__BuildType%\
39-
:: __LogDir -- default: %__RootBinDir%\log\%__BuildOS%.%__BuildArch.%__BuildType%\
40-
::
41-
:: Thus, these variables are not simply internal to this script!
42-
4325
:: Set the default arguments for build
4426

4527
set __BuildArch=x64
4628
if /i "%PROCESSOR_ARCHITECTURE%" == "amd64" set __BuildArch=x64
4729
if /i "%PROCESSOR_ARCHITECTURE%" == "x86" set __BuildArch=x86
4830
set __BuildType=Debug
4931
set __BuildOS=Windows_NT
50-
set __Build=0
51-
set __Test=0
32+
set __Build=1
5233
set __CI=0
53-
set __DailyTest=
5434
set __Verbosity=minimal
55-
set __TestArgs=
5635
set __BuildCrossArch=0
5736
set __CrossArch=
5837

@@ -63,7 +42,7 @@ if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
6342
set "__ProjectDir=%__ProjectDir%\.."
6443
set "__SourceDir=%__ProjectDir%\src"
6544

66-
:: __UnprocessedBuildArgs are args that we pass to msbuild (e.g. /p:__BuildArch=x64)
45+
:: __UnprocessedBuildArgs are args that we pass to msbuild (e.g. /p:OfficialBuildId=xxxxxx)
6746
set "__args=%*"
6847
set processedArgs=
6948
set __UnprocessedBuildArgs=
@@ -76,18 +55,16 @@ if /i "%1" == "-h" goto Usage
7655
if /i "%1" == "-help" goto Usage
7756
if /i "%1" == "--help" goto Usage
7857

79-
if /i "%1" == "-build-native" (set __Build=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
80-
if /i "%1" == "-test" (set __Test=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
81-
if /i "%1" == "-daily-test" (set __DailyTest=-DailyTest&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
8258
if /i "%1" == "-configuration" (set __BuildType=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
8359
if /i "%1" == "-architecture" (set __BuildArch=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
8460
if /i "%1" == "-verbosity" (set __Verbosity=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
85-
:: These options are passed on to the common build script when testing
86-
if /i "%1" == "-ci" (set __CI=1&set __TestArgs=!__TestArgs! %1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
87-
if /i "%1" == "-solution" (set __TestArgs=!__TestArgs! %1 %2&set processedArgs=!processedArgs! %1&shift&shift&goto Arg_Loop)
61+
if /i "%1" == "-ci" (set __CI=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
62+
8863
:: These options are ignored for a native build
64+
if /i "%1" == "-clean" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
8965
if /i "%1" == "-build" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
9066
if /i "%1" == "-rebuild" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
67+
if /i "%1" == "-test" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
9168
if /i "%1" == "-sign" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
9269
if /i "%1" == "-restore" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
9370
if /i "%1" == "-pack" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
@@ -332,8 +309,8 @@ REM Copy the native SOS binaries to where these tools expect for testing
332309

333310
set "__dotnet_sos=%__RootBinDir%\bin\dotnet-sos\%__BuildType%\netcoreapp2.1\publish\win-%__BuildArch%"
334311
set "__dotnet_dump=%__RootBinDir%\bin\dotnet-dump\%__BuildType%\netcoreapp2.1\publish\win-%__BuildArch%"
335-
xcopy /y /q /i /s %__BinDir% %__dotnet_sos%
336-
xcopy /y /q /i /s %__BinDir% %__dotnet_dump%
312+
xcopy /y /q /i %__BinDir% %__dotnet_sos%
313+
xcopy /y /q /i %__BinDir% %__dotnet_dump%
337314

338315
REM =========================================================================================
339316
REM ===
@@ -344,19 +321,6 @@ REM ============================================================================
344321
echo %__MsgPrefix%Repo successfully built. Finished at %TIME%
345322
echo %__MsgPrefix%Product binaries are available at !__BinDir!
346323

347-
if /i %__BuildCrossArch% EQU 1 goto Done
348-
349-
:: Test components
350-
if %__Test% EQU 1 (
351-
:: Install the other versions of .NET Core runtime we are going to test on
352-
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\install-test-runtimes.ps1""" -DotNetDir %__ProjectDir%\.dotnet -TempDir %__IntermediatesDir% -BuildArch %__BuildArch%" %__DailyTest%
353-
354-
:: Run the xunit tests
355-
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\common\Build.ps1""" -test -configuration %__BuildType% -verbosity %__Verbosity% %__TestArgs%"
356-
exit /b !ERRORLEVEL!
357-
)
358-
359-
:Done
360324
exit /b 0
361325

362326
REM =========================================================================================
@@ -375,9 +339,6 @@ echo.
375339
echo All arguments are optional. The options are:
376340
echo.
377341
echo.-? -h -help --help: view this message.
378-
echo -build-native - build native components
379-
echo -test - test components
380-
echo -daily-test - test components for daily build job
381342
echo -architecture <x64|x86|arm|arm64>
382343
echo -configuration <debug|release>
383344
echo -verbosity <q[uiet]|m[inimal]|n[ormal]|d[etailed]|diag[nostic]>

eng/Build.cmd

Lines changed: 0 additions & 17 deletions
This file was deleted.

eng/CIBuild.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
call %~dp0Build.cmd -restore -build -build-native -test -publish -ci %*
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" -restore -build -native -test -ci %*"
33
exit /b %ErrorLevel%

eng/InstallRuntimes.proj

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<Project>
2+
<!--
3+
$(BuildArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
4+
$(DailyTest) - if true, only install/test the latest (master branch) runtime
5+
6+
From Versions.props:
7+
8+
$(MicrosoftNETCoreAppVersion) $(MicrosoftAspNetCoreAppRefVersion) - latest dotnet runtime/aspnetcore version to install/test
9+
$(MicrosoftNETCoreApp31Version) $(MicrosoftAspNetCoreApp31Version) - 3.1 version
10+
$(MicrosoftNETCoreApp30Version) $(MicrosoftAspNetCoreApp30Version) - 3.0 version
11+
$(MicrosoftNETCoreApp21Version) $(MicrosoftAspNetCoreApp21Version) - 2.1 version
12+
13+
From Arcade:
14+
15+
$(DotNetRoot) - the SDK/runtime installation root
16+
$(RepositoryEngineeringDir) - the "eng" directory
17+
$(VersionsPropsPath) - path of Versions.props
18+
-->
19+
20+
<PropertyGroup>
21+
<DailyTest Condition="'$(DailyTest)' == ''">false</DailyTest>
22+
<BuildArch Condition="'$(BuildArch)' == ''">$(Platform)</BuildArch>
23+
<BuildArch Condition="'$(BuildArch)' == ''">x64</BuildArch>
24+
<CommonInstallArgs>-architecture $(BuildArch)</CommonInstallArgs>
25+
<TestConfigFileName Condition="'$(BuildArch)' != 'x86'">$(DotNetRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
26+
<TestConfigFileName Condition="'$(BuildArch)' == 'x86'">$(DotNetRoot)x86\Debugger.Tests.Versions.txt</TestConfigFileName>
27+
</PropertyGroup>
28+
29+
<Choose>
30+
<When Condition="$([MSBuild]::IsOsPlatform(Windows))">
31+
<PropertyGroup>
32+
<PowershellWrapper>powershell -NonInteractive -ExecutionPolicy ByPass -NoProfile -command</PowershellWrapper>
33+
<DotnetInstallScriptCmd>'$(RepositoryEngineeringDir)common\dotnet-install.ps1'</DotnetInstallScriptCmd>
34+
</PropertyGroup>
35+
</When>
36+
<Otherwise>
37+
<PropertyGroup>
38+
<DotnetInstallScriptCmd>$(RepositoryEngineeringDir)common/dotnet-install.sh</DotnetInstallScriptCmd>
39+
</PropertyGroup>
40+
</Otherwise>
41+
</Choose>
42+
43+
<ItemGroup>
44+
<!-- We always test on latest, so install that one even for scheduled builds -->
45+
<TestVersions Include="Latest" RuntimeVersion="$(MicrosoftNETCoreAppVersion)" AspNetVersion="$(MicrosoftAspNetCoreAppRefVersion)" Install="true" />
46+
<TestVersions Include="31" RuntimeVersion="$(MicrosoftNETCoreApp31Version)" AspNetVersion="$(MicrosoftAspNetCoreApp31Version)" Install="!$(DailyTest)" />
47+
<TestVersions Include="30" RuntimeVersion="$(MicrosoftNETCoreApp30Version)" AspNetVersion="$(MicrosoftAspNetCoreApp30Version)" Install="!$(DailyTest)" />
48+
<TestVersions Include="21" RuntimeVersion="$(MicrosoftNETCoreApp21Version)" AspNetVersion="$(MicrosoftAspNetCoreApp21Version)" Install="!$(DailyTest)" />
49+
</ItemGroup>
50+
51+
<Target Name="InstallTestRuntimes"
52+
BeforeTargets="RunTests"
53+
DependsOnTargets="InstallRuntimesWindows;InstallRuntimesUnix;WriteTestVersionManifest" />
54+
55+
<Target Name="InstallRuntimesWindows"
56+
Condition="$([MSBuild]::IsOsPlatform(Windows))"
57+
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName);$(DotNetRoot)\shared">
58+
59+
<!-- Install SDK for the x86 architecture -->
60+
<Exec Command="$(PowershellWrapper) &quot;&amp; { &amp;$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version $(NETCoreSDKVersion) -runtime '' }&quot;"
61+
Condition="'$(BuildArch)' == 'x86'" />
62+
63+
<Exec Command="$(PowershellWrapper) &quot;&amp; { &amp;$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.RuntimeVersion) -runtime dotnet }&quot;"
64+
Condition="%(TestVersions.Install)" />
65+
66+
<Exec Command="$(PowershellWrapper) &quot;&amp; { &amp;$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.AspNetVersion) -runtime aspnetcore }&quot;"
67+
Condition="%(TestVersions.Install)" />
68+
</Target>
69+
70+
<Target Name="InstallRuntimesUnix"
71+
Condition="!$([MSBuild]::IsOsPlatform(Windows))"
72+
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName);$(DotNetRoot)/shared">
73+
74+
<Exec Command="$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.RuntimeVersion) -runtime dotnet"
75+
IgnoreStandardErrorWarningFormat="true"
76+
Condition="%(TestVersions.Install)" />
77+
78+
<Exec Command="$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.AspNetVersion) -runtime aspnetcore"
79+
IgnoreStandardErrorWarningFormat="true"
80+
Condition="%(TestVersions.Install)" />
81+
</Target>
82+
83+
<Target Name="WriteTestVersionManifest" Inputs="$(VersionsPropsPath" Outputs="$(TestConfigFileName)">
84+
<PropertyGroup>
85+
<TestConfigFileLines>
86+
<![CDATA[
87+
<Configuration>
88+
<DailyTest>$(DailyTest)</DailyTest>
89+
<RuntimeVersion21>$(MicrosoftNETCoreApp21Version)</RuntimeVersion21>
90+
<AspNetCoreVersion21>$(MicrosoftAspNetCoreApp21Version)</AspNetCoreVersion21>
91+
<RuntimeVersion30>$(MicrosoftNETCoreApp30Version)</RuntimeVersion30>
92+
<AspNetCoreVersion30>$(MicrosoftAspNetCoreApp30Version)</AspNetCoreVersion30>
93+
<RuntimeVersion31>$(MicrosoftNETCoreApp31Version)</RuntimeVersion31>
94+
<AspNetCoreVersion31>$(MicrosoftAspNetCoreApp31Version)</AspNetCoreVersion31>
95+
<RuntimeVersionLatest>$(MicrosoftNETCoreAppVersion)</RuntimeVersionLatest>
96+
<AspNetCoreVersionLatest>$(MicrosoftAspNetCoreAppRefVersion)</AspNetCoreVersionLatest>
97+
</Configuration>
98+
]]>
99+
</TestConfigFileLines>
100+
</PropertyGroup>
101+
102+
<WriteLinesToFile File="$(TestConfigFileName)" Lines="$(TestConfigFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
103+
<Message Importance="High" Text="Created config file $(TestConfigFileName)" />
104+
105+
<ItemGroup>
106+
<FileWrites Include="$(TestConfigFileName)" />
107+
</ItemGroup>
108+
</Target>
109+
</Project>

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
</Dependency>
1111
</ProductDependencies>
1212
<ToolsetDependencies>
13-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19358.1">
13+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.19608.1">
1414
<Uri>https://github.com/dotnet/arcade</Uri>
15-
<Sha>4953cdf6c956adf69a0050c4df503048aed6b271</Sha>
15+
<Sha>71ce4c736b882e6112b395a0e92313be5dcb4328</Sha>
1616
</Dependency>
1717
<Dependency Name="Microsoft.NETCore.App" Version="5.0.0-alpha.1.19564.1">
1818
<Uri>https://github.com/dotnet/core-setup</Uri>

eng/Versions.props

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@
66
<VersionPrefix>3.0.0</VersionPrefix>
77
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
88
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>
9+
</PropertyGroup>
10+
<PropertyGroup>
11+
<!-- SDK Version from global.json -->
12+
<NETCoreSDKVersion>3.0.100</NETCoreSDKVersion>
13+
<!-- Runtime versions to test -->
14+
<MicrosoftNETCoreApp21Version>2.1.12</MicrosoftNETCoreApp21Version>
15+
<MicrosoftAspNetCoreApp21Version>$(MicrosoftNETCoreApp21Version)</MicrosoftAspNetCoreApp21Version>
16+
<MicrosoftNETCoreApp30Version>3.0.0</MicrosoftNETCoreApp30Version>
17+
<MicrosoftAspNetCoreApp30Version>$(MicrosoftNETCoreApp30Version)</MicrosoftAspNetCoreApp30Version>
18+
<MicrosoftNETCoreApp31Version>3.1.0</MicrosoftNETCoreApp31Version>
19+
<MicrosoftAspNetCoreApp31Version>$(MicrosoftNETCoreApp31Version)</MicrosoftAspNetCoreApp31Version>
920
<MicrosoftNETCoreAppVersion>5.0.0-alpha.1.19564.1</MicrosoftNETCoreAppVersion>
1021
<MicrosoftAspNetCoreAppRefVersion>5.0.0-alpha1.19610.3</MicrosoftAspNetCoreAppRefVersion>
1122
</PropertyGroup>
1223
<PropertyGroup>
13-
<!-- Opt-out repo features -->
24+
<!-- Opt-in/out repo features -->
1425
<UsingToolXliff>false</UsingToolXliff>
1526
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
1627
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>

0 commit comments

Comments
 (0)