-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
GHA: add MSVC UWP job, expand jobs with more options #14077
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
Conversation
talregev
commented
Jul 1, 2024
•
edited by vszakats
Loading
edited by vszakats
- Add more libs from vcpkg to test more cases in curl
- Add uwp case. I tried first with the original mechanism, but it fail to build the uwp. It should handle by vcpkg build system.
- Add more time to timout. vcpkg need to build more time with more libs, more tests take more time.
- Enable WinIDN in a job. Exclude failing tests.
19e7435
to
dd9e634
Compare
On one hand it is odd, because 27 minutes was the total build time curl-for-win needed for 3 targets (x64, arm64, x86), including openssl, curl and all the other dependencies (brotli, zlib, zstd, libssh2, nghttp2, nghttp3, ngtcp2, libpsl). It seems that vcpkg is also installing its own copy of MSYS2, taking 2 minutes. While an MSYS2 already comes with the runner image. Then building gsasl takes 10 minutes. Seems very long, probably all options are built in multiple flavours? Then openssl takes 6 minutes. Unless there is something we can do to make vcpkg builds more optimal, could we drop gsasl? It doesn't seem to add too much value compared to the bulk it requires in this setup. FWIW gsasl can be built swiftly for the purpose of curl, and doesn't require libicu. If vcpkg has an options to optimize it, it could also help. |
Caching is good, but it's not actually improving vcpkg build times. It'd be useful not to waste resources in the actual build. E.g. the cache will rebuild every time it's invalidated, and with more stuff in it, it's invalided more often. How often, it's something to be seen. Ultimately we need to hit a good balance. What is the reason for the duplicate cache keys generated for vcpkg?: E.g. Shouldn't there be just one of each? |
It generate hash every time that the vcpkg change. Most of the time it changed due requests from you to remove or change something in vcpkg. Also when vcpkg change itself. It should be different hash on such update that it will store the new libs that updated / changed. Then it take the most updated hash. I can remove gsal as you request. This PR I set new keys in the cache, so vcpkg build all the libs from scratch. |
That's how it's supposed to work, I agree. But is it possible that these changed 17 times in the last couple of days? Even if we consider the tweaks done in this PR, but most copies belong to other PRs according to the web view. The full list: curl -A ' ' -fsS 'https://api.github.com/repos/curl/curl/actions/caches?per_page=100' | jq '.actions_caches[] | select(.key | startswith("windows"))'
curl -A ' ' -fsS 'https://api.github.com/repos/curl/curl/actions/caches?per_page=100&page=2' | jq '.actions_caches[] | select(.key | startswith("windows"))' One interesting bit is these errors when saving the vcpkg cache, i.e. it tries to save a new version (of the same hash!), but (sometimes?) fails:
Ref: https://github.com/curl/curl/actions/runs/9766007256/job/26957995299#step:6:8 A clean log looks like this:
Dropping [ edit: As for |
After experimenting, I've found these ways to streamline using vcpkg:
|
Hi, I have busy days and I cannot much response and I will not be available until next week. another note, I also put the other libraries, not just to trigger curl tests. also to test curl cmake, and check that if someone change it, that it not break the vcpkg detection. we can put separate only building curl and tests without running them. Also if you are confident with your changes feel free to advance. I can give you my opinion next week 🙏🏻 Thank you for letting me know 🙏🏻 |
Thank you @talregev. Of course we can do build-only tests too. I think with the granular cache we can do gsasl and libpsl, and possibly more, with reasonable resources. Yeah, the mixed libssh2 might be one reason for the cache updates. I was also suspecting a zstd confusion (which I was investigating in another PR for many days if not weeks). zstd installing a DLL might hit that, I don't know. Now bumped into LibreSSL possibly colliding with a non-vcpkg OpenSSL. Will investigate. One thing I'd find useful, is if libpsl would be available from vcpkg in a standalone (meaning no libicu, no libidn2) option. This should be possible with the latest libpsl release, at least as a package option. |
for libpsl you can do: |
libpsl requires either of the IDN libs:
https://github.com/curl/curl/actions/runs/9795570152/job/27048057034#step:4:62 They can be avoided by embedding the PSL list into the binary, and in this case pre-processing it using a libpsl-supplied Python script at build-time (probably Meson does this, I haven't tried), so ICU/IDN isn't necessary at runtime. |
dd9e634
to
5493dfc
Compare
Thank you, merged. |
- cache on a per-package basis. Replace manual caching with a built-in solution. It shares cached package builds between jobs, e.g. libssh2 only builds once per platform (instead of once per job). Individual packages are built as needed (not the whole per-job tree). It also fixes the duplicate cache entry issues. Ref: https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache Follow-up to e26cbe2 #13979 Follow-up to cb22cfc #14077 - add BoringSSL job with ECH enabled. The first such job in the curl CI. - add LibreSSL job. - use vcpkg pre-installed on the runner image, instead of rolling our own. This is quicker, simpler and more robust. Follow-up to e26cbe2 #13979 - show pre-installed vcpkg and ports version. - drop `gsasl` dependency till it reaches the pre-installed vcpkg ports. - re-add `find .` to see the binaries generated. - simplify setting up `PATH`. - exclude failing tests for any job enabling WinIDN. - drop collecting and uploading log archives. We already dump CMake logs, and our build doesn't use Ninja. Rest of files weren't generated by the curl build. We don't aim to debug vcpkg package builds. Closes #14090
These IDN tests pass with Unicode and fail without. Follow-up to cb22cfc curl#14077 Closes curl#14188
These IDN tests pass with Unicode and fail without. Follow-up to cb22cfc curl#14077 Closes curl#14188
The MSVC UWP job in CI did not actually enable UWP. Fix this and the fallouts discovered after enabling it. - GHA/windows: make sure to enable UWP in MSVC vcpkg UWP job. Use the CMake options and C flags already used for mingw-w64, but use `WINAPI_FAMILY_PC_APP` instead of the deprecated `WINAPI_FAMILY_APP`. (The former is not supported by mingw-w64, so leave it there as-is.) Follow-up to cb22cfc #14077 - GHA/windows: by default the MSVC UWP job became 2x-3x slower than others after actually enabling UWP. Most of it is caused by CMake/MSBuild automatically building full APPX containers for each `.exe` target. This includes 21 CMake feature detections. Each detection app is built into a 15MB APPX project, with code signing, logos, etc. Example: https://github.com/curl/curl/actions/runs/12056968170/job/33620610958 Disable this overhead for curl build targets via custom `CMAKE_VS_GLOBALS` options. I've found no way to apply them to feature detection targets, so those remain slow. - cmake: automatically enable Unicode for UWP builds. It's required. Also stop enabling it manually in the existing CI job. - tests: fix `getpid()` use for Windows UWP: ``` tests\server\util.c(281,21): warning C4013: 'getpid' undefined; assuming extern returning int ``` Ref: https://github.com/curl/curl/actions/runs/12061215311/job/33632904249#step:11:38 - src/tool_doswin: disable `GetLoadedModulePaths()` for UWP. mingw-w64 UWP was okay with this, but MS SDK headers are not. This makes `--dump-module-paths` return empty for UWP builds. ``` src\tool_doswin.c(620,3): error C2065: 'MODULEENTRY32': undeclared identifier src\tool_doswin.c(626,11): warning C4013: 'CreateToolhelp32Snapshot' undefined; assuming extern returning int src\tool_doswin.c(626,36): error C2065: 'TH32CS_SNAPMODULE': undeclared identifier src\tool_doswin.c(632,7): warning C4013: 'Module32First' undefined; assuming extern returning int ``` Ref: https://github.com/curl/curl/actions/runs/12055081933/job/33614629930#step:9:35 - examples: fix `websocket.c` to include `winsock2.h` before `windows.h` to make it build with MSVC UWP: ``` include\curl\curl.h(143,16): error C2061: syntax error: identifier 'curl_socket_t' include\curl\curl.h(143,16): error C2059: syntax error: ';' include\curl\curl.h(417,52): error C2146: syntax error: missing ')' before identifier 'curlfd' include\curl\curl.h(417,38): error C2081: 'curl_socket_t': name in formal parameter list illegal ``` Ref: https://github.com/curl/curl/actions/runs/12055317910/job/33615644427#step:14:126 - GHA/windows: silence linker warning with MSVC UWP builds: ``` LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification ``` Ref: https://github.com/curl/curl/actions/runs/12055696808/job/33616629610#step:11:38 - GHA/windows: set `/INCREMENTAL:NO` for all MSVC jobs to improve performance a little. - cmake: show `UWP` platform flag. Ref: #15652 Closes #15657
The MSVC UWP job in CI did not actually enable UWP. Fix this and the fallouts discovered after enabling it. - GHA/windows: make sure to enable UWP in MSVC vcpkg UWP job. Use the CMake options and C flags already used for mingw-w64, but use `WINAPI_FAMILY_PC_APP` instead of the deprecated `WINAPI_FAMILY_APP`. (The former is not supported by mingw-w64, so leave it there as-is.) Follow-up to cb22cfc curl#14077 - GHA/windows: by default the MSVC UWP job became 2x-3x slower than others after actually enabling UWP. Most of it is caused by CMake/MSBuild automatically building full APPX containers for each `.exe` target. This includes 21 CMake feature detections. Each detection app is built into a 15MB APPX project, with code signing, logos, etc. Example: https://github.com/curl/curl/actions/runs/12056968170/job/33620610958 Disable this overhead for curl build targets via custom `CMAKE_VS_GLOBALS` options. I've found no way to apply them to feature detection targets, so those remain slow. - cmake: automatically enable Unicode for UWP builds. It's required. Also stop enabling it manually in the existing CI job. - tests: fix `getpid()` use for Windows UWP: ``` tests\server\util.c(281,21): warning C4013: 'getpid' undefined; assuming extern returning int ``` Ref: https://github.com/curl/curl/actions/runs/12061215311/job/33632904249#step:11:38 - src/tool_doswin: disable `GetLoadedModulePaths()` for UWP. mingw-w64 UWP was okay with this, but MS SDK headers are not. This makes `--dump-module-paths` return empty for UWP builds. ``` src\tool_doswin.c(620,3): error C2065: 'MODULEENTRY32': undeclared identifier src\tool_doswin.c(626,11): warning C4013: 'CreateToolhelp32Snapshot' undefined; assuming extern returning int src\tool_doswin.c(626,36): error C2065: 'TH32CS_SNAPMODULE': undeclared identifier src\tool_doswin.c(632,7): warning C4013: 'Module32First' undefined; assuming extern returning int ``` Ref: https://github.com/curl/curl/actions/runs/12055081933/job/33614629930#step:9:35 - examples: fix `websocket.c` to include `winsock2.h` before `windows.h` to make it build with MSVC UWP: ``` include\curl\curl.h(143,16): error C2061: syntax error: identifier 'curl_socket_t' include\curl\curl.h(143,16): error C2059: syntax error: ';' include\curl\curl.h(417,52): error C2146: syntax error: missing ')' before identifier 'curlfd' include\curl\curl.h(417,38): error C2081: 'curl_socket_t': name in formal parameter list illegal ``` Ref: https://github.com/curl/curl/actions/runs/12055317910/job/33615644427#step:14:126 - GHA/windows: silence linker warning with MSVC UWP builds: ``` LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification ``` Ref: https://github.com/curl/curl/actions/runs/12055696808/job/33616629610#step:11:38 - GHA/windows: set `/INCREMENTAL:NO` for all MSVC jobs to improve performance a little. - cmake: show `UWP` platform flag. Ref: curl#15652 Closes curl#15657