New issue
Advanced search Search tips

Issue 896335 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature

Blocked on:
issue 881592



Sign in to add a comment

ghostscript: slim down driver selection?

Project Member Reported by briannorris@chromium.org, Oct 17

Issue description

Random question: do we know how many of Ghostscript's are really used in CrOS? I see that today, we just build with --drivers=ALL, and if I just restrict that to --drivers=PS I save >5MB in libgs.so.* alone (~12M -> ~5M on Coral). But I don't think that's the extent of the drivers we use, and I don't know about plans to utilize more of those long-term.

For reference:

$ ./configure --help
...
  --with-drivers=LIST     Drivers to support, separated by commas.
                          Either list the drivers or use aliases:
                          ALL      = all drivers
                          FILES    = all file format drivers
                          PRINTERS = all printer drivers
                          Printers:
                          APPLE    = all Apple printers
                          BROTHER  = all Brother printers
                          CANON    = all Canon printers
                          EPSON    = all Epson printers
                          HP       = all HP printers
                          IBM      = all IBM printers
                          JAPAN    = older japanese printers
                          LEXMARK  = all Lexmark printers
                          OKI      = all OKI printers
                          PCLXL    = all PCL XL/6 printers
                          File formats:
                          BMP      = Output to bmp files
                          FAX      = Output to fax files
                          JPEG     = Output to JPEG files
                          PBM      = Output to PBM/PNM
                          PCX      = Output to PCX
                          PNG      = Output to PNG
                          PS       = Output to PostScript/PDF
                          TIFF     = Output to TIFF
                          You can mix both variants, e.g.
                          --with-drivers=HP,stcolor would build HP drivers and
                          the Epson stcolor driver.
                          Aliases must be uppercase (a 3rd party driver might
                          have the same name).
                          Default: ALL

I ask, partly because of bugs like bug 888744. But if this is a significant maintenance burden (e.g., we want to allow any of these through custom PPDs, etc.), perhaps it's not worth poking too hard at (and I'd be satisfied with a WontFix).
 
Cc: pawliczek@chromium.org
Status: Available (was: Untriaged)
We can evaluate putting gs on a diet.  We shouldn't need most of the file formats...  We can test across our PPD library now so we can start trying to remove drivers to see what we do/don't need.  Not sure what we can save as we definitely need more than PS.  Lots of filters call GhostScript.
IF gs is used only by CUPS filters (PPD files) && this option can accept list of drivers THEN
I can get a list of used gs drivers from logs created by platform_PrinterPpds and then I can try to set is as a value of parameter --with-drivers= for ./configure.
I can try to do this when gs-9.25 will be eventually merged.
Blockedon: 881592
Cc: skau@chromium.org
Labels: M-72 OS-iOS
Owner: pawliczek@chromium.org
Status: Assigned (was: Available)
That's a great idea actually.  Please do that!  If you write a script to parse through the logs, we should find somewhere to keep it.
Labels: -OS-iOS
Status: Fixed (was: Assigned)
Aren't we waiting for the CL to land still?
Status: Assigned (was: Fixed)
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/d0bdd222ca6fae6d07b658e5f2a49d80a29f061e

commit d0bdd222ca6fae6d07b658e5f2a49d80a29f061e
Author: Piotr Pawliczek <pawliczek@chromium.org>
Date: Sat Oct 27 00:19:01 2018

ghostscript: Limit the number of drivers compiled in

Ghostscript includes many optional drivers (devices) compiled in. To decrease
the size of ghostscript binaries we want to limit the number of these drivers.
This patch changes a value of --with-drivers parameter passed to ./configure
script from "ALL" to comma-separated list of drivers used by CUPS/PPD files.
The list was built basing on output from platform_PrinterPpds autotest. See
the readme.txt file in the autotest directory to learn how to build this kind
of list.

BUG= chromium:896335 
TEST=Tested on nautilus and veyron_minnie

Change-Id: I151ca087c39817b5c27f05bdebea56572dd821f1
Reviewed-on: https://chromium-review.googlesource.com/1292530
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Piotr Pawliczek <pawliczek@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[rename] https://crrev.com/d0bdd222ca6fae6d07b658e5f2a49d80a29f061e/app-text/ghostscript-gpl/ghostscript-gpl-9.25-r2.ebuild
[modify] https://crrev.com/d0bdd222ca6fae6d07b658e5f2a49d80a29f061e/app-text/ghostscript-gpl/ghostscript-gpl-9.25.ebuild

Status: Fixed (was: Assigned)

Sign in to add a comment