Skip to content

Commit

Permalink
Use darc runtime subscription versions for testing
Browse files Browse the repository at this point in the history
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.

Issue: dotnet#423
Issue: dotnet#480
  • Loading branch information
mikem8361 committed Dec 10, 2019
1 parent 125ea40 commit c39af2a
Show file tree
Hide file tree
Showing 89 changed files with 4,973 additions and 1,748 deletions.
2 changes: 1 addition & 1 deletion Build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call %~dp0eng\Build.cmd -restore -build -build-native %*
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -restore -build -native %*"
exit /b %ErrorLevel%
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,7 @@ endif(WIN32)

# CLR_ADDITIONAL_LINKER_FLAGS - used for passing additional arguments to linker
# CLR_ADDITIONAL_COMPILER_OPTIONS - used for passing additional arguments to compiler
#
# For example:
# ./build-native.sh cmakeargs "-DCLR_ADDITIONAL_COMPILER_OPTIONS=<...>" cmakeargs "-DCLR_ADDITIONAL_LINKER_FLAGS=<...>"
#

if(CLR_CMAKE_PLATFORM_UNIX)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CLR_ADDITIONAL_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLR_ADDITIONAL_LINKER_FLAGS}" )
Expand Down
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<!-- Only specify feed for Arcade SDK (see https://github.com/Microsoft/msbuild/issues/2982) -->
<packageSources>
<clear />
<add key="dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
Expand Down
2 changes: 1 addition & 1 deletion Restore.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call %~dp0eng\Build.cmd -restore %*
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -restore %*"
exit /b %ErrorLevel%
2 changes: 1 addition & 1 deletion Test.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call %~dp0eng\Build.cmd -test %*
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -test %*"
exit /b %ErrorLevel%
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/eng/build.sh" --restore --build --build-native $@
"$scriptroot/eng/build.sh" --restore --build --native $@
55 changes: 8 additions & 47 deletions eng/Build-Native.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,16 @@ if defined VS160COMNTOOLS (
set __VSVersion=vs2017
)

:: Work around Jenkins CI + msbuild problem: Jenkins sometimes creates very large environment
:: variables, and msbuild can't handle environment blocks with such large variables. So clear
:: out the variables that might be too large.
set ghprbCommentBody=

:: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
:: __BuildArch -- default: x64
:: __BuildType -- default: Debug
:: __BuildOS -- default: Windows_NT
:: __ProjectDir -- default: directory of the dir.props file
:: __SourceDir -- default: %__ProjectDir%\src\
:: __RootBinDir -- default: %__ProjectDir%\artifacts\
:: __IntermediatesDir -- default: %__RootBinDir%\obj\%__BuildOS%.%__BuildArch.%__BuildType%\
:: __BinDir -- default: %__RootBinDir%\bin\%__BuildOS%.%__BuildArch.%__BuildType%\
:: __LogDir -- default: %__RootBinDir%\log\%__BuildOS%.%__BuildArch.%__BuildType%\
::
:: Thus, these variables are not simply internal to this script!

:: Set the default arguments for build

set __BuildArch=x64
if /i "%PROCESSOR_ARCHITECTURE%" == "amd64" set __BuildArch=x64
if /i "%PROCESSOR_ARCHITECTURE%" == "x86" set __BuildArch=x86
set __BuildType=Debug
set __BuildOS=Windows_NT
set __Build=0
set __Test=0
set __Build=1
set __CI=0
set __DailyTest=
set __Verbosity=minimal
set __TestArgs=
set __BuildCrossArch=0
set __CrossArch=

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

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

if /i "%1" == "-build-native" (set __Build=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-test" (set __Test=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-daily-test" (set __DailyTest=-DailyTest&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-configuration" (set __BuildType=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "-architecture" (set __BuildArch=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "-verbosity" (set __Verbosity=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
:: These options are passed on to the common build script when testing
if /i "%1" == "-ci" (set __CI=1&set __TestArgs=!__TestArgs! %1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-solution" (set __TestArgs=!__TestArgs! %1 %2&set processedArgs=!processedArgs! %1&shift&shift&goto Arg_Loop)
if /i "%1" == "-ci" (set __CI=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)

:: These options are ignored for a native build
if /i "%1" == "-clean" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-build" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-rebuild" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-test" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-sign" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-restore" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-pack" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
Expand Down Expand Up @@ -332,8 +309,8 @@ REM Copy the native SOS binaries to where these tools expect for testing

set "__dotnet_sos=%__RootBinDir%\bin\dotnet-sos\%__BuildType%\netcoreapp2.1\publish\win-%__BuildArch%"
set "__dotnet_dump=%__RootBinDir%\bin\dotnet-dump\%__BuildType%\netcoreapp2.1\publish\win-%__BuildArch%"
xcopy /y /q /i /s %__BinDir% %__dotnet_sos%
xcopy /y /q /i /s %__BinDir% %__dotnet_dump%
xcopy /y /q /i %__BinDir% %__dotnet_sos%
xcopy /y /q /i %__BinDir% %__dotnet_dump%

REM =========================================================================================
REM ===
Expand All @@ -344,19 +321,6 @@ REM ============================================================================
echo %__MsgPrefix%Repo successfully built. Finished at %TIME%
echo %__MsgPrefix%Product binaries are available at !__BinDir!

if /i %__BuildCrossArch% EQU 1 goto Done

:: Test components
if %__Test% EQU 1 (
:: Install the other versions of .NET Core runtime we are going to test on
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\install-test-runtimes.ps1""" -DotNetDir %__ProjectDir%\.dotnet -TempDir %__IntermediatesDir% -BuildArch %__BuildArch%" %__DailyTest%

:: Run the xunit tests
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\common\Build.ps1""" -test -configuration %__BuildType% -verbosity %__Verbosity% %__TestArgs%"
exit /b !ERRORLEVEL!
)

:Done
exit /b 0

REM =========================================================================================
Expand All @@ -375,9 +339,6 @@ echo.
echo All arguments are optional. The options are:
echo.
echo.-? -h -help --help: view this message.
echo -build-native - build native components
echo -test - test components
echo -daily-test - test components for daily build job
echo -architecture <x64|x86|arm|arm64>
echo -configuration <debug|release>
echo -verbosity <q[uiet]|m[inimal]|n[ormal]|d[etailed]|diag[nostic]>
Expand Down
17 changes: 0 additions & 17 deletions eng/Build.cmd

This file was deleted.

2 changes: 1 addition & 1 deletion eng/CIBuild.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call %~dp0Build.cmd -restore -build -build-native -test -publish -ci %*
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" -restore -build -native -test -publish -ci %*"
exit /b %ErrorLevel%
109 changes: 109 additions & 0 deletions eng/InstallRuntimes.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<Project>
<!--
$(BuildArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
$(DailyTest) - if true, only install/test the latest (master branch) runtime
From Versions.props:
$(MicrosoftNETCoreAppVersion) $(MicrosoftAspNetCoreAppRefVersion) - latest dotnet runtime/aspnetcore version to install/test
$(MicrosoftNETCoreApp31Version) $(MicrosoftAspNetCoreApp31Version) - 3.1 version
$(MicrosoftNETCoreApp30Version) $(MicrosoftAspNetCoreApp30Version) - 3.0 version
$(MicrosoftNETCoreApp21Version) $(MicrosoftAspNetCoreApp21Version) - 2.1 version
From Arcade:
$(DotNetRoot) - the SDK/runtime installation root
$(RepositoryEngineeringDir) - the "eng" directory
$(VersionsPropsPath) - path of Versions.props
-->

<PropertyGroup>
<DailyTest Condition="'$(DailyTest)' == ''">false</DailyTest>
<BuildArch Condition="'$(BuildArch)' == ''">$(Platform)</BuildArch>
<BuildArch Condition="'$(BuildArch)' == ''">x64</BuildArch>
<CommonInstallArgs>-architecture $(BuildArch)</CommonInstallArgs>
<TestConfigFileName Condition="'$(BuildArch)' != 'x86'">$(DotNetRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
<TestConfigFileName Condition="'$(BuildArch)' == 'x86'">$(DotNetRoot)x86\Debugger.Tests.Versions.txt</TestConfigFileName>
</PropertyGroup>

<Choose>
<When Condition="$([MSBuild]::IsOsPlatform(Windows))">
<PropertyGroup>
<PowershellWrapper>powershell -NonInteractive -ExecutionPolicy ByPass -NoProfile -command</PowershellWrapper>
<DotnetInstallScriptCmd>'$(RepositoryEngineeringDir)common\dotnet-install.ps1'</DotnetInstallScriptCmd>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DotnetInstallScriptCmd>$(RepositoryEngineeringDir)common/dotnet-install.sh</DotnetInstallScriptCmd>
</PropertyGroup>
</Otherwise>
</Choose>

<ItemGroup>
<!-- We always test on latest, so install that one even for scheduled builds -->
<TestVersions Include="Latest" RuntimeVersion="$(MicrosoftNETCoreAppVersion)" AspNetVersion="$(MicrosoftAspNetCoreAppRefVersion)" Install="true" />
<TestVersions Include="31" RuntimeVersion="$(MicrosoftNETCoreApp31Version)" AspNetVersion="$(MicrosoftAspNetCoreApp31Version)" Install="!$(DailyTest)" />
<TestVersions Include="30" RuntimeVersion="$(MicrosoftNETCoreApp30Version)" AspNetVersion="$(MicrosoftAspNetCoreApp30Version)" Install="!$(DailyTest)" />
<TestVersions Include="21" RuntimeVersion="$(MicrosoftNETCoreApp21Version)" AspNetVersion="$(MicrosoftAspNetCoreApp21Version)" Install="!$(DailyTest)" />
</ItemGroup>

<Target Name="InstallTestRuntimes"
BeforeTargets="RunTests"
DependsOnTargets="InstallRuntimesWindows;InstallRuntimesUnix;WriteTestVersionManifest" />

<Target Name="InstallRuntimesWindows"
Condition="$([MSBuild]::IsOsPlatform(Windows))"
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName);$(DotNetRoot)\shared">

<!-- Install SDK for the x86 architecture -->
<Exec Command="$(PowershellWrapper) &quot;&amp; { &amp;$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version $(NETCoreSDKVersion) -runtime '' }&quot;"
Condition="'$(BuildArch)' == 'x86'" />

<Exec Command="$(PowershellWrapper) &quot;&amp; { &amp;$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.RuntimeVersion) -runtime dotnet }&quot;"
Condition="%(TestVersions.Install)" />

<Exec Command="$(PowershellWrapper) &quot;&amp; { &amp;$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.AspNetVersion) -runtime aspnetcore }&quot;"
Condition="%(TestVersions.Install)" />
</Target>

<Target Name="InstallRuntimesUnix"
Condition="!$([MSBuild]::IsOsPlatform(Windows))"
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName);$(DotNetRoot)/shared">

<Exec Command="$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.RuntimeVersion) -runtime dotnet"
IgnoreStandardErrorWarningFormat="true"
Condition="%(TestVersions.Install)" />

<Exec Command="$(DotnetInstallScriptCmd) $(CommonInstallArgs) -version %(TestVersions.AspNetVersion) -runtime aspnetcore"
IgnoreStandardErrorWarningFormat="true"
Condition="%(TestVersions.Install)" />
</Target>

<Target Name="WriteTestVersionManifest" Inputs="$(VersionsPropsPath" Outputs="$(TestConfigFileName)">
<PropertyGroup>
<TestConfigFileLines>
<![CDATA[
<Configuration>
<DailyTest>$(DailyTest)</DailyTest>
<RuntimeVersion21>$(MicrosoftNETCoreApp21Version)</RuntimeVersion21>
<AspNetCoreVersion21>$(MicrosoftAspNetCoreApp21Version)</AspNetCoreVersion21>
<RuntimeVersion30>$(MicrosoftNETCoreApp30Version)</RuntimeVersion30>
<AspNetCoreVersion30>$(MicrosoftAspNetCoreApp30Version)</AspNetCoreVersion30>
<RuntimeVersion31>$(MicrosoftNETCoreApp31Version)</RuntimeVersion31>
<AspNetCoreVersion31>$(MicrosoftAspNetCoreApp31Version)</AspNetCoreVersion31>
<RuntimeVersionLatest>$(MicrosoftNETCoreAppVersion)</RuntimeVersionLatest>
<AspNetCoreVersionLatest>$(MicrosoftAspNetCoreAppRefVersion)</AspNetCoreVersionLatest>
</Configuration>
]]>
</TestConfigFileLines>
</PropertyGroup>

<WriteLinesToFile File="$(TestConfigFileName)" Lines="$(TestConfigFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<Message Importance="High" Text="Created config file $(TestConfigFileName)" />

<ItemGroup>
<FileWrites Include="$(TestConfigFileName)" />
</ItemGroup>
</Target>
</Project>
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19358.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.19608.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>4953cdf6c956adf69a0050c4df503048aed6b271</Sha>
<Sha>71ce4c736b882e6112b395a0e92313be5dcb4328</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App" Version="5.0.0-alpha.1.19564.1">
<Uri>https://github.com/dotnet/core-setup</Uri>
Expand Down
13 changes: 12 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@
<VersionPrefix>3.0.0</VersionPrefix>
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>
</PropertyGroup>
<PropertyGroup>
<!-- SDK Version from global.json -->
<NETCoreSDKVersion>3.0.100</NETCoreSDKVersion>
<!-- Runtime versions to test -->
<MicrosoftNETCoreApp21Version>2.1.12</MicrosoftNETCoreApp21Version>
<MicrosoftAspNetCoreApp21Version>$(MicrosoftNETCoreApp21Version)</MicrosoftAspNetCoreApp21Version>
<MicrosoftNETCoreApp30Version>3.0.0</MicrosoftNETCoreApp30Version>
<MicrosoftAspNetCoreApp30Version>$(MicrosoftNETCoreApp30Version)</MicrosoftAspNetCoreApp30Version>
<MicrosoftNETCoreApp31Version>3.1.0</MicrosoftNETCoreApp31Version>
<MicrosoftAspNetCoreApp31Version>$(MicrosoftNETCoreApp31Version)</MicrosoftAspNetCoreApp31Version>
<MicrosoftNETCoreAppVersion>5.0.0-alpha.1.19564.1</MicrosoftNETCoreAppVersion>
<MicrosoftAspNetCoreAppRefVersion>5.0.0-alpha1.19605.16</MicrosoftAspNetCoreAppRefVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Opt-out repo features -->
<!-- Opt-in/out repo features -->
<UsingToolXliff>false</UsingToolXliff>
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
Expand Down
Loading

0 comments on commit c39af2a

Please sign in to comment.