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

 
 

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

Submitted by:  Peter Bray <illumino>
Submitted on:  Tue 21 Apr 2015 08:13:58 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: CrashStatus: None
Privacy: PublicAssigned to: Deri James <deri>
Open/Closed: OpenPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 22 Apr 2015 05:32:39 AM UTCwlAssigned toNone=>deri

    Back to the top


    Powered by Savane 3.1-cleanup1