ci: install libfreetype-dev / libfontconfig1-dev for skia-safe link

Linux `cargo test --workspace` failed at link time:
  /usr/bin/ld: cannot find -lfreetype: No such file or directory
  /usr/bin/ld: cannot find -lfontconfig: No such file or directory
  collect2: error: ld returned 1 exit status

skia-safe 0.97 (P0 probe transient dev-dep) links against the system
freetype + fontconfig on Linux. The GitHub-hosted ubuntu-latest runner
ships only the runtime libs; we need the `-dev` packages so `cc` can
resolve `-lfreetype` / `-lfontconfig` during link.

macOS and Windows do not link against these (skia-bindings uses
CoreText / DirectWrite respectively), so the install step stays
gated on `runner.os == 'Linux'`.
This commit is contained in:
Kayshen-X 2026-05-05 12:23:06 +08:00
parent 8901767c0e
commit 568f74ba15

View file

@ -38,7 +38,9 @@ jobs:
# Linux GL prerequisites for the P0 probe ignored test step. xvfb gives
# winit a virtual display; mesa software-rasterizes GL when no GPU is
# available; libxkbcommon-x11-dev / libwayland-dev are winit's link-time
# dependencies on Linux. (No-op on macOS / Windows runners.)
# dependencies on Linux; libfreetype-dev / libfontconfig1-dev are
# skia-bindings' link-time dependencies on Linux (skia-safe v0.97 links
# against the system freetype + fontconfig). (No-op on macOS / Windows.)
- name: Install Linux GL prereqs (P0 probe gate)
if: runner.os == 'Linux'
run: |
@ -47,7 +49,8 @@ jobs:
xvfb \
libgl1-mesa-dri libglu1-mesa libegl1 libgles2 \
libxkbcommon-dev libxkbcommon-x11-dev \
libwayland-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
libwayland-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
libfreetype-dev libfontconfig1-dev
- run: cargo fmt --all -- --check
- run: cargo build --workspace
- run: cargo test --workspace