-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Visual Studio solution: check for updates of vcpkg #2424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,16 @@ REM ================================================================ | |
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD | ||
cd %cwd% | ||
|
||
dir vcpkg\vcpkg.exe >nul 2>nul && GOTO :install_libraries | ||
REM the architecture is currently hard-coded, and that we will change that once we need to. | ||
SET arch=x64-windows | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really the correct thing to do? I'd rather have this as independent of the current architecture as possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's the current way. That appears to be just the way it is (see lower down in the bat file). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I mentioned below, if we are already moving it, we should move it to the top, and add a good comment about the raison d'être for this variable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really the correct thing to do? I'd rather have this as independent of the current architecture as possible. |
||
|
||
REM is vcpkg package installed and complied? | ||
REM can be inhibited by creating compat\vcbuild\NoPrebuildEvent.txt | ||
|
||
IF EXIST "vcpkg\installed\%arch%\include\openssl\ssl.h" GOTO :check_for_update | ||
|
||
REM is vcpkg package manager already cloned | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix the indentation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Local REM indentation is single space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Look at it on GitHub. There is a difference between the indentation of all your |
||
IF EXIST vcpkg\vcpkg.exe GOTO GOTO :install_libraries | ||
|
||
git.exe version 2>nul | ||
IF ERRORLEVEL 1 ( | ||
|
@@ -53,9 +62,18 @@ REM ================================================================ | |
IF ERRORLEVEL 1 ( EXIT /B 1 ) | ||
|
||
echo Successfully installed %cwd%vcpkg\vcpkg.exe | ||
GOTO :install_libraries | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should not squeeze the |
||
|
||
:check_for_updates | ||
echo Checking for vcpkg updates and upgrades to installed libraries | ||
cd %cwd%vcpkg | ||
git pull | ||
.\vcpkg.exe update | ||
.\vcpkg.exe upgrade --no-dry-run | ||
|
||
EXIT /B 0 | ||
|
||
:install_libraries | ||
SET arch=x64-windows | ||
|
||
echo Installing third-party libraries... | ||
FOR %%i IN (zlib expat libiconv openssl libssh2 curl) DO ( | ||
|
@@ -80,11 +98,11 @@ REM ================================================================ | |
:sub__install_one | ||
echo Installing package %1... | ||
|
||
REM vcpkg may not be reliable on slow, intermittent or proxy | ||
REM connections, see e.g. | ||
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 | ||
REM which explains the hidden 21 second timeout | ||
REM (last post by Dave : Microsoft - Windows Networking team) | ||
REM vcpkg may not be reliable on slow, intermittent or proxy | ||
REM connections, see e.g. | ||
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 | ||
REM which explains the hidden 21 second timeout | ||
REM (last post by Dave : Microsoft - Windows Networking team) | ||
|
||
.\vcpkg.exe install %1:%arch% | ||
IF ERRORLEVEL 1 ( EXIT /B 1 ) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,9 +180,8 @@ sub createProject { | |
EOM | ||
if ($target eq 'libgit') { | ||
print F << "EOM"; | ||
<PreBuildEvent Condition="!Exists('$cdup\\compat\\vcbuild\\vcpkg\\installed\\\$(VCPKGArch)\\include\\openssl\\ssl.h')"> | ||
<Message>Initialize VCPKG</Message> | ||
<Command>del "$cdup\\compat\\vcbuild\\vcpkg"</Command> | ||
<PreBuildEvent Condition="!Exists('$cdup\\compat\\vcbuild\\NoPrebuildEvent.txt')"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really, this is the wrong way to go about it. |
||
<Message>Initialize or update VCPKG</Message> | ||
<Command>call "$cdup\\compat\\vcbuild\\vcpkg_install.bat"</Command> | ||
</PreBuildEvent> | ||
EOM | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect.
What we need to figure out is not whether we run in a CI/PR build, but whether we can update
vcpkg
or not.I am very much against introducing this change, as it is a clear "papering over" the actual problem: we are currently not figuring out whether
vcpkg
is initialized via cloning or, say, by copying the ready-built artifacts or not.