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: 40140
Status: resolved
Priority: 0/
Queue: Inline

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.44
Fixed in: (no value)



Subject: Should recognize "ccache cc" as C compiler
My perls are built using CC="ccache cc". This seems to be problematic for Inline, and causes to show the wrong default answer in the following question Do you want to install Inline::C? [n] Regards, Slaven
On Fri Oct 17 17:55:45 2008, SREZIC wrote: Show quoted text
> My perls are built using CC="ccache cc". This seems to be problematic > for Inline, and causes to show the wrong default answer in the following > question > > Do you want to install Inline::C? [n]
Currently the C/Makefile.PL simply assigns $Config{cc} to a variable ($cc) and then performs some tests on that variable, to ascertain that the compiler can, in fact, be found. Is it simply a matter of doing $cc =~ s/ccache //; before conducting those tests ? Or would that be insufficient to solve the problem ? Cheers, Rob
CC: SREZIC [...] cpan.org
Subject: Re: [rt.cpan.org #40140] Should recognize "ccache cc" as C compiler
Date: Sun, 30 Nov 2008 17:55:22 +0100
To: bug-Inline [...] rt.cpan.org
From: Slaven Rezic <slaven [...] rezic.de>
"Sisyphus via RT" <bug-Inline@rt.cpan.org> writes: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=40140 > > > On Fri Oct 17 17:55:45 2008, SREZIC wrote:
>> My perls are built using CC="ccache cc". This seems to be problematic >> for Inline, and causes to show the wrong default answer in the following >> question >> >> Do you want to install Inline::C? [n]
> > Currently the C/Makefile.PL simply assigns $Config{cc} to a variable > ($cc) and then performs some tests on that variable, to ascertain that > the compiler can, in fact, be found. Is it simply a matter of doing > > $cc =~ s/ccache //; > > before conducting those tests ? Or would that be insufficient to solve > the problem ?
In my case, this would probably be sufficient. Maybe a better solution would be to split by \s+, and if the first element is "ccache", then check if both ccache and the second element (usually "cc", but may be something else) are available in PATH. Regards, Slaven -- Slaven Rezic - slaven <at> rezic <dot> de tkruler - Perl/Tk program for measuring screen distances http://ptktools.sourceforge.net/#tkruler
Fixed in Inline-0.46
On Thu Feb 11 22:48:37 2010, SISYPHUS wrote: Show quoted text
> Fixed in Inline-0.46
Unfortunately not. Problem is that the new version only works if both components in $cc are absolute paths, but this is usually not the case. See the attached patch for an alternative solution. Regards, Slaven
Subject: 0001-refactored-checking-for-the-C-compiler-to-really-fix.patch
From aab3c00374bb4af37cec5ce2003913d645706318 Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Sat, 13 Feb 2010 10:42:14 +0100 Subject: [PATCH] refactored checking for the C compiler to really fix the issue reported in https://rt.cpan.org/Ticket/Display.html?id=40140 --- C/Makefile.PL | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/C/Makefile.PL b/C/Makefile.PL index 2b91b92..a45fbe4 100644 --- a/C/Makefile.PL +++ b/C/Makefile.PL @@ -5,32 +5,29 @@ use File::Spec; my ($cc, $exe) = @Config{'cc', '_exe'}; $cc =~ s/\s+-.+$//; #remove possible trailing options -my $comp = (split /\./, $cc)[0]; my $found = 0; my $delim = $Config::Config{path_sep}; if ($cc =~ m|/:\[|) { + my $comp = (split /\./, $cc)[0]; $found = -f "$comp$exe"; } -# $Config{cc} might be something like '/some/place/cc' -elsif ($cc =~ m|/|) { - $found = -f "$comp$exe" || -l $cc; -} - # $Config{cc} might be something like 'ccache cc' elsif ($cc =~ m|ccache|) { my @cc = split /\s+/, $cc; - $found = -f "$cc[0]$exe" || -l $cc[0]; - if($found && $cc[1]) {$found = -f "$cc[1]$exe" || -l $cc[1]} + $found = 1; + for (@cc) { + if (!find_executable($_)) { + $found = 0; + last; + } + } } else { - my $comp = (split /\./, $cc)[0]; - for my $lib (split $delim, $ENV{PATH}) { - $found = -f File::Spec->catfile($lib,"$comp$exe") and last; - } + $found = find_executable($cc); } print <<END; @@ -50,7 +47,7 @@ END if ($found) { print <<END; -I have located this compiler on your system: +I have located this compiler on your system. END } @@ -93,3 +90,17 @@ clean:: END close MF; } + +sub find_executable { + my($cc) = @_; + my $comp = (split /\./, $cc)[0]; + + # $Config{cc} might be something like '/some/place/cc' + if ($cc =~ m|/|) { + return -f "$comp$exe" || -l $cc; + } + + for my $lib (split $delim, $ENV{PATH}) { + return 1 if -f File::Spec->catfile($lib,"$comp$exe"); + } +} -- 1.6.4.3
RT-Send-CC: slaven [...] rezic.de
On Sat Feb 13 04:43:52 2010, SREZIC wrote: Show quoted text
> See the attached patch for an alternative solution.
Thanks Slaven. Patch has been applied to the git repo (git://github.com/ingydotnet/inline-pm.git) in preparation for next release. Cheers, Rob
Hope we've got it fixed this time - haven't seen any reports about this in relation to 0.46_01 or 0.46_02 (which has just been uploaded to CPAN as 0.47). Cheers, Rob