From: Steve Hay Date: Mon, 25 Jul 2005 14:34:12 +0000 (+0000) Subject: Ken pointed out that CBuilder's cleanup is too agrressive X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c71b354394b716d454ace0c48305ad74467e50e;p=p5sagit%2Fp5-mst-13.2.git Ken pointed out that CBuilder's cleanup is too agrressive The Windows compile() and link() methods bizarrely include their own output files in the list of files to be cleaned up. Now that they actually are being cleaned up, this isn't ideal ;-) Stop compile() and link() from cleaning up their own output, and reinstate the explicit deletion of those output files in the test scripts. p4raw-id: //depot/perl@25225 --- diff --git a/lib/ExtUtils/CBuilder/Platform/Windows.pm b/lib/ExtUtils/CBuilder/Platform/Windows.pm index 8c1750f..072791e 100644 --- a/lib/ExtUtils/CBuilder/Platform/Windows.pm +++ b/lib/ExtUtils/CBuilder/Platform/Windows.pm @@ -122,8 +122,6 @@ sub compile { use_scripts => 1, # XXX provide user option to change this??? ); - $self->add_to_cleanup($spec{output}); - $self->normalize_filespecs( \$spec{source}, \$spec{output}, @@ -196,7 +194,7 @@ sub link { $self->add_to_cleanup( grep defined, - @{[ @spec{qw(output implib explib def_file base_file map_file)} ]} + @{[ @spec{qw(implib explib def_file base_file map_file)} ]} ); foreach my $opt ( qw(output implib explib def_file map_file base_file) ) { diff --git a/lib/ExtUtils/CBuilder/t/01-basic.t b/lib/ExtUtils/CBuilder/t/01-basic.t index b13f4d0..39c6e5b 100644 --- a/lib/ExtUtils/CBuilder/t/01-basic.t +++ b/lib/ExtUtils/CBuilder/t/01-basic.t @@ -47,7 +47,10 @@ my ($lib, @temps) = $b->link(objects => $object_file, $lib =~ tr/"'//d; ok $lib_file, $lib; -unlink $source_file; +for ($source_file, $lib_file, $object_file) { + tr/"'//d; + 1 while unlink; +} my @words = $b->split_like_shell(' foo bar'); ok @words, 2; diff --git a/lib/ExtUtils/CBuilder/t/02-link.t b/lib/ExtUtils/CBuilder/t/02-link.t index ccfe4ee..48a63f0 100644 --- a/lib/ExtUtils/CBuilder/t/02-link.t +++ b/lib/ExtUtils/CBuilder/t/02-link.t @@ -55,7 +55,10 @@ ok $exe_file; ok my_system($exe_file), 11; # Clean up -unlink $source_file; +for ($source_file, $exe_file, $object_file) { + tr/"'//d; + 1 while unlink; +} sub my_system { my $cmd = shift; diff --git a/lib/ExtUtils/ParseXS/t/basic.t b/lib/ExtUtils/ParseXS/t/basic.t index efaf968..4c4fce3 100644 --- a/lib/ExtUtils/ParseXS/t/basic.t +++ b/lib/ExtUtils/ParseXS/t/basic.t @@ -64,6 +64,7 @@ if ($b->have_compiler) { } } } + unlink $obj_file; unlink $lib_file; } else { skip "Skipped can't find a C compiler & linker", 1 for 1..7;