bugGNU roff - Bugs: bug #44891, gropdf use of Compress::Zlib is...

 
 

bug #44891: gropdf use of Compress::Zlib is not documented as a dependency

Submitter:  Peter Bray <illumino>
Submitted:  Tue 21 Apr 2015 08:13:58 AM UTC
   
 
Category:  Driver gropdf Severity:  3 - Normal
Item Group:  Crash/Unresponsive Status:  Fixed
Privacy:  Public Assigned to:  deri
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 25 Jul 2020 07:28:38 AM UTC, comment #5: 

This was fixed in commit cc4e05054c93177b0574154cc78af06a1b4cc7a6 back on 2015-04-22 and released in groff 1.22.4.

G. Branden Robinson <gbranden>
Group administrator
Thu 23 Apr 2015 02:03:05 AM UTC, comment #4: 

Deri,

  Looks good. Below is a single example of the code in action, from a system that does not have (first example) and has (second
example) the Compress::Zlib module.

Many Thanks,
Peter

Solaris10Update8 % gmake ./contrib/mom/examples/letter.pdf
LC_ALL=C GROFF_COMMAND_PREFIX= GROFF_BIN_PATH="/tmp/64-bit/groff-1.22.3" PDFMOM_BIN_PATH="." /tmp/64-bit/groff-1.22.3/pdfmom -F/tmp/64-bit/groff-1.22.3/font -F/tmp/64-bit/groff-1.22.3/font -M/tmp/64-bit/groff-1.22.3/tmac -M/tmp/64-bit/groff-1.22.3/tmac -M./contrib/mom -M./contrib/mom -k contrib/mom/examples/letter.mom >contrib/mom/examples/letter.pdf
Perl module Compress::Zlib not available - cannot compress this pdf

Solaris11Update2 % gmake ./contrib/mom/examples/letter.pdf
LC_ALL=C GROFF_COMMAND_PREFIX= GROFF_BIN_PATH="/tmp/64-bit/groff-1.22.3" PDFMOM_BIN_PATH="." /tmp/64-bit/groff-1.22.3/pdfmom -F/tmp/64-bit/groff-1.22.3/font -F/tmp/64-bit/groff-1.22.3/font -M/tmp/64-bit/groff-1.22.3/tmac -M/tmp/64-bit/groff-1.22.3/tmac -M./contrib/mom -M./contrib/mom -k contrib/mom/examples/letter.mom >contrib/mom/examples/letter.pdf


Peter Bray <illumino>
Wed 22 Apr 2015 02:39:05 PM UTC, comment #3: 

I have pushed a fix to git please can you test on Solaris.

Deri James <deri>
Group Member
Wed 22 Apr 2015 10:53:03 AM UTC, comment #2: 

Gropdf uses Zlib in two places, once when writing a "stream", and again when reading a stream (happens when you insert a graphic which is a pdf file). In both cases I don't think it is absolutely necessary, if you use the -d flag pdfs are not compressed anyway, and on reading pdfs if a different compression other than deflate is used then it just leaves it alone and passes it "as is" to the writer.

So I will make a change which checks for Compress::Zlib and if not found outputs a suitable warning to stderr but continues to produce an uncompressed pdf as if the -d flag was set.

Deri James <deri>
Group Member
Wed 22 Apr 2015 05:32:39 AM UTC, comment #1: 

Given that Perl 5.10 appeared in 2007, requesting this version would be simplest.  However, I'm not sure whether we can expect this to be available on older hosts...

Making gropdf use Compress::Zlib only if it is available (and emitting a big fat warning otherwise) is probably the way to go.

Deri?

Werner LEMBERG <wl>
Group administrator
Tue 21 Apr 2015 08:13:58 AM UTC, original submission:  

Greetings,

The build process of groff (git@2015-04-10) continues over the failure
of the invocation of `gropdf' command which was started by `pdfmom'
for the building of PDF files for the "contrib/mom/examples" directory
in the source tree, and thus the following files in the installation
are missing:

  <prefix>/share/doc/groff-1.22.3/examples/mom/letter.pdf
  <prefix>/share/doc/groff-1.22.3/examples/mom/mom-pdf.pdf
  <prefix>/share/doc/groff-1.22.3/examples/mom/mon_premier_doc.pdf
  <prefix>/share/doc/groff-1.22.3/examples/mom/sample_docs.pdf
  <prefix>/share/doc/groff-1.22.3/examples/mom/typesetting.pdf

And, of course, the installed `gropdf' command will not function until
the dependency is meet.

The `m4/groff.m4' file uses "PERLVERSION=v5.6.1" in a test for the
perl version number, which succeeds on Solaris 10 Update 8, but this
version of perl does not include Compress::Zlib.

According to corelist(1) the first official release of perl to include
Compress::Zlib was 5.10.0 (as 5.9.x was a development branch)

% corelist Compress::Zlib
Compress::Zlib was first released with perl 5.009003

Multiple solutions exist, including:

  * Update the documentation and mention the requirement for the perl
    module Compress::Zlib, stating that for users of perl 5.10.0 and
    later, that this module is present in the perl core distribution.

  * Update configure infrastructure to detect that Compress::Zlib is
    missing and disable `gropdf' "compilation" and installation, and
    any dependent targets, such as the PDFs mentioned above. Simple
    would be: "perl -MCompress::Zlib -e 'exit 0;'", see below.

  * Update gropdf to conditionally load Compress::Zlib and only use it,
    when it is available.

The source of the `gropdf' command is src/devices/gropdf/gropdf.pl

Regards,
Peter Bray
Sydney, Australia

The command "gmake ./contrib/mom/examples/mon_premier_doc.pdf" on a
system without Compress::Zlib, produces the following:

LC_ALL=C GROFF_COMMAND_PREFIX= GROFF_BIN_PATH="/tmp/64-bit/groff-1.22.3" PDFMOM_BIN_PATH="." /tmp/64-bit/groff-1.22.3/pdfmom -F/tmp/64-bit/groff-1.22.3/font -F/tmp/64-bit/groff-1.22.3/font -M/tmp/64-bit/groff-1.22.3/tmac -M/tmp/64-bit/groff-1.22.3/tmac -M./contrib/mom -M./contrib/mom -k contrib/mom/examples/mon_premier_doc.mom >contrib/mom/examples/mon_premier_doc.pdf
contrib/mom/examples/mon_premier_doc.mom:12: can't translate character code 233 to special character `'e' in transparent throughput
contrib/mom/examples/mon_premier_doc.mom:27: can't translate character code 233 to special character `'e' in transparent throughput
Undefined subroutine &Compress::Zlib::compress called at /tmp/64-bit/groff-1.22.3/gropdf line 1897, <> line 105.

Fortunately, perl gives an exit status of 2 when it can not load a module.
Add '2>/dev/null' to silence the actual error message.

Solaris10u8% perl -MCompress::Zlib -e 'exit 0;' ; \
  [ $? -eq 2 ] && echo Missing Compress::Zlib

Can't locate Compress/Zlib.pm in @INC (@INC contains: /pkgs/64-bit/lib/perl /pkgs/lib/perl /usr/perl5/5.8.4/lib/i86pc-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .).
BEGIN failed--compilation aborted.
Missing Compress::Zlib

Solaris11.2% perl -MCompress::Zlib -e 'exit 0;' ; \
  [ $? -eq 2 ] && echo Missing Compress::Zlib


Peter Bray <illumino>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by deri (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by illumino (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-25 gbranden CategoryNone Driver gropdf
        StatusNone Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.22.4
    2015-04-22 wl Assigned toNone deri

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code