Skip to content

GHA: minimize installed packages in http3-linux and Windows cross-builds - #18509

Closed
vszakats wants to merge 22 commits into
curl:masterfrom
vszakats:ghaexp
Closed

vszakats wants to merge 22 commits into
curl:masterfrom
vszakats:ghaexp

Conversation

@vszakats

@vszakats vszakats commented Sep 10, 2025 •

Copy link
Copy Markdown
Member

In the last couple of months some jobs started taking a lot of time and
often timing out due to slow apt install from the Azure Ubuntu mirror.

The jobs affected were those that installed large packages:
GHA/http3-linux and the 3 cross-build jobs in GHA/windows.

This patch reduces the installed packaged to the minimum required
to complete the jobs. Saving a minute+ for each http3-linux job (a total
of 20+ minutes for the workflow.) Also saving bandwidth and reducing
the chance for long downloads or timeouts with slow Azure repos.

Details:

  • http3: delete redundant packages from the build-cache job.
  • http3: install gnutls dependencies for gnutls jobs only.
  • http3: do not install test dependencies in jobs not running tests.
  • http3: drop redundant packages from the curl jobs.
  • Windows-cross: replace mingw-w64 with gcc-mingw-w64-x86-64-win32
    for the 3 Windows cross-build job. Dropping C++, 32-bit, and 64-bit
    POSIX-threaded parts. Saving time and significant bandwidth for each
    of the 3 jobs:
    Download size: 277 MB -> 65 MB (installed: 1300 MB -> 400 MB)
  • Windows-cross: restore previous job time limit of 15m (from 45m)
    Follow-up to ff5140a GHA/windows: give more time for Ubuntu installs #18163

Before:
https://github.com/curl/curl/actions/runs/17611514207 (http3)
https://github.com/curl/curl/actions/runs/17611514185/job/50034354923 (Windows cross)

After:
https://github.com/curl/curl/actions/runs/17628406362?pr=18509 (http3)
https://github.com/curl/curl/actions/runs/17627562551/job/50088055529?pr=18509 (Windows cross)

http3 job Bef. Aft.
Build caches (hot) 10s 12s
AM awslc 3m 0s 1m 54s
CM awslc 4m 32s 3m 4s
AM boringssl 3m 9s 1m 48s
CM boringssl 3m 43s 3m 2s
AM gnutls 3m 9s 2m 18s
CM gnutls 4m 19s 2m 55s
AM libressl 2m 14s 1m 24s
CM libressl 5m 30s 2m 57s
AM openssl 5m 16s 4m 17s
CM openssl 1m 50s 1m 47s
AM openssl-quic 2m 58s 1m 7s
CM openssl-quic 4m 16s 2m 43s
AM quiche 2m 54s 1m 34s
CM quiche 5m 0s 3m 15s
AM quictls 2m 34s 1m 13s
CM quictls 4m 20s 3m 17s
AM wolfssl 2m 48s 1m 30s
CM wolfssl 4m 49s 3m 22s
Total: 66m 21s 43m 27s
Gain: 22m 54s

Out of curiousity, build times as seen in the http3 build-cache job:

A similar effort in curl-for-win, affecting 2 GHA/curl-for-win Windows
jobs (though they use the default Debian repo, with no issues):

Bug: #18502 (comment)


I've found the GnuTLS build a scary monster, complex, slow, with many warnings, including null derefs, odd dependencies (bison), slow checkouts (amongst them: openssl!) and an insecure source code URL in bootstrap.

@vszakats vszakats added performance CI Continuous Integration labels Sep 10, 2025
@vszakats vszakats changed the title GHA/http3-linux: try reducing installed packages GHA: try reducing installed packages (Windows cross, http3) Sep 10, 2025
@vszakats

vszakats commented Sep 10, 2025 •

Copy link
Copy Markdown
Member Author

Apple clang crash:

tests/libtest/CMakeFiles/libtests.dir/libtests.c.o.d -o tests/libtest/CMakeFiles/libtests.dir/libtests.c.o -c /Users/runner/work/curl/curl/bld/tests/libtest/libtests.c
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple clang version 17.0.0 (clang-1700.0.13.5)
Target: aarch64e-apple-darwin24.5.0
Thread model: posix
InstalledDir: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/x7/ch5v91h56_zbvbd1y2f600dm0000gn/T/libtests-616ec8.c
clang: note: diagnostic msg: /var/folders/x7/ch5v91h56_zbvbd1y2f600dm0000gn/T/libtests-616ec8.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/runner/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg: 

