From 8d68fa22e0508337dd449a7dc66d70d9d15f4f8e Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 29 Jan 2020 19:48:58 +0000 Subject: 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. --- ci/azure-steps.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ci') diff --git a/ci/azure-steps.yml b/ci/azure-steps.yml index ef312082d..66a7eedcc 100644 --- a/ci/azure-steps.yml +++ b/ci/azure-steps.yml @@ -102,6 +102,10 @@ steps: $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 $tempFile = [IO.Path]::GetTempFileName() cmd /c " `"$vcvars`" $env:arch && set > `"$tempFile`" " -- cgit v1.2.3