Rev 18558 fails to build: perl -CI ./utf8-to-roff [patch]
This is on debian sid, perl=5.10.0-9.1
The following error has been occurring for me since Monday
=================================
make[3]: Entering directory `/tmp/buildd/inkscape-0.46+svn20080508-cle.0' set -e; \ d=`sed -n 's,/,-,g;s,.*$[D]ate: (..........).*,\1,p' inkscape.pod`; \ pod2man inkscape.pod \ | sed 's/^.TH .*/.TH INKSCAPE 1 "'"$d"'" "Inkscape-0.46+devel" "Inkscape"/' \ | perl -pe 'if (/^[% .*INCLUDE.*AUTHORS.* %]/) { open(FOO, "./AUTHORS");$_ = join(",\n", map { chomp; $_ } <FOO>) . "\n"; }' \ | perl ./fix-roff-punct \ | perl -CI ./utf8-to-roff \ > tmp.$$ \ && mv -f tmp.$$ inkscape.1 Too late for "-CI" option at ./utf8-to-roff line 1. make[3]: *** [inkscape.1] Error 9 make[3]: Leaving directory `/tmp/buildd/inkscape-0.46+svn20080508-cle.0' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/tmp/buildd/inkscape-0.46+svn20080508-cle.0' make[1]: *** [all] Error 2 make[1]: Leaving directory `/tmp/buildd/inkscape-0.46+svn20080508-cle.0' make: *** [build] Error 2 dpkg-buildpackage: failure: debian/rules build gave error exit status 2 pbuilder: Failed autobuilding of package -> Aborting with an error -> unmounting dev/pts filesystem -> unmounting proc filesystem -> cleaning the build env -> removing directory /var/cache/pbuilder/build//20387 and its subdirectories Command /bin/sh -c pdebuild --buildresult /home/bgray/svn/dbw-svn/inkscape/trunk/../build-area failed in <unknown>, how to continue now? [Qri?]: Aborting.
===============================
$ rgrep "perl -CI" ./ ./Makefile.am: | perl -CI $(srcdir)/utf8-to-roff \ ./utf8-to-roff:# perl -CI -nae 'my ($ch, $seq) = @F; if (ord($ch) >= 128) { printf(" 0x%x, q{%s},\n", ord($ch), $seq); }'
===============================
make is calling it with the -CI switch, and so is the hashbang bit of utf8-to-roff. if you remove it from utf8-to-roff it builds ok
patch:
===============================
--- utf8-to-roff (revision 18558) +++ utf8-to-roff (working copy) @@ -1,4 +1,4 @@ -#! /usr/bin/perl -w -CI +#! /usr/bin/perl -w # Converts a man page from utf8 (not understood by groff 1.18) to groff escapes. # I couldn't find any existing tool to convert from utf8 to groff, though I # seem to recall seeing some code to do so somewhere.
On Thu, May 08, 2008 at 04:34:23PM +1000, Bernard Gray wrote:
This is on debian sid, perl=5.10.0-9.1
The following error has been occurring for me since Monday:
[...] | perl -CI ./utf8-to-roff \ > tmp.$$ \ && mv -f tmp.$$ inkscape.1 Too late for "-CI" option at ./utf8-to-roff line 1.
... make is calling it with the -CI switch, and so is the hashbang bit of utf8-to-roff. if you remove it from utf8-to-roff it builds ok
If utf8-to-roff needs -CI flags, then I'd have thought that utf8-to-roff should keep the -CI flags in its #! line (which perl honours even when not being invoked via the #! mechanism) and removed from the Makefile.
I'll try this now.
pjrm.
On Thu, May 8, 2008 at 4:43 PM, Peter Moulder <Peter.Moulder@...38...> wrote: ...
If utf8-to-roff needs -CI flags, then I'd have thought that utf8-to-roff should keep the -CI flags in its #! line (which perl honours even when not being invoked via the #! mechanism) and removed from the Makefile.
I'll try this now.
pjrm.
yep, I tried that first - no luck.
Bernie
On Thu, May 08, 2008 at 04:43:46PM +1000, Peter Moulder wrote:
If utf8-to-roff needs -CI flags, then I'd have thought that utf8-to-roff should keep the -CI flags in its #! line (which perl honours even when not being invoked via the #! mechanism) and removed from the Makefile.
I'll try this now.
Nope, seems perl (5.8.8 at least) doesn't honour the #! line when not invoked via the #! mechanism after all.
Sigh.
Furthermore, `man perlrun' doesn't obviously point me towards an equivalent statement that I can add to the program to get the same effect.
I'm inclined to call this a bug in the new perl: it shouldn't complain about being too late to apply -CI if -CI has already been applied.
Any perl hackers around? Should we be applying a :utf8 PerlIO layer or something?
pjrm.
On Thu, May 08, 2008 at 04:55:56PM +1000, Peter Moulder wrote:
On Thu, May 08, 2008 at 04:43:46PM +1000, Peter Moulder wrote:
If utf8-to-roff needs -CI flags, then I'd have thought that utf8-to-roff should keep the -CI flags in its #! line (which perl honours even when not being invoked via the #! mechanism) and removed from the Makefile.
I'll try this now.
Nope, seems perl (5.8.8 at least) doesn't honour the #! line when not invoked via the #! mechanism after all.
How about the following hack instead?
Somewhat illegible first line, but it has the desired properties that it can be run with ‘./utf8-to-roff’ or with ‘perl -CI ./utf8-to-roff’.
pjrm.
--- utf8-to-roff (révision 18563) +++ utf8-to-roff (copie de travail) @@ -1,9 +1,11 @@ -#! /usr/bin/perl -w -CI +if (false && ''); then :; else exec perl -CI "$0"; fi # ') {} + # Converts a man page from utf8 (not understood by groff 1.18) to groff escapes. # I couldn't find any existing tool to convert from utf8 to groff, though I # seem to recall seeing some code to do so somewhere. # # Hereby released into public domain by Peter Moulder. +use warnings; use strict;
# Table generated automatically using:
On Thu, May 08, 2008 at 05:30:05PM +1000, Peter Moulder wrote:
+if (false && ''); then :; else exec perl -CI "$0"; fi # ') {}
I'd also add the following documentation:
# The above uses the fact that backslash isn't special in single # quotes in shell script, whereas in perl it escapes the following # single quote. # # The problem it tries to solve is that we want perl to be run with # -CI flag (to have stdin interpreted as utf-8), so we would use # `#! /usr/bin/perl -CI', except that if we do that then perl 5.10 # complains about it being too late to apply -CI if the script is run # with `perl -CI ./utf8-to-roff', as we want to do from the Makefile. # The reason we don't do `./utf8-to-roff' from the makefile is that # then we require the #! line to have the right location of perl # instead of just consulting the path. (Similarly, we could use # `#! /usr/bin/env perl -CI', though that still requires that # /usr/bin/env exist.) The reason we don't just remove the `-CI' # from the #! line is that then the script couldn't be run correctly # with ./utf8-to-roff.
pjrm.
On Thu, May 8, 2008 at 5:30 PM, Peter Moulder <Peter.Moulder@...38...> wrote: ...
How about the following hack instead?
Somewhat illegible first line, but it has the desired properties that it can be run with './utf8-to-roff' or with 'perl -CI ./utf8-to-roff'.
pjrm.
--- utf8-to-roff (révision 18563) +++ utf8-to-roff (copie de travail) @@ -1,9 +1,11 @@
-#! /usr/bin/perl -w -CI +if (false && ''); then :; else exec perl -CI "$0"; fi # ') {}
- # Converts a man page from utf8 (not understood by groff 1.18) to groff escapes. # I couldn't find any existing tool to convert from utf8 to groff, though I # seem to recall seeing some code to do so somewhere. # # Hereby released into public domain by Peter Moulder.
+use warnings; use strict;
# Table generated automatically using:
That built succesfully here - thanks :)
participants (2)
-
Bernard Gray
-
Peter Moulder