Skip to content

Build with VS2015 #773

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

Merged
merged 23 commits into from
Oct 25, 2016
Merged

Build with VS2015 #773

merged 23 commits into from
Oct 25, 2016

Conversation

jeffhostetler
Copy link

@jeffhostetler jeffhostetler commented Jun 3, 2016

This sequence of commits allows git-for-windows to be built using VS2015.
This includes changes to build scripts and MSVC-specific versions of various OS and CRT wrappers.
It is sufficient to allow debugging and profiling using VS2015.

It DOES NOT attempt to generate SLN or VCPROJ files.
Most of my efforts here have been focused on porting to VC and the new UCRT in VS2015.

I'd eventually like to merge this effort with: #256
since Philip is concentrating on the SLN and VCPROJ issues.

This should be considered a WIP, since there are several cleanup steps (documented in one
of the READMEs) and I still need to get through the test suite (and add any additional tests we
think are necessary).

@PhilipOakley
Copy link

----- Original Message -----
From: Jeff Hostetler
To: git-for-windows/git
Sent: Friday, June 03, 2016 9:22 PM
Subject: [git-for-windows/git] WIP -- Build with VS2015 (#773)

This sequence of commits allows git-for-windows to be built using VS2015.
This includes changes to build scripts and MSVC-specific versions of various OS and CRT wrappers.
It is sufficient to allow debugging and profiling using VS2015.

It DOES NOT attempt to generate SLN or VCPROJ files.
Most of my efforts here have been focused on porting to VC and the new UCRT in VS2015.

I'd eventually like to merge this effort with: #256
since Philip is concentrating on the SLN and VCPROJ issues.

Excellent work
I suspect that the #256 will work on top of this

Philip


You can view, comment on, or merge this pull request online at:
#773

Commit Summary
a.. Add VS2015 trash files to .gitignore
b.. NuGet scripts for building with VS2015
c.. Update compat/vcbuild/scripts/clink.pl for VS2015
d.. Updated Makefile and compiler settings for VS2015.
e.. msvc.h: include sigset_t definition
f.. compat/msvc.h: define O_ACCMODE for MSVC
g.. _REPARSE_DATA_BUFFER: add MSCV definitions
h.. fixup! _REPARSE_DATA_BUFFER:
i.. Compile with VS2015.
j.. Turned off debug messages in cache-tree.c
File Changes
a.. M .gitignore (2)
b.. M Makefile (2)
c.. M cache-tree.c (10)
d.. M compat/mingw.c (342)
e.. M compat/mingw.h (63)
f.. M compat/msvc.h (40)
g.. A compat/vcbuild/.gitignore (1)
h.. A compat/vcbuild/Makefile (124)
i.. A compat/vcbuild/README_VS2015.txt (62)
j.. A compat/vcbuild/nuget.config (27)
k.. A compat/vcbuild/packages.config (23)
l.. M compat/vcbuild/scripts/clink.pl (10)
m.. M compat/winansi.c (114)
n.. M config.mak.uname (42)
o.. M git-compat-util.h (9)
Patch Links:
a.. https://github.com/git-for-windows/git/pull/773.patch
b.. https://github.com/git-for-windows/git/pull/773.diff

@jeffhostetler
Copy link
Author

Rebased onto v.2.9.0.windows.1.

my $is_linking = 0;
while (@ARGV) {
my $arg = shift @ARGV;
if ("$arg" =~ /^-[DIMGO]/) {
if ("$arg" =~ /^-[DIMGOZ]/) {

This comment was marked as off-topic.

This comment was marked as off-topic.

@dscho
Copy link
Member

dscho commented Jun 21, 2016

Looks quite good already!

I am sure we can whip this into shape now.

@jeffhostetler
Copy link
Author

Hey @dscho big thanks for taking a look at this! I'll give it another spin shortly.

@jeffhostetler
Copy link
Author

Note to self: See also #49 WRT the environment conversion issue. I added code in my port to MSVC to change how that is handled at startup due to differences in the CRT.

@dscho
Copy link
Member

dscho commented Oct 18, 2016

I rebased this branch (verifying that the OpenSSL SHA-1 patch is no longer necessary) and touched up the commit messages and pushed the result to the vs2015 branch of https://github.com/dscho/git.

I will continue tomorrow, editing the commits as per my suggestions, and hope you may find time some time later this week to look over the branch and maybe rebase your branch?

dscho and others added 2 commits October 20, 2016 06:37
The file compat/msvc.c includes compat/mingw.c, which means that we have
to recompile compat/msvc.o if compat/mingw.c changes.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Member

dscho commented Oct 23, 2016

For the record, I've been continuing to work on this branch, and as of an hour ago, it passes the test suite. This required adding the libiconv dependency and a very ugly workaround for the NuPkg's iconv() apparently forgetting to set errno, but hey,: it passes!

Currently I am testing whether things work just fine without the ugly SNPRINTF_RETURNS_BOGUS workaround, and I will still want to check back with you whether the explanation in the other WIP commit is correct, but we're getting closer!

@jeffhostetler
Copy link
Author

Excellent!!! Thanks for your help on this.
I'll take a look at the other WIP question.
I assume you mean:
dscho@ec7f740

@jeffhostetler
Copy link
Author

jeffhostetler commented Oct 23, 2016

I just built your branch and commented out the #ifdef's in dscho@ec7f740
and it does build fine. It reports a couple of warnings, but there are other files where we get those, so if you're OK with a few warnings, we could omit this commit. (I'm using a pre-release of VS "15" if that matters.)

    CC compat/msvc.o
msvc.c
d:\w\gfw\gh\compat\mingw.c(1589): warning C4090: 'function': different 'const' qualifiers
d:\w\gfw\gh\compat\mingw.c(1599): warning C4090: 'function': different 'const' qualifiers
    AR libgit.a

For the record, you're right the commit message is suspect. I should have said that it was complaining about the memcpy() and the free() on the const pointer.

@dscho
Copy link
Member

dscho commented Oct 24, 2016

I'll take a look at the other WIP question.
I assume you mean:
dscho/git@ec7f740

Yep!

For the record, you're right the commit message is suspect. I should have said that it was complaining about the memcpy() and the free() on the const pointer.

Right! I changed it.

I just built your branch and commented out the #ifdef's in dscho/git@ec7f740
and it does build fine. It reports a couple of warnings, but there are other files where we get those, so if you're OK with a few warnings, we could omit this commit.

I'd rather keep it. It would be nice to eliminate the warnings in the long run (real bugs tend to hide within such swaths of warnings; I remember e.g. an incorrect assignment of size_t to int that caused spurious segmentation faults on 64-bit systems), but it is not a high priority, I agree.

(I'm using a pre-release of VS "15" if that matters.)

Don't you have to override SANE_TOOL_PATH for that?

@jeffhostetler
Copy link
Author

WRT VS "15", yes I had to update both SANE_TOOL_PATH and MSVC_VCDIR to get it to build with VS "15". I haven't pushed this yet, since it's just a pre-release -- and I suspect the lines in config.mak.uname containing "10.0.10240.0" will need a similar fix, but I won't know the build numbers until it is actually released. Long time, I'd like to have something that properly knows how to get the MSVC paths....

dscho added a commit that referenced this pull request Aug 22, 2018
dscho added a commit to dscho/git that referenced this pull request Aug 22, 2018
dscho added a commit that referenced this pull request Aug 23, 2018
dscho added a commit that referenced this pull request Aug 23, 2018
dscho added a commit that referenced this pull request Aug 23, 2018
jamill pushed a commit to jamill/git that referenced this pull request Aug 28, 2018
jamill pushed a commit to jamill/git that referenced this pull request Sep 5, 2018
git-for-windows-ci pushed a commit that referenced this pull request Sep 10, 2018
jamill pushed a commit to jamill/git that referenced this pull request Sep 11, 2018
git-for-windows-ci pushed a commit that referenced this pull request Sep 24, 2018
dscho added a commit that referenced this pull request Oct 10, 2018
dscho added a commit to dscho/git that referenced this pull request Oct 12, 2018
Build with VS2015

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Oct 12, 2018
dscho added a commit that referenced this pull request Oct 12, 2018
Build with VS2015

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants