Skip to content

Git failed when build on /std:c++latest + MSVC on windows #1905

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

Closed
QuellaZhang opened this issue Oct 31, 2018 · 5 comments
Closed

Git failed when build on /std:c++latest + MSVC on windows #1905

QuellaZhang opened this issue Oct 31, 2018 · 5 comments
Assignees
Milestone

Comments

@QuellaZhang
Copy link

Hi All,

We (the Microsoft C++ team) use the Git project as a part of our "Real World Code" tests. In our latest version, Git failed when build under /std:c++latest option like below error, I just want to confirm if the flag '/Gm' is very necessary for the project? This will not compatable with 'std:c++latest' any more in future.

Failures:
cl : Command line warning D9035 : option 'Gm' has been deprecated and will be removed in a future release
cl : Command line error D8016 : '/Gm' and '/std:c++latest' command-line options are incompatible

@dscho
Copy link
Member

dscho commented Oct 31, 2018

Hi @QuellaZhang, pleasure to meet you!

AFAIU /Gm makes it faster to re-build incrementally, right? If so, it would be nice to keep using that feature. Are there better/other options we should use?

@dscho
Copy link
Member

dscho commented Oct 31, 2018

And: could you describe which revision of Git you are compiling, and using what method (make MSVC=1 vs Visual Studio)?

@cdacamar
Copy link

/Gm is a very old attempt to make incremental compiling faster. In newer versions of msvc it is not compatible with much of the way the compiler works anymore and hasn't been actively maintained in several years.

As of 15.9 the feature has been deprecated with the intent of complete removal. The preferred option for incremental builds is still incremental link. Additionally, if incremental builds are still a concern investigating C++ modules would also be worth investigation.

@dscho
Copy link
Member

dscho commented Oct 31, 2018

@cdacamar thanks. I still would like to know how you build Git, as I am unable to find any mention of the Gm flag in the source code.

@cdacamar
Copy link

All we do is checkout the vs/master branch and invoke msbuild on the top-level .sln file: git.sln. So if there are references in any .vcxproj file it should be removed. Here's one example: https://github.com/git-for-windows/git/blob/vs/master/git/git.vcxproj#L69

@dscho dscho closed this as completed in 49587fd Nov 23, 2018
@dscho dscho self-assigned this Nov 23, 2018
@dscho dscho added this to the v2.19.2(2) milestone Nov 23, 2018
dscho added a commit to microsoft/git that referenced this issue Nov 23, 2018
…ersions

The `/Gm` flag was deprecated, so let's not use it anymore (nor the
corresponding `<MinimalRebuild>` tag in the `.vcxproj` files).

This fixes git-for-windows#1905.

Signed-off-by: Johannes Schindelin <[email protected]>
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

No branches or pull requests

3 participants