-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Windows buildenv: Use CMake for extraction #11524
base: main
Are you sure you want to change the base?
Conversation
I wonder if it's possible to download and extract the VCPKG buildenv using |
Doing it in the CMakeList.txt has the side effect that it will introduce a strict coupleing of the build process with the environment download. I like to avoid that, to make the switching branches as lightweight as possible. Currently it is perfectly possible to build older PR branches with the most recent vcpkg environment. This helps to limit bandwidth and diskspace during development. The environment update is an optional step. |
This wouldn't change, if you do it as propose above, it will remain two independent steps. Each would require user action:
But this way we would get rid of all the native tools for download and extracting - and we could use generic code for both, Windows and MacOS. |
Ah, yes. It could be an independent configure step. |
I have measured on a Windows 10 device and the result is quite surprising. I have used the command two times to sort out caching issues. The reported time is the smallest.
The winzip performance is the poorest for reference:
Conclusion: move to cmake! |
You missed to test the builtin Windows unzip function (which is the only one, that is always available) and we use as last fallback. This is really slooow... |
There is no need to unzip it, if cmake is not installed. So we can prompt the user for cmake instead of crawling the system for unzip functions. |
The difficult part is to find the CMake executable when you start windows_buildenv.bat by double-click. |
We don't need to detect cmake itself. start cmd.exe: start X64 Native tools for Visual studio: Back to when we used scons, we had a script that preloaded the visual studio vars: vcvars64.bat (this is for 64bits). Also, I see that I have this one declared on the system, not requiring the lauch of the shell: This is the path of the bat: So a test if VSCMD_VER is set and if not, check which "VS20XXINSTALLDIR" we have defined (2019, 2022..) and calling "%VS20XXINSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat" could do it. |
This PR is marked as stale because it has been open 90 days with no activity. |
As suggested in #11510 (comment), this migrates the Windows buildenv script to use CMake for unzipping, which should no longer require a dependency on 7-Zip or a custom PowerShell implementation.
Moved to a separate PR for more extensive testing, especially w.r.t performance.
To do:
cmake
is not on the user'sPATH
(see Windows buildenv: Fix 7-Zip quoting #11510 (comment))