Merge pull request #9679 from alpencolt/ryu-arm-arr-index-offset
[platform/upstream/coreclr.git] / build-test.cmd
1 @if not defined _echo @echo off
2 setlocal EnableDelayedExpansion
3
4 :: Set the default arguments for build
5 set __BuildArch=x64
6 set __VCBuildArch=x86_amd64
7 set __BuildType=Debug
8 set __BuildOS=Windows_NT
9
10 :: Default to highest Visual Studio version available
11 ::
12 :: For VS2015 (and prior), only a single instance is allowed to be installed on a box
13 :: and VS140COMNTOOLS is set as a global environment variable by the installer. This
14 :: allows users to locate where the instance of VS2015 is installed.
15 ::
16 :: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
17 :: is no longer set as a global environment variable and is instead only set if the user
18 :: has launched the VS2017 Developer Command Prompt.
19 ::
20 :: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
21 :: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
22 :: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
23 :: toolset if it is installed. Finally, we will fail the script if no supported VS instance
24 :: can be found.
25 if defined VS150COMNTOOLS (
26   set "__VSToolsRoot=%VS150COMNTOOLS%"
27   set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
28   set __VSVersion=vs2017
29 ) else (
30   set "__VSToolsRoot=%VS140COMNTOOLS%"
31   set "__VCToolsRoot=%VS140COMNTOOLS%\..\..\VC"
32   set __VSVersion=vs2015
33 )
34
35 :: Define a prefix for most output progress messages that come from this script. That makes
36 :: it easier to see where these are coming from. Note that there is a trailing space here.
37 set __MsgPrefix=BUILDTEST: 
38
39 set "__ProjectDir=%~dp0"
40 :: remove trailing slash
41 if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
42 set "__TestDir=%__ProjectDir%\tests"
43 set "__ProjectFilesDir=%__TestDir%"
44 set "__SourceDir=%__ProjectDir%\src"
45 set "__PackagesDir=%__ProjectDir%\packages"
46 set "__RootBinDir=%__ProjectDir%\bin"
47 set "__LogsDir=%__RootBinDir%\Logs"
48
49 :: Default __Exclude to issues.targets
50 set __Exclude=%__TestDir%\issues.targets
51
52 REM __unprocessedBuildArgs are args that we pass to msbuild (e.g. /p:__BuildArch=x64)
53 set "__args= %*"
54 set processedArgs=
55 set __unprocessedBuildArgs=
56 set __RunArgs=
57 set __BuildAgainstPackagesArg=
58 set __RuntimeId=
59 set __ZipTests=
60
61 :Arg_Loop
62 if "%1" == "" goto ArgsDone
63
64 if /i "%1" == "-?"    goto Usage
65 if /i "%1" == "-h"    goto Usage
66 if /i "%1" == "-help" goto Usage
67
68 if /i "%1" == "x64"                   (set __BuildArch=x64&set __VCBuildArch=x86_amd64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
69 if /i "%1" == "x86"                   (set __BuildArch=x86&set __VCBuildArch=x86&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
70 if /i "%1" == "arm"                   (set __BuildArch=arm&set __VCBuildArch=x86_arm&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
71 if /i "%1" == "arm64"                 (set __BuildArch=arm64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
72
73 if /i "%1" == "debug"                 (set __BuildType=Debug&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
74 if /i "%1" == "release"               (set __BuildType=Release&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
75 if /i "%1" == "checked"               (set __BuildType=Checked&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
76
77 if /i "%1" == "skipmanaged"           (set __SkipManaged=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
78 if /i "%1" == "updateinvalidpackages" (set __UpdateInvalidPackagesArg=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
79 if /i "%1" == "toolset_dir"           (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
80 if /i "%1" == "buildagainstpackages"  (set __ZipTests=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
81 if /i "%1" == "ziptests"              (set __ZipTests=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
82 if /i "%1" == "runtimeid"             (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
83 if /i "%1" == "Exclude"               (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
84
85 if [!processedArgs!]==[] (
86   call set __UnprocessedBuildArgs=!__args!
87 ) else (
88   call set __UnprocessedBuildArgs=%%__args:*!processedArgs!=%%
89 )
90
91 :ArgsDone
92
93 echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\VsDevCmd.bat"
94 call                                 "%__VSToolsRoot%\VsDevCmd.bat"
95
96 set __RunArgs=-BuildOS=%__BuildOS% -BuildType=%__BuildType% -BuildArch=%__BuildArch%
97
98 rem arm64 builds currently use private toolset which has not been released yet
99 REM TODO, remove once the toolset is open.
100 if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
101
102 echo %__MsgPrefix%Commencing CoreCLR repo test build
103
104 set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
105 set "__TestRootDir=%__RootBinDir%\tests"
106 set "__TestBinDir=%__TestRootDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
107 :: We have different managed and native intermediate dirs because the managed bits will include
108 :: the configuration information deeper in the intermediates path.
109 :: These variables are used by the msbuild project files.
110
111 if not defined __TestIntermediateDir (
112     set "__TestIntermediateDir=tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
113 )
114 set "__NativeTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Native"
115 set "__ManagedTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Managed"
116
117 :: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
118 set "__CMakeBinDir=%__TestBinDir%"
119 set "__CMakeBinDir=%__CMakeBinDir:\=/%"
120
121 if not exist "%__TestBinDir%"                   md "%__TestBinDir%"
122 if not exist "%__NativeTestIntermediatesDir%"   md "%__NativeTestIntermediatesDir%"
123 if not exist "%__ManagedTestIntermediatesDir%"  md "%__ManagedTestIntermediatesDir%"
124 if not exist "%__LogsDir%"                      md "%__LogsDir%"
125
126 echo %__MsgPrefix%Checking prerequisites
127
128 :: Eval the output from probe-win1.ps1
129 for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a
130
131 REM =========================================================================================
132 REM ===
133 REM === Restore Build Tools
134 REM ===
135 REM =========================================================================================
136 call "%__ProjectDir%\init-tools.cmd"
137
138 REM =========================================================================================
139 REM ===
140 REM === Resolve runtime dependences
141 REM ===
142 REM =========================================================================================
143 call "%__TestDir%\setup-runtime-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
144
145 if defined __UpdateInvalidPackagesArg (
146   goto skipnative
147 )
148
149 REM =========================================================================================
150 REM ===
151 REM === Native test build section
152 REM ===
153 REM =========================================================================================
154
155 echo %__MsgPrefix%Commencing build of native test components for %__BuildArch%/%__BuildType%
156
157 if defined __ToolsetDir (
158  echo %__MsgPrefix%ToolsetDir is defined to be :%__ToolsetDir%
159  goto GenVSSolution :: Private ToolSet is Defined
160 )
161
162 :: Set the environment for the native build
163 echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" %__VCBuildArch%
164 call                                 "%__VCToolsRoot%\vcvarsall.bat" %__VCBuildArch%
165 @if defined _echo @echo on
166
167 if not defined VSINSTALLDIR (
168     echo %__MsgPrefix%Error: VSINSTALLDIR variable not defined.
169     exit /b 1
170 )
171 if not exist "%VSINSTALLDIR%DIA SDK" goto NoDIA
172
173 :GenVSSolution
174
175 pushd "%__NativeTestIntermediatesDir%"
176 call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" ""%__ProjectFilesDir%"" %__VSVersion% %__BuildArch%
177 @if defined _echo @echo on
178 popd
179
180 if not exist "%__NativeTestIntermediatesDir%\install.vcxproj" (
181     echo %__MsgPrefix%Failed to generate test native component build project!
182     exit /b 1
183 )
184
185 set __msbuildNativeArgs=-configuration=%__BuildType%
186
187 if defined __ToolsetDir (
188     set __msbuildNativeArgs=%__msbuildNativeArgs% -UseEnv
189 ) else (
190     set __msbuildNativeArgs=%__msbuildNativeArgs% -platform=%__BuildArch%
191 )
192
193 set __BuildLogRootName=Tests_Native
194 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
195 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
196 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
197 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
198 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
199 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
200
201 call "%__ProjectDir%\run.cmd" build -Project="%__NativeTestIntermediatesDir%\install.vcxproj" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__msbuildNativeArgs% %__RunArgs% %__unprocessedBuildArgs%
202 if errorlevel 1 (
203     echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
204     echo     %__BuildLog%
205     echo     %__BuildWrn%
206     echo     %__BuildErr%
207     exit /b 1
208 )
209
210 :skipnative
211
212 set __BuildLogRootName=Restore_Product
213 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
214 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
215 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
216 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
217 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
218 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
219
220 set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
221
222 if not defined __BuildAgainstPackagesArg goto SkipRestoreProduct
223 REM =========================================================================================
224 REM ===
225 REM === Restore product binaries from packages
226 REM ===
227 REM =========================================================================================
228
229 if not defined XunitTestBinBase       set  XunitTestBinBase=%__TestWorkingDir%
230 set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root"
231 set "CORE_OVERLAY=%XunitTestBinBase%\Tests\Core_Root_%__RuntimeId%"
232
233 call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj  -UpdateDependencies -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
234
235 set __BuildLogRootName=Tests_GenerateRuntimeLayout
236
237 call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
238 if errorlevel 1 (
239     echo BinPlace of mscorlib.dll failed
240     exit /b 1
241 )
242
243 if defined __RuntimeId (
244
245     if not exist %__PackagesDir%\TestNativeBins (
246         echo %__MsgPrefix%Error: Ensure you have run sync.cmd -ab before building a non-Windows test overlay against packages
247         exit /b 1
248     )
249
250     call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -CreateNonWindowsTestOverlay -RuntimeId="%__RuntimeId%"  -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
251     for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.so) do copy %%f %Core_Overlay%
252     for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.dylib) do copy %%f %Core_Overlay%
253
254     echo %__MsgPrefix% Created the runtime layout for %__RuntimeId% in %CORE_OVERLAY%
255 )
256
257 echo %__MsgPrefix% Restored CoreCLR product from packages
258
259 :SkipRestoreProduct
260
261 if defined __SkipManaged exit /b 0
262
263 set __BuildLogRootName=Tests_Managed
264 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
265 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
266 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
267 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
268 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
269 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
270
271 REM =========================================================================================
272 REM ===
273 REM === Managed test build section
274 REM ===
275 REM =========================================================================================
276
277 echo %__MsgPrefix%Starting the Managed Tests Build
278
279 if not defined VSINSTALLDIR (
280     echo %__MsgPrefix%Error: buildtest.cmd should be run from a Visual Studio Command Prompt.  Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
281     exit /b 1
282 )
283
284 if defined __UpdateInvalidPackagesArg (
285   set __up=-updateinvalidpackageversions
286 )
287
288 call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__up% %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
289 if errorlevel 1 (
290     echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
291     echo     %__BuildLog%
292     echo     %__BuildWrn%
293     echo     %__BuildErr%
294     exit /b 1
295 )
296
297 REM Prepare the Test Drop
298 REM Cleans any NI from the last run
299 powershell "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
300 REM Cleans up any lock folder used for synchronization from last run
301 powershell "Get-ChildItem -path %__TestWorkingDir% -Include 'lock' -Recurse -Force |  where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse"
302
303 set CORE_ROOT=%__TestBinDir%\Tests\Core_Root
304 if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%"
305 md "%CORE_ROOT%"
306 xcopy /s "%__BinDir%" "%CORE_ROOT%"
307
308 echo %__MsgPrefix%Creating test wrappers...
309
310 set RuntimeIdArg=
311
312 if defined __RuntimeId (
313     set RuntimeIdArg=-RuntimeID="%__RuntimeId%"
314 )
315
316 set __BuildLogRootName=Tests_XunitWrapper
317 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
318 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
319 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
320 set __msbuildLog=/flp:Verbosity=diag;LogFile="%__BuildLog%"
321 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
322 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
323
324 call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BuildWrappers -MsBuildEventLogging=" " -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg%
325 if errorlevel 1 (
326     echo Xunit Wrapper build failed
327     exit /b 1
328 )
329
330 echo %__MsgPrefix%Creating test overlay...
331
332 set __BuildLogRootName=Tests_Overlay_Managed
333 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
334 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
335 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
336 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
337 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
338 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
339
340 call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__unprocessedBuildArgs%
341 if errorlevel 1 (
342     echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
343     echo     %__BuildLog%
344     echo     %__BuildWrn%
345     echo     %__BuildErr%
346     exit /b 1
347 )
348
349 if not defined __ZipTests goto SkipPrepForPublish
350
351 set __BuildLogRootName=Helix_Prep
352 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
353 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
354 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
355 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
356 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
357 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
358
359 REM =========================================================================================
360 REM ===
361 REM === Prep test binaries for Helix publishing
362 REM ===
363 REM =========================================================================================
364
365 call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj  -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg%
366
367 echo %__MsgPrefix% Prepped test binaries for publishing
368
369 :SkipPrepForPublish
370
371 REM =========================================================================================
372 REM ===
373 REM === All builds complete!
374 REM ===
375 REM =========================================================================================
376
377 echo %__MsgPrefix%Test build successful.
378 echo %__MsgPrefix%Test binaries are available at !__TestBinDir!
379 exit /b 0
380
381 :Usage
382 echo.
383 echo Usage:
384 echo     %0 [option1] [option2] ...
385 echo All arguments are optional. Options are case-insensitive. The options are:
386 echo.
387 echo. -? -h -help: view this message.
388 echo Build architecture: -buildArch: only x64 is currently allowed ^(default: x64^).
389 echo Build type: -buildType: one of Debug, Checked, Release ^(default: Debug^).
390 echo updateinvalidpackageversions: Runs the target to update package versions.
391 echo buildagainstpackages: builds tests against restored packages, instead of against a built product.
392 echo runtimeid ^<ID^>: Builds a test overlay for the specified OS (Only supported when building against packages). Supported IDs are:
393 echo     alpine.3.4.3-x64: Builds overlay for Alpine 3.4.3
394 echo     debian.8-x64: Builds overlay for Debian 8
395 echo     fedora.23-x64: Builds overlay for Fedora 23
396 echo     fedora.24-x64: Builds overlay for Fedora 23
397 echo     opensuse.42.1-x64: Builds overlay for OpenSUSE 42.1
398 echo     osx.10.10-x64: Builds overlay for OSX 10.10
399 echo     rhel.7-x64: Builds overlay for RHEL 7 or CentOS
400 echo     ubuntu.14.04-x64: Builds overlay for Ubuntu 14.04
401 echo     ubuntu.16.04-x64: Builds overlay for Ubuntu 16.04
402 echo     ubuntu.16.10-x64: Builds overlay for Ubuntu 16.10
403 echo ziptests: zips CoreCLR tests & Core_Root for a Helix run
404 echo Exclude- Optional parameter - specify location of default exclusion file (defaults to tests\issues.targets if not specified)
405 echo     Set to "" to disable default exclusion file.
406 echo -- ... : all arguments following this tag will be passed directly to msbuild.
407 echo -priority=^<N^> : specify a set of test that will be built and run, with priority N.
408 echo     0: Build only priority 0 cases as essential testcases (default)
409 echo     1: Build all tests with priority 0 and 1
410 echo     666: Build all tests with priority 0, 1 ... 666
411 echo -sequential: force a non-parallel build ^(default is to build in parallel
412 echo     using all processors^).
413 echo -ilasmroundtrip: enables ilasm round trip build and run of the tests before executing them.
414 echo -verbose: enables detailed file logging for the msbuild tasks into the msbuild log file.
415 exit /b 1
416
417 :NoDIA
418 echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
419 This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
420 at the install location of previous Visual Studio version. The workaround is to copy the DIA SDK folder from the Visual Studio install location ^
421 of the previous version to "%VSINSTALLDIR%" and then build.
422 :: DIA SDK not included in Express editions
423 echo Visual Studio Express does not include the DIA SDK. ^
424 You need Visual Studio 2015 or 2017 (Community is free).
425 echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
426 exit /b 1
427
428
429 :PrivateToolSet
430
431 echo %__MsgPrefix% Setting Up the usage of __ToolsetDir:%__ToolsetDir%
432
433 if /i "%__ToolsetDir%" == "" (
434     echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolset_dir argument.
435     exit /b 1
436 )
437
438 set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
439 set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
440 set INCLUDE=^
441 %__ToolsetDir%\VC_sdk\inc;^
442 %__ToolsetDir%\sdpublic\sdk\inc;^
443 %__ToolsetDir%\sdpublic\shared\inc;^
444 %__ToolsetDir%\sdpublic\shared\inc\minwin;^
445 %__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
446 %__ToolsetDir%\sdpublic\sdk\inc\minwin;^
447 %__ToolsetDir%\sdpublic\sdk\inc\mincore;^
448 %__ToolsetDir%\sdpublic\sdk\inc\abi;^
449 %__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
450 %__ToolsetDir%\diasdk\include
451 exit /b 0