Re: [rt.cpan.org #81172] using Inline with => 'Event' fails to compile

[email protected] ("Peter Smoczynski via RT")
Newsgroups perl.inline
Message-ID <[email protected]>
Mon Nov 19 06:21:18 2012: Request 81172 was acted upon.
Transaction: Correspondence added by [email protected]
       Queue: Inline
     Subject: Re: [rt.cpan.org #81172] using Inline with => 'Event' fails to compile
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: [email protected]
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81172 >


Am 17.11.2012 01:58, schrieb Sisyphus via RT:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=81172 >
>
> On Fri Nov 16 06:51:09 2012, [email protected] wrote:
>
>> in fact it's the space(!) and not the double quotes!
>>
>> i.e.
>>
>> "-I /opt/perl5.12.2.debug/lib/site_perl/5.12.2/i86pc-solaris/Event"
>>
>> vs.
>>
>> "-I/opt/perl5.12.2.debug/lib/site_perl/5.12.2/i86pc-solaris/Event"
> Well spotted - I had missed that there was a space stuck in there.
>
> So ... the space between the -I and the /opt doesn't cause any problems
> until the whole thing is enclosed in double-quotes ? (Please correct me
> if that's wrong.)
yes, the space between the -I and the /opt does not cause any problems 
-- that is correct!
might be reminiscent to the old k&r days..?
> I would have expected that space to be a problem even if there *weren't*
> any enclosing double-quotes.
> But, if that's not the case, then quote_space() probably needs to take
> this into consideration.
>
> I'm thinking quote_space() should be able to do this at the end of its
> processing with
>
> s/"\-I\s+\//"-I\//g
>
> since any spaces between the leading -I and the first / can never be
> meaningful (right ?).
>
> If you want to give that a try, at the end of the quote_space()
> subroutine in C.pm, change:
>
>    my $out = join '', @in;
>    $_[0] = $out;
>
> to:
>
>    my $out = join '', @in;
>    out =~ s/"\-I\s+\//"-I\//g;
>    $_[0] = $out;
>
> I haven't tested, however, so I'm being a bit premature here ...

I did change the end of quote_space() to

   my $out = join '', @in;
   $out =~ s/"\-I\s+\//"-I\//g;
   $_[0] = $out;

which works fine for me:

[...]
   Starting "make" Stage
/opt/perl5.12.2.debug/bin/perl 
/opt/perl5.12.2.debug/lib/5.12.2/ExtUtils/xsubpp  -typemap 
"/opt/perl5.12.2.debug/lib/5.12.2/ExtUtils/typemap" -typemap 
"/opt/perl5.12.2.debug/lib/site_perl/5.12.2/i86pc-solaris/Event/typemap" 
compile_test_1_t_a7b1.xs > compile_test_1_t_a7b1.xsc && mv 
compile_test_1_t_a7b1.xsc compile_test_1_t_a7b1.c
gcc -c  -I"/root/peter/inline_fails_to_compile" 
"-I/opt/perl5.12.2.debug/lib/site_perl/5.12.2/i86pc-solaris/Event" 
-I/usr/local/include -I/usr/local/BerkeleyDB.4.5/include -DDEBUGGING 
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -g   
-DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC 
"-I/opt/perl5.12.2.debug/lib/5.12.2/i86pc-solaris/CORE" 
compile_test_1_t_a7b1.c
Running Mkbootstrap for compile_test_1_t_a7b1 ()
chmod 644 compile_test_1_t_a7b1.bs
rm -f blib/arch/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.so
gcc  -G -L/usr/local/lib -Wl,-R/usr/local/lib 
-L/usr/local/BerkeleyDB.4.5/lib -Wl,-R/usr/local/BerkeleyDB.4.5/lib 
-fstack-protector compile_test_1_t_a7b1.o  -o 
blib/arch/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.so 
/opt/perl5.12.2.debug/lib/site_perl/5.12.2/i86pc-solaris/auto/Event/Event.so 
\
                 \

chmod 755 blib/arch/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.so
cp compile_test_1_t_a7b1.bs 
blib/arch/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.bs
chmod 644 blib/arch/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.bs
   Finished "make" Stage

   Starting "make install" Stage
Files found in blib/arch: installing files in blib/lib into architecture 
dependent library tree
Installing 
/root/peter/inline_fails_to_compile/_Inline/lib/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.bs
Installing 
/root/peter/inline_fails_to_compile/_Inline/lib/auto/compile_test_1_t_a7b1/compile_test_1_t_a7b1.so
   Finished "make install" Stage

   Starting Cleaning Up Stage
   Finished Cleaning Up Stage

Finished Build Compile Stage

compile_test_1.t syntax OK
Sun-A3 root 260/0 (~/peter/inline_fails_to_compile)#

>
> There's also the case that
>
> -I /foo
>
> would be changed to
>
> -I" /foo"
>
> if it was the first element in the string, so that needs to be looked
> at, too.
right
> I'll release 0.51_01 in a couple of days time, and let you know when
> that happens. It will contain, among other things, a fix for this issue.
>
> Thanks for the report, and for the digging.
>
> Cheers,
> Rob
you're welcome!
cheers, peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.