Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Inline CPAN distribution.

Report information
The Basics
Id: 67053
Status: resolved
Priority: 0/
Queue: Inline

People
Owner: Nobody in particular
Requestors: rurban [...] x-ray.at
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.48
Fixed in: (no value)



Subject: Space in pwd
$ p inline-test.pl /usr/local/bin/perl5.13.10d-m.exe /usr/lib/perl5/5.13.10/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.13.10/ExtUtils/typemap my_3d6b.xs > my_3d6b.xsc && mv my_3d6b.xsc my_3d6b.c gcc-4 -c -I/cygdrive/d/data/urbanr/My Documents/Perl - DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -march=pentium4 -mfpmath=sse - mieee-fp -mmmx -msse -msse2 -DDEBUGGING -fno-strict-aliasing -pipe - fstack-protector -I/usr/local/include -DUSEIMPORTLIB -g3 - DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" "-I/usr/lib/perl5/5.13.10/i686- multi-debug-cygwin/CORE" my_3d6b.c gcc-4: Documents/Perl: No such file or directory make: *** [my_3d6b.o] Error 1 => gcc-4 -c -I"/cygdrive/d/data/urbanr/My Documents/Perl"
From: rurban [...] x-ray.at
Attached patch fixes most tests for me, remaining is a failure in C/t/07typemap_multi.t: Can't locate auto/Soldier/new.al ...
Subject: Inline-C-spacecwd.patch
Fixes for spaces in current dir (Windows and cygwin mostly) diff -u ./C/C.pm.orig --- ./C/C.pm.orig 2011-02-21 08:46:27.000000000 +0100 +++ ./C/C.pm 2011-03-29 14:51:10.502111300 +0200 @@ -43,7 +43,7 @@ $o->{ILSM}{MAKEFILE} ||= {}; if (not $o->UNTAINT) { require FindBin; - $o->{ILSM}{MAKEFILE}{INC} = "-I$FindBin::Bin"; + $o->{ILSM}{MAKEFILE}{INC} = "-I\"$FindBin::Bin\""; } $o->{ILSM}{AUTOWRAP} = 0 if not defined $o->{ILSM}{AUTOWRAP}; $o->{ILSM}{XSMODE} = 0 if not defined $o->{ILSM}{XSMODE}; @@ -79,8 +79,11 @@ $o->add_list($o->{ILSM}{MAKEFILE}, $key, $value, []); next; } - if ($key eq 'INC' or - $key eq 'MYEXTLIB' or + if ($key eq 'INC') { + $o->add_string($o->{ILSM}{MAKEFILE}, $key, quote_space($value), ''); + next; + } + if ($key eq 'MYEXTLIB' or $key eq 'OPTIMIZE' or $key eq 'CCFLAGS' or $key eq 'LDDLFLAGS') { @@ -91,17 +94,17 @@ unless(ref($value) eq 'ARRAY') { croak "TYPEMAPS file '$value' not found" unless -f $value; - $value = File::Spec->rel2abs($value); + $value = fix_space(File::Spec->rel2abs($value)); } else { - for (my $i = 0; $i < scalar(@$value); $i++) { + for (my $i = 0; $i < scalar(@$value); $i++) { croak "TYPEMAPS file '${$value}[$i]' not found" unless -f ${$value}[$i]; - ${$value}[$i] = File::Spec->rel2abs(${$value}[$i]); + ${$value}[$i] = fix_space(File::Spec->rel2abs(${$value}[$i])); } } - $o->add_list($o->{ILSM}{MAKEFILE}, $key, $value, []); - next; + $o->add_list($o->{ILSM}{MAKEFILE}, $key, $value, []); + next; } if ($key eq 'AUTO_INCLUDE') { $o->add_text($o->{ILSM}, $key, $value, ''); @@ -348,12 +351,14 @@ warn "Can't find the default system typemap file" if (not $typemap and $^W); - unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $typemap) if $typemap; + unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, quote_space($typemap)) if $typemap; if (not $o->UNTAINT) { require FindBin; $file = File::Spec->catfile($FindBin::Bin,"typemap"); - push(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $file) if -f $file; + if ( -f $file ) { + push(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, quote_space($file)); + } } } @@ -847,7 +852,9 @@ if (/^(\w+)\s*=\s*\S+.*$/ and $fix = $fixes{$1} ) { - print MAKEFILE "$1 = $o->{ILSM}{$fix}\n" + my $fixed = $o->{ILSM}{$fix}; + $fixed = fix_space($fixed) if $fix eq 'install_lib'; + print MAKEFILE "$1 = $fixed\n"; } else { print MAKEFILE; @@ -856,6 +863,16 @@ close MAKEFILE; } +sub quote_space { + $_[0] = '"'.$_[0].'"' if $_[0] and $_[0] =~ /\s/; + $_[0]; +} + +sub fix_space { + $_[0] =~ s/ /\\ /g if $_[0] =~ / /; + $_[0]; +} + #============================================================================== # This routine used by C/t/09parser to test that the expected parser is in use #==============================================================================
On Tue Mar 29 09:00:10 2011, rurban@x-ray.at wrote: Show quoted text
> Attached patch fixes most tests for me,
Thanks Reini. I'll put this in the next release. Show quoted text
> remaining is a failure in C/t/07typemap_multi.t: > Can't locate auto/Soldier/new.al > ...
I take it this is also a result of space in the path ? Cheers, Rob
Subject: Re: [rt.cpan.org #67053] Space in pwd
Date: Wed, 30 Mar 2011 08:11:43 +0200
To: bug-Inline [...] rt.cpan.org
From: Reini Urban <rurban [...] x-ray.at>
Show quoted text
>> remaining is a failure in C/t/07typemap_multi.t: >> Can't locate auto/Soldier/new.al >> ...
> > I take it this is also a result of space in the path ?
I assume so, because it works if tested in /tmp but I haven't found the cause of the bug yet. It's very tricky to debug for me. Warning. No Inline C functions bound to Perl in t/07typemap_multi.t Check your C function definition(s) for Inline compatibility Can't locate object method "new" via package "Soldier" at t/07typemap_multi.t line 14 (#1) (F) You called a method correctly, and it correctly indicated a package functioning as a class, but that package doesn't define that particular method, nor does any of its base classes. See perlobj. Uncaught exception from user code: Can't locate object method "new" via package "Soldier" at t/07typemap_multi.t line 14. at t/07typemap_multi.t line 14 t/07typemap_multi.t ..... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 3/3 subtests -- Reini Urban
Subject: Re: [rt.cpan.org #67053] Space in pwd
Date: Wed, 30 Mar 2011 14:29:02 +0200
To: bug-Inline [...] rt.cpan.org
From: Reini Urban <rurban [...] x-ray.at>
Attached new patch fixed also the remaining C/t/07typemap_multi.t problem. with spaces in pwd we get a harmless EUMM warning: Typemap ...C/t/typemap not found. . but I don't to fix EUMM also now. I bumped the version to 0.49 and added Changelog entries

Message body is not shown because sender requested not to inline it.

On Wed Mar 30 08:29:11 2011, rurban@x-ray.at wrote: Show quoted text
> Attached new patch fixed also the remaining C/t/07typemap_multi.t
problem. The patches don't fix the problems with spaces for me on Win32 (XP) with perl-5.12.0. Perhaps this is because I use a different OS ... and/or perhaps because I use a different version of EU::MM. I plonked (a patched) Inline source in 'C:/space test' and tried building it. The first error I get when running the C/t/ test scripts is: Can't open file C:\space\: No such file or directory at C:/perl512_M/lib/ExtUtils/Install.pm line 855 Still, if it helps you out and doesn't break anything else, then that's reason enough to apply the patches - which is what I've done to the github version. You can grab it with: git clone git://github.com/ingydotnet/inline-pm.git Inline If you get a chance, you might check that the patches have applied correctly. (I've kept the version there at 0.48_01, as that will be the next devel release uploaded to CPAN, and I've modified C/Changes but not the top level Changes - as these changes relate only to Inline::C). Unless you see a need for further change, I'll upload 0.48_01 to CPAN in a day or two, and see how it fares with the cpan-testers. Once that's done, I could release it as 0.49 if you're keen for that to happen. Cheers, Rob
On Sun Apr 03 05:16:27 2011, SISYPHUS wrote: Show quoted text
> On Wed Mar 30 08:29:11 2011, rurban@x-ray.at wrote:
> > Attached new patch fixed also the remaining C/t/07typemap_multi.t
> problem.
The quote_space() subroutine that formed part of that patch has, as of Inline-0.50_03, been re-written as a result of https://rt.cpan.org/Ticket/Display.html?id=80026 Cheers, Rob