New issue
Advanced search Search tips

Issue 622493 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

printing/ uses cups calls that are deprecated with an OS X 10.8 deployment target

Project Member Reported by thakis@chromium.org, Jun 22 2016

Issue description

printing/printing/cups_helper.cc and printing/printing/print_backend_cups.cc use CUPS functions that are deprecated starting in OS X 10.8.


I'm not sure what the plan is here, I think in the past we said "we support CUPS 1.4, and we'll fix those once we drop support for that"?




../../printing/backend/cups_helper.cc:118:7: error: 'cupsMarkOptions' is deprecated: Use cupsCopyDestInfo and friends instead. [-Werror,-Wdeprecated-declarations]
      cupsMarkOptions(*ppd, num_options, options);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/cups/ppd.h:365:13: note: 'cupsMarkOptions' has been explicitly marked deprecated here
extern int              cupsMarkOptions(ppd_file_t *ppd, int num_options,
                        ^
../../printing/backend/cups_helper.cc:128:31: error: 'ppdFindOption' is deprecated: Use cupsCopyDestInfo and friends instead. [-Werror,-Wdeprecated-declarations]
  ppd_option_t* color_model = ppdFindOption(ppd, kColorModel);
                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/cups/ppd.h:383:22: note: 'ppdFindOption' has been explicitly marked deprecated here
extern ppd_option_t     *ppdFindOption(ppd_file_t *ppd, const char *keyword)
                         ^
../../printing/backend/cups_helper.cc:132:7: error: 'ppdFindChoice' is deprecated: Use cupsCopyDestInfo and friends instead. [-Werror,-Wdeprecated-declarations]
  if (ppdFindChoice(color_model, kBlack))
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/cups/ppd.h:378:22: note: 'ppdFindChoice' has been explicitly marked deprecated here
extern ppd_choice_t     *ppdFindChoice(ppd_option_t *o, const char *option)
                         ^

../../printing/backend/cups_helper.cc:156:33: error: 'ppdFindMarkedChoice' is deprecated: Use cupsCopyDestInfo and friends instead. [-Werror,-Wdeprecated-declarations]
  ppd_choice_t* marked_choice = ppdFindMarkedChoice(ppd, kColorModel);
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/cups/ppd.h:380:22: note: 'ppdFindMarkedChoice' has been explicitly marked deprecated here
extern ppd_choice_t     *ppdFindMarkedChoice(ppd_file_t *ppd,
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]



../../printing/backend/print_backend_cups.cc:276:21: error: 'cupsGetPPD' is deprecated: Use cupsCopyDestInfo and friends instead. [-Werror,-Wdeprecated-declarations]
    ppd_file_path = cupsGetPPD(name);
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/cups/cups.h:367:20: note: 'cupsGetPPD' has been explicitly marked deprecated here
extern const char       *cupsGetPPD(const char *name) _PPD_DEPRECATED;
                         ^
../../printing/backend/print_backend_cups.cc:289:21: error: 'cupsGetPPD2' is deprecated: Use cupsCopyDestInfo and friends instead. [-Werror,-Wdeprecated-declarations]
    ppd_file_path = cupsGetPPD2(http.http(), name);
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/cups/cups.h:425:20: note: 'cupsGetPPD2' has been explicitly marked deprecated here
extern const char       *cupsGetPPD2(http_t *http, const char *name) _PPD_DEPRECATED;
                         ^
 
Cc: skau@chromium.org
Components: Internals>Printing
We are planning on bumping it up to 1.5. Is that enough to make Mac happy? We've had the deprecation warnings for a long time with newer CUPS versions, so the warnings should be disabled.

Comment 2 by thakis@chromium.org, Jun 23 2016

https://www.cups.org/documentation.php/doc-2.0/api-cups.html#cupsCopyDestInfo says "CUPS 1.6/OS X 10.8", so 1.5 isn't enough. I'll make sure we disable the warning until we're on 1.6 then I guess.

Comment 3 by skau@chromium.org, Jun 24 2016

CUPS has been trying to remove client PPD support for a while now.  We'll have to disable the warning for the older platforms.  I should have support for the newer versions when we can't bump our minimum version.
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6bbe18d826106ca9b6a96a26b6341ad2899f60d3

commit 6bbe18d826106ca9b6a96a26b6341ad2899f60d3
Author: thakis <thakis@chromium.org>
Date: Fri Jul 01 21:39:13 2016

printing: Adjust deprecation warning flag.

The printing team plans to migrate to newer CUPS APIs once older Linux
versions (which have old CUPS versions) are no longer supported.

With newer OS X deployment targets, the current CUPS APIs are marked
deprecated.  There was already a flag to suppress these warnings, but
it was added only when using a 10.9 SDK, which we haven't used in quite
a while.

(In general, deprecation warnings should be fixed, not suppressed. But
in this case, printing team has a plan for fixing them, and they want
to use one code base for both Linux and macOS.)

BUG=622493

Review-Url: https://codereview.chromium.org/2117903002
Cr-Commit-Position: refs/heads/master@{#403539}

[modify] https://crrev.com/6bbe18d826106ca9b6a96a26b6341ad2899f60d3/printing/BUILD.gn
[modify] https://crrev.com/6bbe18d826106ca9b6a96a26b6341ad2899f60d3/printing/printing.gyp

Blocking: -622481
Now no longer blocking.
Cc: -skau@chromium.org
Owner: skau@chromium.org
Status: Assigned (was: Untriaged)
Cups 2.2 found in macOS 10.12 has moved this functionality from deprecated to removed. Chromium no longer builds in the macOS 10.12 betas.

Comment 8 by skau@chromium.org, Aug 15 2016

I don't have time allocated to tackle this right now, when do we need 10.12 working?

Comment 9 by cos...@gmail.com, Aug 17 2016

I think I have a CL that makes the compile errors go away on OSX 10.12: https://codereview.chromium.org/2248343002


I just got the public OSX 10.12 beta and tried to build Chromium with it. I only got the following CUPS-related errors.

../../printing/backend/print_backend_cups.cc:243:21: error: use of undeclared identifier 'cupsGetPPD'
    ppd_file_path = cupsGetPPD(name);
                    ^
../../printing/backend/print_backend_cups.cc:256:21: error: use of undeclared identifier 'cupsGetPPD2'
    ppd_file_path = cupsGetPPD2(http.http(), name);

My CL makes these errors go away. There are a bunch of other seemingly unrelated errors, so I wasn't able to try out the resulting build quite yet.
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/29c1262dbd4f749dd514d05a571cdd809ba8cfe0

commit 29c1262dbd4f749dd514d05a571cdd809ba8cfe0
Author: pwnall <pwnall@chromium.org>
Date: Wed Aug 17 22:33:25 2016

Fix CUPS compilation error in OSX 10.12.

BUG=622493

Review-Url: https://codereview.chromium.org/2248343002
Cr-Commit-Position: refs/heads/master@{#412670}

[modify] https://crrev.com/29c1262dbd4f749dd514d05a571cdd809ba8cfe0/printing/backend/print_backend_cups.cc

Contrary to comment 7, CUPS has not removed its PPD APIs. They are still in the deprecated state.

Since the minimal Mac deployment target is 10.9 now, Chromium is no longer stuck waiting for support for older Mac versions to be dropped. The challenge now is to switch all the users that expect PPD content to something else.

Comment 12 by skau@chromium.org, Sep 28 2017

tl;dr; Switching away from PPD may not be feasible (if we want to handle the quirks that we currently handle)

So 2016 me didn't quite understand what I understand now.  Different CUPS versions can be very picky about ColorModel values and don't advertise the correct color IPP attributes.  We've patched CUPS in CrOS to handle this but results could be variable on other systems.
Well, maybe not tomorrow, but I think CUPS wants to get away from PPDs some day. When that happens, some version of the Mac SDK won't have cups/ppd.h anymore and then Chromium can't update its Mac SDK and/or bump up its mac_deployment_target.

We don't need to fix this today, but we should start preparing for this. CUPS developers are fairly responsive on their mailing list, so if you have issues with CUPS that they need to fix, it will be good to bring them up. Out of curiousity, what issues did you hit? What version of CUPS is ChromeOS using these days?

Comment 14 by skau@chromium.org, Jan 18 2018

Cc: skau@chromium.org
Owner: ----
Status: Available (was: Assigned)
This seems to have gotten lost in the shuffle.

We don't use PPDs from the Chrome side in ChromeOS, so it should be a drop in replacement.  We're using 2.1.4 in ChromeOS right now.  It's a bit old.  I'd like to try to migrate to 2.3 this year.  We found that there are a few non-standard names for Grey that we needed to add to the PPD for color detection.  So, one concrete bug.  But we're also ignoring a lot of the printer properties since they're not configurable right now.
Project Member

Comment 15 by sheriffbot@chromium.org, Jan 21 (2 days ago)

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 16 by skau@chromium.org, Yesterday (33 hours ago)

Status: Available (was: Untriaged)
This is still relevant but should be rolled out behind a finch flag.

Sign in to add a comment