ci: reinstall libbrotli-dev on Linux test runners#2391
Conversation
The Caddy module tests pull in github.com/dunglas/caddy-cbrotli, which depends on github.com/google/brotli/go/cbrotli and needs the brotli C headers (brotli/encode.h) at build time. The ubuntu-latest image no longer ships them, so the build fails with: fatal error: brotli/encode.h: No such file or directory Install libbrotli-dev before the test step. macOS already has the headers via homebrew, so it does not need a change.
There was a problem hiding this comment.
Pull request overview
This PR fixes CI build failures for the Linux Caddy module test job by ensuring the Brotli C development headers are present on ubuntu-latest, which is required by github.com/google/brotli/go/cbrotli (pulled in via the caddy/ module dependencies).
Changes:
- Add an
apt-get installstep forlibbrotli-devin the Linux test workflow before building/testing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The apt-get step was a no-op (libbrotli-dev already installed on the runner: 1.1.0-2build2), yet the cgo build still fails to find brotli/decode.h. Swap in a diagnostic step that prints what the runner actually has: dpkg state, header files on disk, .pc files, pkg-config output, and gcc default include search path. The next CI run will tell us why the headers aren't reachable.
The Caddy module tests fail at compile time:
fatal error: brotli/decode.h: No such file or directory
Diagnostics on the ubuntu-latest runner show libbrotli-dev (1.1.0-2build2)
listed as installed by dpkg, but its files are missing from disk:
ls /usr/include/brotli/
ls: cannot access '/usr/include/brotli/': No such file or directory
find /usr -name 'libbrotli*.pc'
/usr/share/miniconda/lib/pkgconfig/libbrotli{common,dec,enc}.pc
(system /usr/lib/x86_64-linux-gnu/pkgconfig/libbrotli*.pc absent)
pkg-config --cflags libbrotlicommon libbrotlidec libbrotlienc
Package libbrotlicommon was not found in the pkg-config search path.
A plain 'apt-get install libbrotli-dev' is a no-op because dpkg believes
the package is current. --reinstall forces apt to re-extract the files
so cgo can resolve the cbrotli pkg-config dependency.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
henderkes
left a comment
There was a problem hiding this comment.
Completely forgot to create an individual PR after fixing it in the fork one.
Removed comments explaining the workaround for libbrotli-dev installation. Signed-off-by: Kévin Dunglas <kevin@dunglas.fr>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The Linux Caddy module tests fail at compile time:
caddy/pulls ingithub.com/dunglas/caddy-cbrotli, which depends ongithub.com/google/brotli/go/cbrotliand uses// #cgo pkg-config: libbrotlicommon libbrotlidec libbrotlienc.Root cause
The
ubuntu-latestrunner (noble, imageubuntu24/2026..*) listslibbrotli-dev 1.1.0-2build2as installed in dpkg, but the package's files are missing on disk. Diagnostics from a CI run on this branch:A plain
apt-get install -y libbrotli-devis a no-op because dpkg believes the package is current.--reinstallforces apt to re-extract the files so cgo's pkg-config invocation succeeds and gcc can resolve<brotli/decode.h>.Reproduces on PR-2365 https://github.com/php/frankenphp/actions/runs/25315574252/job/74212221237 and on every recent main run, e.g. https://github.com/php/frankenphp/actions/runs/25286789334.