-
Notifications
You must be signed in to change notification settings - Fork 77
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
Rework of MSVC tools #341
Rework of MSVC tools #341
Conversation
I added the following information to the docs. My plan is to do some more testing tomorrow. If all goes well I should be able to add the app platforms, MFC/ATL and clang over the weekend and maybe then we can merge this? |
Nice work, let me take this for a test drive. |
I like this, it works well for me. Ready for me to merge this or do you want to touch anything up? |
Yes, there are a few things I need to test. It looks like the VS 2022 BuildTools are still being loaded from I have VS 2017 - VS 2022 and various products installed and some samples that I just want to run though to verify everything. Hoping to get that done over the weekend and then I'll just take this PR out of draft mode and you can squash merge everything with a nice summary? Also to be perfectly clear, I will also delete msvc-common-next.lua and msvs-vcwild.lua and migrate msvc-vs2017..msvc-vs2022 to msvc-latest. |
c39c073
to
caf2ebd
Compare
Okay, here's the gist
DAG regen takes about 10 milliseconds per configuration. In a build with 12 configurations Here's what this PR doesn't do
I will be submitting another PR for Unless someone has anything else to add, feel free to merge this. |
caf2ebd
to
76fb3cf
Compare
76fb3cf
to
ea89e10
Compare
Okay, I'm done I just found a silly bug and forgot to cleanup a file. No more force pushing. |
I got annoyed by the slowness associated with the
vcvarsall.bat
invocation (which is totally my fault) so I investigated what the VsDevCmd.bat script does (the script responsible for setting up the Developer Command Prompt for Visual Studio).VsDevCmd.bat just calls the bat files in these locations
<Path>\<Version>\<Product>\Common7\Tools\vsdevcmd\core
<Path>\<Version>\<Product>\Common7\Tools\vsdevcmd\ext
But for the VC tools the only two scripts that we care about are
core\winsdk.bat
andext\vcvars.bat
. Unsurprisingly these take about 160 milliseconds to complete. So I ported them into a newmsvc-latest.lua
tools script and DAG regen is now down to ~40 milliseconds and this is without avcvars_cache
.I have made some concessions. I have...
__VCVARS_*_OVERRIDE
varsI made some changes to the MSVC config options. The old names still work but I though these aligned more nicely with everything else. So I would have to update the docs (add a new section after vs2008)!
I call this tool
msvc-latest
because when Microsoft eventually releases VS20xx this should keep on working. I'm hoping that this will be forward compatible and that it can be used to replacemsvc-vscommon-next.lua
. It will however emit a warning for untested Visual Studio versions.Maybe something like this:
Thus deleting
msvc-vscommon-next.lua
andmsvc-vswild.lua
(I don't think any sensible person uses this)I haven't tested this thoroughly yet but it appears to work just fine, as-is. I've tried to include very helpful error messages and made it output the exact version you end up using if you don't specify one, so that if you want to, you can more easily lock in a specific SDK and compiler version. It might look like this:
I'm planning on adding support for ATLMFC and app platforms however, these will be opt-in.
I'm also planning a
msvc-clang.lua
tool. Since Microsoft now ships clang with Visual Studio. Adding this is very little effort (given everything else here) and I think it's really nice to easily be able to use clang on Windows with Tundra.I would very much appreciate some feedback on this. Like naming, direction, overall scope. Maybe some brave soul who can test the new tooling script before merging and so that we don't risk breaking stuff?