-
Notifications
You must be signed in to change notification settings - Fork 10
Description
According to CPAN Testers reports, installation of ExtUtils::CppGuess 0.27 fails on Solaris because of a problem in 002_icpp.t
:
Can't exec "cc": No such file or directory at /export/home/cpan/.cpan/build/ExtUtils-CppGuess-0.27-0/blib/lib/ExtUtils/CppGuess.pm line 289.
Can't exec "cc": No such file or directory at /export/home/cpan/.cpan/build/ExtUtils-CppGuess-0.27-0/blib/lib/ExtUtils/CppGuess.pm line 290.
Can't exec "cc": No such file or directory at /export/home/cpan/.cpan/build/ExtUtils-CppGuess-0.27-0/blib/lib/ExtUtils/CppGuess.pm line 291.
Use of uninitialized value $v1 in concatenation (.) or string at /export/home/cpan/.cpan/build/ExtUtils-CppGuess-0.27-0/blib/lib/ExtUtils/CppGuess.pm line 293.
Use of uninitialized value $v2 in concatenation (.) or string at /export/home/cpan/.cpan/build/ExtUtils-CppGuess-0.27-0/blib/lib/ExtUtils/CppGuess.pm line 293.
Use of uninitialized value $v3 in concatenation (.) or string at /export/home/cpan/.cpan/build/ExtUtils-CppGuess-0.27-0/blib/lib/ExtUtils/CppGuess.pm line 293.
Unable to determine a C++ compiler for 'cc' on solaris
Version attempts:
-v: ''
-V: ''
--version: ''
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 11.
t/002_icpp.t ...........
Dubious, test returned 2 (wstat 512, 0x200)
All 11 subtests passed
(source: https://www.cpantesters.org/cpan/report/0621fc84-2569-11ef-bb1a-ff8020b05d6e)
Analysis
#29 (5e47504) added tests with some mocked compiler output and monkey-patched _capture()
to avoid calling the compiler actually installed on the system.
However, one of the tests relies on the fact that _cc_is_gcc()
calls not only _capture()
, but _capture_empty_stdin()
as well.
The latter method is not monkey-patched and will return empty on systems that happen to not have the mocked compiler installed under that specific name.
extutils-cppguess/t/002_icpp.t
Line 143 in babadca
{ "cc --version" => "cc (Debian 12.2.0-14) 12.2.0" }, |
extutils-cppguess/lib/ExtUtils/CppGuess.pm
Lines 395 to 401 in babadca
if ( | |
$cc_version =~ m/\bg(?:cc|\+\+)/i # 3.x, some 4.x | |
|| scalar( _capture( "$cc" ) =~ m/\bgcc\b/i ) # 2.95 | |
|| scalar(_capture_empty_stdin("$cc -dM -E -") =~ /__GNUC__/) # more or less universal? | |
|| scalar($cc_version =~ m/\bcc\b.*Free Software Foundation/si) # some 4.x? | |
|| $cc eq 'gcc' # because why would they lie? | |
) { |
Potential solution
Monkey-patch _capture_empty_stdin()
.