summaryrefslogtreecommitdiff
path: root/netci.groovy
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2017-11-30 16:23:55 -0800
committerBruce Forstall <brucefo@microsoft.com>2017-11-30 16:23:55 -0800
commitffd105716d34d79a9071e45e9fa1096a22fdd4a6 (patch)
tree28dbe0d07c289fac1a1cb2ceb547768206da48cf /netci.groovy
parent37d85caaa0868bff3c7f3fd6cf8ca52cda318816 (diff)
downloadcoreclr-ffd105716d34d79a9071e45e9fa1096a22fdd4a6.tar.gz
coreclr-ffd105716d34d79a9071e45e9fa1096a22fdd4a6.tar.bz2
coreclr-ffd105716d34d79a9071e45e9fa1096a22fdd4a6.zip
Fix smarty output archiving
Need to unset AltJit environment variables (and possibly others) before running powershell.
Diffstat (limited to 'netci.groovy')
-rwxr-xr-xnetci.groovy16
1 files changed, 8 insertions, 8 deletions
diff --git a/netci.groovy b/netci.groovy
index 1acb5d2e80..77a2693b3e 100755
--- a/netci.groovy
+++ b/netci.groovy
@@ -2614,21 +2614,21 @@ Constants.allScenarios.each { scenario ->
addCommand("copy %WORKSPACE%\\tests\\${archLocation}\\Tests.lst bin\\tests\\${osGroup}.${architecture}.${configuration}")
addCommand("pushd bin\\tests\\${osGroup}.${architecture}.${configuration}")
addCommand("${smartyCommand}")
- addCommand("set __save_smarty_errorlevel=%errorlevel%")
- addCommand("popd")
- // BEGIN Temporarily add some logging to see why the ZIP command isn't working reliably.
- addCommand("dir .\\bin\\tests\\${osGroup}.${architecture}.${configuration}")
- addCommand("dir .\\bin\\tests\\${osGroup}.${architecture}.${configuration}\\Smarty.run.0")
- // END temporary logging
+ // Save the errorlevel from the smarty command to be used as the errorlevel of this batch file.
+ // However, we also need to remove all the variables that were set during this batch file, so we
+ // can run the ZIP powershell command (below) in a clean environment. (We can't run the powershell
+ // command with the COMPlus_AltJit variables set, for example.) To do that, we do ENDLOCAL as well
+ // as save the current errorlevel on the same line. This works because CMD evaluates the %errorlevel%
+ // variable expansion (or any variable expansion on the line) BEFORE it executes the ENDLOCAL command.
+ // Note that the ENDLOCAL also undoes the pushd command, but we add the popd here for clarity.
+ addCommand("popd & ENDLOCAL & set __save_smarty_errorlevel=%errorlevel%")
// ZIP up the smarty output, no matter what the smarty result.
addCommand("powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${architecture}.${configuration}\\Smarty.run.0', '.\\bin\\tests\\${osGroup}.${architecture}.${configuration}\\Smarty.run.0.zip')\"")
- // BEGIN Temporary logging
addCommand("echo %errorlevel%")
addCommand("dir .\\bin\\tests\\${osGroup}.${architecture}.${configuration}")
- // END temporary logging
// Use the smarty errorlevel as the script errorlevel.
addCommand("exit /b %__save_smarty_errorlevel%")