Skip to content

Commit d901d21

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Merge pull request git-for-windows#2351 from PhilipOakley/vcpkg-tip
Vcpkg Install: detect lack of working Git, and note possible vcpkg time outs
2 parents b52f70a + 25f0f58 commit d901d21

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ jobs:
197197
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/x64-windows \
198198
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
199199
- name: MSBuild
200-
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
200+
run: |
201+
$sln = if (Test-Path git.slnx) { 'git.slnx' } else { 'git.sln' }
202+
msbuild $sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4
201203
- name: bundle artifact tar
202204
shell: bash
203205
env:

lib/compat/vcbuild/vcpkg_install.bat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ REM ================================================================
3636

3737
dir vcpkg\vcpkg.exe >nul 2>nul && GOTO :install_libraries
3838

39+
git.exe version 2>nul
40+
IF ERRORLEVEL 1 (
41+
echo "***"
42+
echo "Git not found. Please adjust your CMD path or Git install option."
43+
echo "***"
44+
EXIT /B 1 )
45+
3946
echo Fetching vcpkg in %cwd%vcpkg
4047
git.exe clone https://github.com/Microsoft/vcpkg vcpkg
4148
IF ERRORLEVEL 1 ( EXIT /B 1 )
@@ -73,6 +80,12 @@ REM ================================================================
7380
:sub__install_one
7481
echo Installing package %1...
7582

83+
REM vcpkg may not be reliable on slow, intermittent or proxy
84+
REM connections, see e.g.
85+
REM https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4a8f7be5-5e15-4213-a7bb-ddf424a954e6/winhttpsendrequest-ends-with-12002-errorhttptimeout-after-21-seconds-no-matter-what-timeout?forum=windowssdk
86+
REM which explains the hidden 21 second timeout
87+
REM (last post by Dave : Microsoft - Windows Networking team)
88+
7689
.\vcpkg.exe install %1:%arch%
7790
IF ERRORLEVEL 1 ( EXIT /B 1 )
7891

0 commit comments

Comments
 (0)