-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
VS2017 vcpkg support. #1304
VS2017 vcpkg support. #1304
Conversation
I should have mentioned that the 3 or 4 vcpkg_*.bat setup scripts only need |
compat/vcbuild/vcpkg_defines.bat
Outdated
@ECHO OFF | ||
REM ================================================================ | ||
REM This script builds a set of MAKEFILE definitions to allow a | ||
REM normal "make MSVC=1 vcpkg" to find the vcpkg-version of the |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
TODO It turns out that when you build with "make MSVC=1 DEBUG=1", that the zlib .lib/.dll are named zlibd rather than zlib. I need to update the bat file that installs them to remove the 'd' -- or to fix the ld step to know about the debug flag. |
Awesome! I'll have a look next week. |
Or six weeks later... Sorry! Anyway, I gave this a look-over, and also worked on using the vcpkg stuff from inside Visual Studio. I think I succeeded... Could you have a look @jeffhostetler? |
ef6d253
to
4b0abad
Compare
One time too many did this developer call the `generate` script passing a `--make-out=<PATH>` option that was happily ignored (because there should be a space, not an equal sign, between `--make-out` and the path). And one time too many, this script not only ignored it but did not even complain. Let's fix that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The script assumes that we're in the top-level directory of the checkout. That does not need to be true. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Dependencies such as cURL and OpenSSL are necessary to build and run Git. Previously, we obtained those dependencies by fetching NuGet packages. However, it is notoriously hard to keep NuGet packages of C/C++ libraries up-to-date, as the toolsets for different Visual Studio versions are different, and the NuGet packages would have to ship them all. That is the reason why the NuGet packages we use are quite old, and even insecure in the case of cURL and OpenSSL (the versions contain known security flaws that have been addressed by later versions for which no NuGet packages are available). The better way to handle this situation is to use the vcpkg system: https://github.com/Microsoft/vcpkg The idea is that a single Git repository contains enough supporting files to build up-to-date versions of a large number of Open Source libraries on demand, including cURL and OpenSSL. We integrate this system via four new .bat files to 1) initialize the vcpkg system, 2) build the packages, 4) set up Git's Makefile system to find the build artifacts, and 3) copy the artifacts into the top-level directory Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We no longer use NuGet packages... Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
As we do not consume NuGet packages any longer, there is no sense to try to point PATH to their unpacked .dll files, either. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It really does depend on libgit. It does not hurt to let it depend on xdiff, and it makes the code simpler. It is necessary to get this dependency chain right, because we will introduce a change where the vcpkg system is initialized before building libgit. The vcpkg system will then build the dependencies needed by Git (and thereby make the include headers available): As the vcpkg system cannot be run in parallel (it does not lock, wreaking havoc with files being accessed and written at the same time, letting the vcpkg processes stumble over each others' toes. We prevent that by ensuring that only one project is built at first: libgit. And this project's PreBuildEvent will be used to initialize vcpkg and build all dependencies. Subsequently, the other projects can be built in parallel. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The .vcxproj's text nodes do not actually need to URL-encode double quotes. So let's not do that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Okay, I worked a bit more on this, and now it even copies the Sadly, a quick Anyway, could you have another look, @jeffhostetler? |
@dscho I didn't see what you did to the installer for the DLLs and PDBs, but I pushed a commit to copy the 3rd-party DLLs and PDBs during the install. I just tried a "make MSVC=1 HOME=/d/foo install" and was able to use the resulting installation in /d/foo/bin, so I think we're good. Building from the SDK/bash worked fine and automatically fetched vcpkg, cmake, and the libraries, so I think were good there. I did not try the .sln portion this morning. |
So... I ran the test suite and it turns out that t6500 is failing. Today, I found some time to investigate a bit further and it would appear as if Git uses Funnily enough, further digging brings up afe2fab... which is a commit that made it into v2.14.3, but this here branch is based on an earlier commit. So I simply backported the fix. IIRC there was one other test failure, I am re-running the entire test suite now. |
I added another patch that was required here to let t7814 pass; it triggered a thread-related bug in |
BTW there is one more thing I would love to do before merging this PR: the |
An Aside: What is the minimum needed workflow when installing the VS2017 community edition (15.5.2). I'm guessing that the first offered option of the Universal Windows Development Platform" will give every thing and the kitchen sink... I'm more thinking that "Desktop Development with C++" is the more appropriate (better /minimal) option for the GfW usage (this is for a W7 64 bit machine) Any thoughts? |
I pushed yet another commit, this one fixing a bug in one of my old fixups. Sorry for the breakage! |
My intention is that you should be able to build the solution, and it does everything you need to allow running the tests in a Git Bash (from your regular Git for Windows installation, no Git for Windows SDK required).
It should. It also should successfully install the "vcpkg" system into a subdirectory, and build the necessary dependencies there.
Possibly. I don't know, quite honestly. If you could try it, and if you can then verify that it eases the initial install workload noticeably, I think that would make for a fine contribution to the wiki page. |
#include "qsort.c" | ||
#endif | ||
|
||
/* Compare only keys */ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
maxlen += strlen(deltaenv[k]) + 1; | ||
nr_delta_ins++; | ||
} | ||
if (!deltaenv || !*deltaenv) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
* We will use the wblock_ins as the final result. | ||
* If there is a deltaenv, let's accumulate all keys into `array`, | ||
* sort them using the stable git_qsort() and then copy, skipping | ||
* duplicate keys |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
/* convert the deltaenv, appending to array */ | ||
for (i = 0, p3 = wdeltaenv; deltaenv[i]; i++) { | ||
size_t s = strlen(deltaenv[i]) + 1, wlen; | ||
wlen = xutftowcs(p3, deltaenv[i], s * 2); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
VS2017 vcpkg support.
Use the new vcpkg package manager to build (fresh) third party libraries
rather than NuGet packages when building with MSVC. The vcpkg setup
can run with either a Command Prompt or a SDK bash window.
I have built git using VS2017 (using "make MSVC=1") and all seems well.
I have not tried it with VS2015.
@dscho I left a TODO note in the README about updating the PERL code to
generate the .sln/.vcxproj files. It should be relatively easy, but PERL is not my
thing.