This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Prefer 64bit Git and\or Visual Studio's Git for Windows on Windows 10 64 bit #11109
Labels
category:vcpkg-feature
The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Git for Windows provide 64bit portable binaries. For instance: https://github.com/git-for-windows/git/releases/tag/v2.26.2.windows.1
Currently an x86 (32bit) git binary is being downloaded and used every time vcpkg is installed somewhere on x64 Windows 10:
Unfortunately, it appears that the version of Git offered by Visual Studio is older than the current version used by vcpkg:
If the people maintaining Git for Windows at Microsoft would bump their version to 2.26.2 or newer, vcpkg on windows could use it instead of downloading a portable copy of Git every time it is installed.
On Windows 10, Visual Studio's Git for Windows could be installed by vcpkg if Visual Studio is detected in one of the methods detailed in the following web page:
https://devblogs.microsoft.com/cppblog/finding-the-visual-c-compiler-tools-in-visual-studio-2017/
Likely the powershell API is optimal.
(As an aside, the atlmfc port could also do this for the installation of ATL/MFC components instead of just printing an error to screen and a build failing if the components are missing.)
I understand that there maybe security reasons for needing the latest Git (and surely this is more important for a system wide installation.)
But are there new git features which vcpkg is relying on which require the very latest git binary which would mean that looking for and using Visual Studio's git binary is a no go?
Proposed solution
Detect if a Windows system is 64 bit and use 64bit portable Git binaries, should that be the case.
Attempt to use Visual Studio's Git for Windows component instead of a portable git binary on Windows.
Fall back to a portable Git binary if the version shipped via Visual Studio's Git for Windows component is too old and lacks new features required by vcpkg (although I'm not aware of any currently.)
Additional context
In short, I'd just like to install git once via the Visual Studio installer and forget about it. It irks me slightly to see an arbitrary 32 bit binary being downloaded from an un-vetted external source (although technically trusted) which is not Microsoft. Github releases allow anyone to upload anything as an archive afaik. This poses a risk factor which doesn't need to exist. Git for Windows via the Visual Studio installer should be able to provide all that vcpkg needs from a git binary and vcpkg should use it by default on Windows 10 imo.
The text was updated successfully, but these errors were encountered: