Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building rakudo fails with PERL_UNICODE=SAL #1989

Closed
p6rt opened this issue Jul 31, 2010 · 10 comments
Closed

building rakudo fails with PERL_UNICODE=SAL #1989

p6rt opened this issue Jul 31, 2010 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 31, 2010

Migrated from rt.perl.org#76856 (status was 'resolved')

Searchable as RT76856$

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

From perl@cjmweb.net

I tried to build Rakudo Star 2010.07, but it failed with

  src/gen/core.pm > src/gen/core.pir
===SORRY!===
Symbol '@​named-params\ufffd' not predeclared in MAIN_HELPER
(src/gen/core.pm​:6542)
make​: *** [perl6.pbc] Error 1

I'm running 32-bit Gentoo Linux with Perl 5.10.1.

I investigated and found that the offending line in src/gen/core.pm
contained

  @​named-params».name».substr(1)

But the original line in src/core/MAIN.pm contained

  @​named-params».name».substr(1)

"»" in UTF-8 is C2 BB, which in ISO-8859-1 is "»".

So it appears that MAIN.pm is being read as if it were ISO-8859-1 and
then written out in UTF-8. I'm not sure why that happens, but I
discovered that removing the generated files, "unset PERL_UNICODE", and
running "make" again allowed the build to complete.

I had PERL_UNICODE set to SAL, and that causes the build to fail
consistently. I don't know why.

Steps to reproduce​:

Unpack rakudo-star-2010.07.tar.gz
  $ perl Configure.pl --gen-parrot
  $ PERL_UNICODE=SAL make

--
Chris Madsen perl@​cjmweb.net
  -------------------- http://www.cjmweb.net --------------------

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

From perl@cjmweb.net

I forgot to mention that my LANG=en_US.utf8, and no LC_* vars are set.

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

perl@cjmweb.net - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

perl@cjmweb.net - Status changed from 'open' to 'new'

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

From perl@cjmweb.net

build/gen_core_pm.pl is opening files using

  open(my $fh, "<", $file) or die $!;

but writing to STDOUT. My PERL_UNICODE setting causes STDOUT to be
encoded as UTF-8, but the default encoding for open remains ISO-8859-1.

gen_core_pm.pl (and similar scripts) need to either binmode STDOUT, or
open files with the correct encoding.

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

From perl@cjmweb.net

The attached patch (from
http://github.com/madsen/rakudo/commit/450fccceb8a3963202f6f5783f83b56449dcc219
) appears to fix this problem. gen_core_pm.pl was the only file I
noticed that didn't specify the encoding for I/O.

@p6rt
Copy link
Author

p6rt commented Jul 31, 2010

From perl@cjmweb.net

0001-Explicitly-request-utf8-layer-in-gen_core_pm.pl-to-f.patch
From 450fccceb8a3963202f6f5783f83b56449dcc219 Mon Sep 17 00:00:00 2001
From: Christopher J. Madsen <perl@cjmweb.net>
Date: Sat, 31 Jul 2010 10:49:19 -0500
Subject: [PATCH] Explicitly request :utf8 layer in gen_core_pm.pl to fix RT #76856

---
 build/gen_core_pm.pl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/build/gen_core_pm.pl b/build/gen_core_pm.pl
index 10208ad..ce4198e 100644
--- a/build/gen_core_pm.pl
+++ b/build/gen_core_pm.pl
@@ -4,6 +4,9 @@
 
 use strict;
 use warnings;
+use 5.008;
+
+binmode STDOUT, ':utf8';
 
 my @files = @ARGV;
 
@@ -15,7 +18,7 @@ END_SETTING
 my %classnames;
 foreach my $file (@files) {
     print "# From $file\n\n";
-    open(my $fh, "<",  $file) or die $!;
+    open(my $fh, "<:utf8",  $file) or die "$file: $!";
     local $/;
     my $x = <$fh>;
     close $fh;
-- 
1.6.4.4

@p6rt
Copy link
Author

p6rt commented Aug 2, 2010

From @moritz

On Sat Jul 31 08​:56​:19 2010, cjm wrote​:

The attached patch (from

http://github.com/madsen/rakudo/commit/450fccceb8a3963202f6f5783f83b56449dcc219

) appears to fix this problem. gen_core_pm.pl was the only file I
noticed that didn't specify the encoding for I/O.

Thank you very much, applied.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Aug 2, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 2, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Aug 2, 2010
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant