path: root/coin/provisioning/common/windows
diff options
authorKonstantin Tokarev <>2019-07-24 14:04:08 +0300
committerKonstantin Tokarev <>2019-07-26 07:50:43 +0300
commitf12c22646336893c6db5e8117498395baa0c3230 (patch)
tree80be32426f92c285de2dd14ccd196b0a1ccaf2ed /coin/provisioning/common/windows
parent22c427b3699c1b191373af93adadb66e0f39b755 (diff)
Provisioning: install-msys2.ps1 must run its commands synchronously
[*] Using bash instead of msys2_shell.cmd allows Start-Process to actually wait for the end of command execution. [*] cpan requires "yes" to be typed by user when it's run first time, otherwise it hangs indefinitely waiting for input. [*] Stop gpg-agent and dirmngr started in the background to prevent CI session from hanging. Change-Id: I4d4c1f36d215cb7578d1e7059217e34375de96c6 Reviewed-by: MÃ¥rten Nordheim <>
Diffstat (limited to 'coin/provisioning/common/windows')
1 files changed, 8 insertions, 6 deletions
diff --git a/coin/provisioning/common/windows/install-msys2.ps1 b/coin/provisioning/common/windows/install-msys2.ps1
index 0c4a9680..e88c8f07 100644
--- a/coin/provisioning/common/windows/install-msys2.ps1
+++ b/coin/provisioning/common/windows/install-msys2.ps1
@@ -33,8 +33,6 @@
. "$PSScriptRoot\helpers.ps1"
-# This script installs 7-Zip
$version = "20181211"
$prog = "msys2"
if (Is64BitWinHost) {
@@ -58,13 +56,17 @@ $TargetLocation = "C:\Utils"
Download $url_official $url_cache $PackagePath
Verify-Checksum $PackagePath $sha1
Extract-tar_gz $PackagePath $TargetLocation
-$msys = "$TargetLocation\$folder\msys2_shell.cmd"
+$bash = "$TargetLocation\$folder\usr\bin\bash"
# install perl
-Run-Executable "$msys" "`"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman -S --noconfirm perl make`""
-Run-Executable "$msys" "`"-l`" `"-c`" `"cpan -i Text::Template Test::More`""
+Run-Executable "$bash" "`"-l`" `"-c`" `"rm -rf /etc/pacman.d/gnupg;pacman-key --init;pacman-key --populate msys2;pacman -S --noconfirm perl make`""
+Run-Executable "$bash" "`"-l`" `"-c`" `"yes | cpan -i Text::Template Test::More`""
Write-Host "Cleaning $PackagePath.."
Remove-Item -Recurse -Force -Path "$PackagePath"
-Write-Output "7-Zip = $version" >> ~\versions.txt
+# pacman-key launches gpg-agent and dirmngr in the background, see
+Stop-Process -Name "gpg-agent" -ErrorAction Ignore
+Stop-Process -Name "dirmngr" -ErrorAction Ignore
+Write-Output "MSYS2 = $version" >> ~\versions.txt