********************

https://github.com/curl/curl/actions/runs/17609591132/job/50028196506?pr=18509

Image: macos-15-arm64
  Version: 20250908.2304
  Included Software: https://github.com/actions/runner-images/blob/macos-15-arm64/20250908.2304/images/macos/macos-15-arm64-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macos-15-arm64%2F20250908.2304

edit: libtests.c is around 1MB of C code.

@vszakats

vszakats commented Sep 10, 2025 •

Copy link
Copy Markdown
Member Author

@vszakats

vszakats commented Sep 10, 2025 •

Copy link
Copy Markdown
Member Author

Flakiness caused by the cmake built-in download feature (ExternalProject_Add() / URL) failing on first failed try:
https://github.com/curl/curl/actions/runs/17613067461/job/50039390879?pr=18509

4/48] Performing download step (download, verify and extract) for 'zlib_external'
FAILED: [code=1] zlib/src/zlib_external-stamp/zlib_external-download /home/runner/work/curl/curl/build/zlib/src/zlib_external-stamp/zlib_external-download 
cd /home/runner/work/curl/curl/build/zlib/src && /usr/local/bin/cmake -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P /home/runner/work/curl/curl/build/zlib/src/zlib_external-stamp/download-zlib_external.cmake && /usr/local/bin/cmake -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P /home/runner/work/curl/curl/build/zlib/src/zlib_external-stamp/verify-zlib_external.cmake && /usr/local/bin/cmake -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P /home/runner/work/curl/curl/build/zlib/src/zlib_external-stamp/extract-zlib_external.cmake && /usr/local/bin/cmake -E touch /home/runner/work/curl/curl/build/zlib/src/zlib_external-stamp/zlib_external-download
-- Downloading...
   dst='/home/runner/work/curl/curl/build/zlib/src/zlib-1.3.1.tar.xz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://zlib.net/zlib-1.3.1.tar.xz'
CMake Error at zlib_external-stamp/download-zlib_external.cmake:163 (message):
  Each download failed!

    error: downloading 'https://zlib.net/zlib-1.3.1.tar.xz' failed
          status_code: 22
          status_string: "HTTP response code said error"
          log:
          --- LOG BEGIN ---
          timeout on name lookup is not supported

  Host zlib.net:443 was resolved.

https://github.com/curl/curl-fuzzer/blob/83316b4120797543cf7b704d70abebcefd31aeff/CMakeLists.txt#L12-L29

@jay

jay commented Sep 10, 2025

Copy link
Copy Markdown
Member

Saving a minute or more for each http3-linux job. Also greatly reducing
the necessary apt packages and thus mitigating the Azure Ubuntu
mirror issues experienced in these jobs in the last 1.5 months.

Is there an open ticket for the CI mirror issues or should we report it? In my opinion this is not our problem but I have no objection.

@vszakats

vszakats commented Sep 10, 2025 •

Copy link
Copy Markdown
Member Author

Saving a minute or more for each http3-linux job. Also greatly reducing
the necessary apt packages and thus mitigating the Azure Ubuntu
mirror issues experienced in these jobs in the last 1.5 months.

Is there an open ticket for the CI mirror issues or should we report it? In my opinion this is not our problem but I have no objection.

I haven't checked, and I'm not even sure where to start looking. It's odd that
it's been ongoing for almost 2 months now, so it either doesn't affect many
users or it's a difficult fix.

Since it affected curl jobs where we install large packages, I looked at those
and found quite a bit of accidental waste. Specifically in http3-linux, windows
cross-builds, and curl-for-win Windows builds (these use the default Debian
repo, not Azure).

The results are good, saving 20+ minutes estimated, and a lot of bandwidth.

I'm still looking into eliminating the C++ toolchain for curl-for-win builds.
(submitted patches to nghttp3 and ngtcp2, and had to apply not yet released
patches to zstd). Still need to test the quiche build, and minimizing the deps
of TLS backend builds.

After these changes I believe we'll much less need to worry about Azure
mirror performance.

