Don't fail in setup on azure when commit message contains an equals sign

The kludgy method we use to get env vars from vcvarsall.bat into our
environment doesn't correctly handle env var values which contain
newlines.

The BUILD_SOURCEVERSIONMESSAGE environment variable contains the
entirety of the commit message.  If a line containing an equals sign
appears in the commit message, we could have problems.

Unset that environment variable to workaround this problem.
pull/6587/head
Jon Turney 5 years ago committed by Jussi Pakkanen
parent 7097d8a021
commit 8d68fa22e0
  1. 4
      ci/azure-steps.yml

@ -102,6 +102,10 @@ steps:
$vcvars = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" $vcvars = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
} }
## A multiline commit message containing "=" can interact badly with this
## hack to extract the environment from vcvarsall.bat
Remove-Item env:BUILD_SOURCEVERSIONMESSAGE
## ask cmd.exe to output the environment table after the batch file completes ## ask cmd.exe to output the environment table after the batch file completes
$tempFile = [IO.Path]::GetTempFileName() $tempFile = [IO.Path]::GetTempFileName()
cmd /c " `"$vcvars`" $env:arch && set > `"$tempFile`" " cmd /c " `"$vcvars`" $env:arch && set > `"$tempFile`" "

Loading…
Cancel
Save