Skip to content
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

The generated MSVC-DEFS-GEN is incomplete #2186

Closed
PhilipOakley opened this issue May 10, 2019 · 10 comments
Closed

The generated MSVC-DEFS-GEN is incomplete #2186

PhilipOakley opened this issue May 10, 2019 · 10 comments

Comments

@PhilipOakley
Copy link

Newer versions of Visual Studio have moved some of the core include and library files required to compile with MSVC=1.

When doing such a compile the MSVC-DEFS-GEN is auto generated somewhere in vcpkg (see

<repo_root>/compat/vcbuild/MSVC-DEFS-GEN
)

Where is that 'somewhere' that generates the file? @jeffhostetler - do you remember?, to avoid me dropping down the rabbit hole, see also #2179

@jeffhostetler
Copy link

jeffhostetler commented May 10, 2019 via email

@PhilipOakley
Copy link
Author

PhilipOakley commented May 11, 2019 via email

@PhilipOakley
Copy link
Author

Finally got some moments to properly look through this / my notes.

It looks like I was stuck inside a little loop between the Makefile (config.mak.uname #L21) target of
compat/vcbuild/MSVC-DEFS-GEN: compat/vcbuild/find_vs_env.bat
and the fact that I already had one (that file target), but had updated the VS install relative to some time in the past when it was generated.

So. When I renamed (so as not to lose) the file (added _0 to the name), a new was generated, which I then compared with the old version (with my amendments), and yes the new version does look like it should work.

In summary, 'we' need a note to say that when one updates Visual Studio, one should delete the
MSVC-DEFS-GEN file. If only one had known...

Looks like make MSVC=1 has worked without error. So +1 to the team that that created all the support code.
(I just need to re-clone all my pack 'cos of a crc mistake earlier - doh)

@dscho
Copy link
Member

dscho commented May 20, 2019

In summary, 'we' need a note to say that when one updates Visual Studio, one should delete the
MSVC-DEFS-GEN file.

I wonder whether we can somehow detect that situation and Do The Right Thing instead of asking the user to delete the file manually.

@jeffhostetler
Copy link

I have code in the Makefile so that if you do "make MSVC=1 clean" it will delete the MSVC-DEFS-GEN file, but that still requires explicit action by the user.

@jeffhostetler
Copy link

We could:
[] change config.mak.uname to always run find_vs_env.bat (instead of only when MSVC-DEFS-GEN does not exist).
[] change find_vs_env.bat to only write the file when it doesn't exist or when the values have changed.
[] change Makefile and the GIT-BUILD-OPTIONS mechanism to be aware of the file. For example, append the contents (or hash) of MSVC-DEFS-GEN to the candidate GIT-BUILD-OPTIONS+ ($@+) file, so that it is reflected in the "@if cmp $@+ $@" line at the bottom.

My only concern is the speed of the find_vs_env.bat script. It takes a few seconds to lookup that data.
But I think something like that would work.

I'm still digging from vacation, so I don't have time to dig into this now, but that's what I would try first.

@PhilipOakley
Copy link
Author

I'm on vacation too ;-) I have a small update to the README in my repo, but should also include the bit about the clean option.

I also had the thought that the clean also removed all the existing vcpkg bits, which maybe overzealous as it took 'minutes' to get all of them for me, so getting the selectivity right will be something to look at once we are all back ...

@PhilipOakley
Copy link
Author

I'm on vacation too ;-)

Oops that sounded wrong. I mean, I'm now on a holiday, so I'm also indisposed...

@dscho
Copy link
Member

dscho commented Jun 8, 2019

I have a small update to the README in my repo, but should also include the bit about the clean option.

That sounds good.

I also had the thought that the clean also removed all the existing vcpkg bits, which maybe overzealous as it took 'minutes' to get all of them for me

Indeed, I think this is a bit much of the cleaning. The vcpkg stuff is basically providing third-party libraries that Git expects to somehow be available already, so with the idea that make clean cleans Git's source code, I think it should not remove vcpkg's stuff.

Besides, if you care to look at https://dev.azure.com/git/git/_build?definitionId=9 (which builds vcpkg every two weeks, offering the result as an artifact to be consumed by Git's Azure Pipeline when it builds with MSVC), you will see that the successful runs take over 10 minutes. That's a hefty price to pay for a simple make clean, I would say.

So better not touch compat\vcbuild\vcpkg in make clean.

@dscho
Copy link
Member

dscho commented Oct 15, 2021

Closing this stale ticket.

@dscho dscho closed this as completed Oct 15, 2021
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