Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcups2 of CUPS 2.5.x has incompatible API changes #802

Closed
tillkamppeter opened this issue Oct 18, 2023 · 4 comments
Closed

libcups2 of CUPS 2.5.x has incompatible API changes #802

tillkamppeter opened this issue Oct 18, 2023 · 4 comments
Assignees
Labels
question General usage question

Comments

@tillkamppeter
Copy link
Member

Describe the bug
In the libcups2 of CUPS 2.5.x API elements have en removed which existed in libcups2 of CUPS 2.4.x and earlier. The removed elements probably got deprecated and replacement for them added earlier, but they should stay in until the next soname bump (which is already near, libcups3 is already under development).

For example cupsArrayNew(NULL, NULL) does not work any more and needs to get replaced by cupsArrayNew3(NULL, NULL, 0, 0, 0, 0).

To Reproduce
Build libcupsfilters 2.0.0 with CUPS 2.4.7 installed and with 2.5b1 (GIT master) installed. In the latter case the build fails.

Expected behavior
What was building with libcups2 of CUPS 2.4.x builds also with libcups2 of CUPS 2.5.x.

System Information:

  • Ubuntu 23.10 Mantic, Snap building of ps-printer-app and others.
@michaelrsweet
Copy link
Member

Code compiled against libcups2 will continue to run, it is just the deprecation that may be interfering with your compile.

What compiler and options are you using?

@michaelrsweet michaelrsweet self-assigned this Oct 18, 2023
@michaelrsweet michaelrsweet added the investigating Investigating the issue label Oct 18, 2023
@tillkamppeter
Copy link
Member Author

The error happens when snapping ps-printer-app, the snapcraft.yaml takes the GIT master of CUPS and therefore uses libcups2 of CUPS 2.5.x.

ps-printer-app-snapcraft-20231018-1.log.txt

The error is near the end of he log file when building the libcupsfilters part:

error: ‘HTTP_URI_OK’ undeclared (first use in this function); did you mean ‘HTTP_TRUST_OK’?

All the rest seem to be warnings, not errors, so it seems that this PR is also weeding out the warnings and not just fixing the error:

OpenPrinting/libcupsfilters#36

By the way, the compiler is gcc, whatever version came with Ubuntu 22.04 LTS (version on which the Snap build is based) ...

@michaelrsweet
Copy link
Member

OK, so it looks like this code is using pre-2.0 enum constants - HTTP_URI_OK should be HTTP_URI_STATUS_OK. The old names have been deprecated since CUPS 2.0 and I removed them for 2.5 since they don't affect binary compatibility...

@tillkamppeter
Copy link
Member Author

OK, replacing all occurrences of HTTP_URI_OK by HTTP_URI_STATUS_OK makes libcupsfilters in the Snap build, there are many deprecation warnings but it builds. Thank you very much.

@michaelrsweet michaelrsweet added question General usage question and removed investigating Investigating the issue labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General usage question
Projects
None yet
Development

No branches or pull requests

2 participants