@vszakats
vszakats marked this pull request as draft September 10, 2025 19:38
@vszakats vszakats changed the title GHA: try reducing installed packages (Windows cross, http3) GHA: minimize installed packages in http3-linux and Windows cross-builds Sep 10, 2025
@vszakats
vszakats marked this pull request as ready for review September 10, 2025 21:50
no speed gain, and it's fine to build standalone, ng libs
don't depend on it.
@vszakats vszakats closed this in 0455d87 Sep 11, 2025
@vszakats
vszakats deleted the ghaexp branch September 11, 2025 01:08
vszakats added a commit that referenced this pull request Sep 11, 2025
- explicitly install `libldap-dev` to not rely on test-specific packages
  installing it implicitly, to have the same `curl -V` output for each
  TLS backend build pair.
  Follow-up to 0455d87 #18509

- install `libev-dev` for tests. It's a runtime dependency for
  the local build of `nghttpx`. Missing it made pytest skip 178 tests.
  Also skewing the 'Gain' time. I estimate it to account for 3 minutes,
  making the total gain ~20 minutes.
  Follow-up to 0455d87 #18509
  (It may be a better solution to disable libev for the local nghttp2
  build, to avoid this hidden dependency.)

- fix quiche jobs to use the local build of `libnghttp2`.

- stop installing the `clang` package for Windows-cross. `clang` and
  `clang-tidy` tools are preinstalled on the Ubuntu 24.04 runner.

Closes #18519
vszakats added a commit that referenced this pull request Sep 11, 2025
- fix `nghttp2` build to also build the `nghttpx` application.
  Restore required `libc-ares-dev`. Also confirm that `libev-dev` is
  required too. Document these requirements.
  Follow-up to 0455d87 #18509

- explicitly enable `nghttpx` for the `nghttp2` build to make it fail if
  requirements aren't met:
  ```
  configure: error: applications were requested (--enable-app) but dependencies are not met.
  ```

- explicitly install brotli, zstd, zlib for the dependency builds.
  Of these, zstd and zlib are preinstalled. zlib is required for
  `nghttpx`. zstd and brotli doesn't seem to be used, but keep them
  there just in case and to match the test env.
  Follow-up to 0455d87 #18509

- enable brotli for `nghttpx`. It doesn't change the tests, and also
  cost almost nothing, so I figure why not.

Closes #18522
vszakats added a commit to vszakats/curl that referenced this pull request Oct 6, 2025
vszakats added a commit that referenced this pull request Oct 6, 2025
vszakats added a commit that referenced this pull request Mar 26, 2026
It's been going on for almost a year, chances seem slim to have this
fixed upstream.

The observed issue is that on GitHub-supplied CI runner images,
sometimes, `apt-get install` using the stock distro server
`http://azure.archive.ubuntu.com/ubuntu` sees extreme slowness while
downloading data, then reaching the job timeout and aborting, making CI
red and necessitating a manual restart of the failed job(s).

In majority of cases the install step takes no longer than 8-40 seconds
(download + install), while in the failing case it takes 10-20+ minutes
just to download.

Earlier I slimmed down installs to avoid unnecessary packages, which
mitigated, but did not completely fix the issue.

Example:
https://github.com/curl/curl/actions/runs/23599596928/job/68725576899?pr=21105

Follow-up to 0455d87 #18509

Closes #21107
vszakats added a commit to vszakats/curl that referenced this pull request Apr 14, 2026
It seems like a dud runner with a slow connection to Microsoft Azure
Ubuntu distro servers cannot be fixed by restarting the network stack
and apt-get operation.

Follow-up to 5172ba5 curl#21107
Follow-up to a583884 curl#21181
Follow-up to 0455d87 curl#18509
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
It's been going on for almost a year, chances seem slim to have this
fixed upstream.

The observed issue is that on GitHub-supplied CI runner images,
sometimes, `apt-get install` using the stock distro server
`http://azure.archive.ubuntu.com/ubuntu` sees extreme slowness while
downloading data, then reaching the job timeout and aborting, making CI
red and necessitating a manual restart of the failed job(s).

In majority of cases the install step takes no longer than 8-40 seconds
(download + install), while in the failing case it takes 10-20+ minutes
just to download.

Earlier I slimmed down installs to avoid unnecessary packages, which
mitigated, but did not completely fix the issue.

Example:
https://github.com/curl/curl/actions/runs/23599596928/job/68725576899?pr=21105

Follow-up to 0455d87 curl#18509

Closes curl#21107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration performance

Development

Successfully merging this pull request may close these issues.

2 participants