Skip to content

Build against CUPS 2.4, 2.5 and 3.x; add 12-combination CI matrix#159

Merged
tillkamppeter merged 6 commits into
OpenPrinting:masterfrom
rkt0209:cups-2.5-and-3.x-support
Jun 18, 2026
Merged

Build against CUPS 2.4, 2.5 and 3.x; add 12-combination CI matrix#159
tillkamppeter merged 6 commits into
OpenPrinting:masterfrom
rkt0209:cups-2.5-and-3.x-support

Conversation

@rkt0209

@rkt0209 rkt0209 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes libcupsfilters build and test cleanly against all three current CUPS
APIs — CUPS 2.4.x (libcups2), CUPS 2.5.x (OpenPrinting/cups master) and
3.x (libcups3) — and adds CI that exercises every combination across four
architectures.

Previously the tree built against libcups3 and CUPS 2.4, but CUPS 2.5b1 did
not build
: ipp-options.c shipped its own copies of array/option/string
helpers that 2.5 now provides natively — with different int/size_t
signatures and an opaque struct _cups_array_s — causing type and symbol
conflicts. CUPS 2.5 also dropped cups-config.

Changes

CUPS detection (configure.ac)

Prefer pkg-config for CUPS: try cups3 (libcups3), then cups (CUPS 2.5+,
which ships only cups.pc), and fall back to cups-config for older CUPS 2.x.
No more hard dependency on cups-config.

CUPS-version compatibility (cupsfilters/ipp-options*.{c,h}, libcups2-private.h)

  • Compile the in-tree fallbacks for the array types/struct, cups_media_t,
    cupsArrayGetElement/First/Next, cupsCopyString and cupsConcatString
    only on CUPS < 2.5; use CUPS's own on 2.5+ and libcups3.
  • cupsArrayNew1() defers to the native constructor on 2.5+/libcups3
    (cupsArrayNew on libcups3, cupsArrayNew3 on CUPS 2.5) instead of reaching
    into the now-opaque array struct.
  • Drop the in-tree option parser: the code now calls cupsParseOptions() (the
    libcups3 name) everywhere, with translation defines in libcups2-private.h
    — CUPS 2.5 maps it to the native cupsParseOptions2(), CUPS 2.4 maps it to
    the 3-argument form.

Test programs (Makefile.am)

Link $(CUPS_LIBS) into the test programs (testcmyk, testdither,
testimage, testrgb, testpdf1/2, test-analyze/pdf/ps). On CUPS 2.5+ the
string/option helpers come from libcups, so the test binaries must link it.

CI (.github/workflows/build.yaml, ci/ci-setup.sh)

  • New 12-combination matrix: {x86_64, arm64 (native), armv7, riscv64 (QEMU)}
    × {CUPS 2.4 distro, CUPS 2.5 source, libcups3 source}.
  • All per-combination work lives in ci/ci-setup.sh (deps / cups /
    pdfio / build), so the combinations come from a loop rather than duplicated
    YAML.
  • Each leg runs make check and the downstream DESTDIR autopkgtest suite.
  • Source CUPS 2.5 is installed into the multiarch libdir so downstream
    consumers linking only -lcupsfilters resolve CUPS symbols at link time.

Testing

All 12 combinations are green — make check (7 pass + 1 expected XFAIL on
source/emulated CUPS, or 8 pass on distro CUPS) and autopkgtest (2/2:
libcupsfilters-2-dev + libcupsfilters-2-functionality) on every leg.

Notes

  • The three small build fixes (the CUPS_VERSION_MAJOR typo, $(CUPS_CFLAGS)
    on tests, @CUPS_CFLAGS@ in the .pc) landed earlier as a separate PR; this
    branch builds on top of them.
  • The single XFAIL is test-pclm-overflow.sh, whose helper compile assumes
    CUPS headers in the default path — only true for the distro package, so it's
    marked XFAIL for source/emulated CUPS.

@tillkamppeter tillkamppeter merged commit ff7392c into OpenPrinting:master Jun 18, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants