Variables parsed with extra carets before parentheses
The YAML parser seems to parse strings incorrectly if there are parentheses inside of quotes. It will insert carets before each opening and closing parenthesis.
Steps to reproduce
Use the following
gitlab-ci.yml file. If you don't have MSBuild, you can comment out the 2nd line in each job. The echo should show the problem.
variables: MSBUILD: '"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"' build_fails: stage: build script: - 'echo MSBUILD=%MSBUILD%' - '%MSBUILD% /help' build_works: stage: build script: - 'echo MSBUILD=%MSBUILD%' - '"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /help'
When running the build_fails job, you will receive an error "The system cannot find the path specified." This seems to be because the variable is parsed with extra carets in it.
$ echo MSBUILD=%MSBUILD% MSBUILD="C:\Program Files ^(x86^)\MSBuild\14.0\Bin\MSBuild.exe" $ %MSBUILD% /help The system cannot find the path specified. ERROR: Build failed: exit status 3
The variable should be parsed without the extra carets. The below log is from version 1.5 of the runner, where it works as expected.
$ echo MSBUILD=%MSBUILD% MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" $ %MSBUILD% /help Microsoft (R) Build Engine version 14.0.24720.0
The runner is installed on Windows 7 Professional SP1 as a service.
Used GitLab Runner version
This regression was introduced sometime between v1.5.0 and v1.7.0. It is still present on the latest version v1.8.1.
Running with gitlab-ci-multi-runner 1.8.1 (a2efdd4) Using Shell executor...