After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 101221 - Perl errors with gtkdoc-fixxref
Perl errors with gtkdoc-fixxref
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
0.10
Other Linux
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2002-12-14 21:13 UTC by Anders Carlsson
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
"use bytes" in fixxref, and require perl-5.6 (2.57 KB, patch)
2002-12-16 14:42 UTC, James Henstridge
none Details | Review

Description Anders Carlsson 2002-12-14 21:13:46 UTC
When building glib and gtk+ I get:

Malformed UTF-8 character (unexpected continuation byte 0xa0, with no
preceding start byte) in substitution iterator at
/home/andersca/gnome/bin/gtkdoc-fixxref

According to Owen this is because James switched the output docs back from
UTF-8 to iso-8859-1, but Perl assumes UTF-8 in the most recent vesions.
Comment 1 James Henstridge 2002-12-15 05:12:12 UTC
I have seen this sort of problem with other programs when using Perl
5.8 and utf-8 locales.  SpamAssassin is one such program that runs
into this.  It is possible to work around the problem by setting
LANG=C, but I am not sure what the real solution is (we really just
want the data passed to the regex to be treated as byte strings,
rather than multibyte utf-8).
Comment 2 James Henstridge 2002-12-15 05:27:51 UTC
The perl documentation seems to suggest that adding the following
pragma  should get rid of the problem:
  use bytes;

This seems to be the same fix the spamassassin people are doing (well,
they are actually using 'eval "use bytes";', so that it works with old
versions).

We would run into the same problems if we were using UTF-8 docs and a
user had a locale with a charset such that UTF-8 data was invalid.
Comment 3 Owen Taylor 2002-12-15 17:20:12 UTC
I'm pretty sure (and testing confirms) that eval "use bytes";
doesn't work ... 'use bytes' is lexically scoped and 
eval sets up a new scope.

What seems to work is:

BEGIN {
    eval { require "bytes.pm" };
    &bytes::import() unless $@;
}

Which is basically 'use bytes' unfolded and with an error trap
around the part that might fail.

The alternative seems to be to just require perl 5.6.0 for
gtk-doc. Which wouldn't be ridiculous for a developer tool;
For timescale ... perl 5.6.0 shipped with Red Hat 7 over 
2 years ago now.


perl -e 'require v5.6.0;' > /dev/null 2>&1 && echo yes
Comment 4 James Henstridge 2002-12-16 06:39:26 UTC
Requiring Perl 5.6 might be the best idea.  IIRC, the last systems I
have with Perl < 5.6.0 are a few RH6.2 systems, and I don't use them
for development.

As this dep only affects the developer (possibly also people compiling
from source if a package doesn't disable docs rebuild by default), we
may as well make it a hard dependency.  They used similar logic for
requiring a 2.5x version of autoconf for the latest libtool release
(ie. if they aren't going to upgrade to a perl released in the last
few years, are they really going to upgrade gtk-doc?)

I wouldn't mind hearing Damon's or Matthias's opinion though.
Comment 5 Matthias Clasen 2002-12-16 07:41:55 UTC
I'm all for it.
Comment 6 James Henstridge 2002-12-16 14:42:58 UTC
Created attachment 13033 [details] [review]
"use bytes" in fixxref, and require perl-5.6
Comment 7 Owen Taylor 2002-12-16 16:12:46 UTC
Thinking about it a bit more, requiring 5.6 makes a lot of
sense; the chance that we can keep gtk-doc working with
older versions of Perl when none of people who hack on it
use the older versions is slight, so we'd only be pretending
to allow them.

Only suggestion for the patch is in:

 +if "$PERL" -e "require v5.6.0"; then

to redirect stderr to /dev/null to prevent unsightly spew.

if "$PERL" -e "require v5.6.0" > /dev/null 2>&1 ; then
 
Yeah... it's about to die with an error anyways, but it's
good autoconf hygiene.
Comment 8 James Henstridge 2002-12-17 15:57:10 UTC
checked in