Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Prefer 64bit Git and\or Visual Studio's Git for Windows on Windows 10 64 bit #11109

Closed
heydojo opened this issue May 1, 2020 · 2 comments
Closed
Assignees
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Comments

@heydojo
Copy link
Contributor

heydojo commented May 1, 2020

  • Please try to match a version of the git binary vcpkg will use with the architecture vcpkg is running on.

Git for Windows provide 64bit portable binaries. For instance: https://github.com/git-for-windows/git/releases/tag/v2.26.2.windows.1

PortableGit-2.26.2-64-bit.7z.exe

Currently an x86 (32bit) git binary is being downloaded and used every time vcpkg is installed somewhere on x64 Windows 10:

A suitable version of git was not found (required v2.26.2). Downloading portable git v2.26.2...
Downloading git...
  https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe -> D:\bluehawk\bhawk\vcpkg\downloads\PortableGit-2.26.2-32-bit.7z.exe
Extracting git...
  • Visual Studio already has git. It is packaged using an individual component named "Git for Windows."

git

Unfortunately, it appears that the version of Git offered by Visual Studio is older than the current version used by vcpkg:

git --version
git version 2.17.1.windows.2

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.

@heydojo heydojo added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label May 1, 2020
@MVoz
Copy link
Contributor

MVoz commented May 1, 2020

2020-05-01_174335

@BillyONeal
Copy link
Member

Giving this to @ras0219 because it sounds vaguely binary caching related.

@microsoft microsoft locked and limited conversation to collaborators May 11, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Projects
None yet
Development

No branches or pull requests

6 participants