Build against CUPS 2.4, 2.5 and 3.x; add 12-combination CI matrix#159
Merged
tillkamppeter merged 6 commits intoJun 18, 2026
Merged
Conversation
…elpers come from libcups
…orm for CUPS 2.x in libcups2-private.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.cshipped its own copies of array/option/stringhelpers that 2.5 now provides natively — with different
int/size_tsignatures and an opaque
struct _cups_array_s— causing type and symbolconflicts. CUPS 2.5 also dropped
cups-config.Changes
CUPS detection (
configure.ac)Prefer
pkg-configfor CUPS: trycups3(libcups3), thencups(CUPS 2.5+,which ships only
cups.pc), and fall back tocups-configfor older CUPS 2.x.No more hard dependency on
cups-config.CUPS-version compatibility (
cupsfilters/ipp-options*.{c,h},libcups2-private.h)cups_media_t,cupsArrayGetElement/First/Next,cupsCopyStringandcupsConcatStringonly on CUPS < 2.5; use CUPS's own on 2.5+ and libcups3.
cupsArrayNew1()defers to the native constructor on 2.5+/libcups3(
cupsArrayNewon libcups3,cupsArrayNew3on CUPS 2.5) instead of reachinginto the now-opaque array struct.
cupsParseOptions()(thelibcups3 name) everywhere, with translation defines in
libcups2-private.h— CUPS 2.5 maps it to the native
cupsParseOptions2(), CUPS 2.4 maps it tothe 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+ thestring/option helpers come from libcups, so the test binaries must link it.
CI (
.github/workflows/build.yaml,ci/ci-setup.sh){x86_64, arm64 (native), armv7, riscv64 (QEMU)}×
{CUPS 2.4 distro, CUPS 2.5 source, libcups3 source}.ci/ci-setup.sh(deps / cups /pdfio / build), so the combinations come from a loop rather than duplicated
YAML.
make checkand the downstream DESTDIR autopkgtest suite.consumers linking only
-lcupsfiltersresolve CUPS symbols at link time.Testing
All 12 combinations are green —
make check(7 pass + 1 expected XFAIL onsource/emulated CUPS, or 8 pass on distro CUPS) and autopkgtest (
2/2:libcupsfilters-2-dev+libcupsfilters-2-functionality) on every leg.Notes
CUPS_VERSION_MAJORtypo,$(CUPS_CFLAGS)on tests,
@CUPS_CFLAGS@in the.pc) landed earlier as a separate PR; thisbranch builds on top of them.
test-pclm-overflow.sh, whose helper compile assumesCUPS headers in the default path — only true for the distro package, so it's
marked XFAIL for source/emulated CUPS.