Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 20533
Status: rejected
Priority: 0/
Queue: Module-Build

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

Bug Information
Severity: Important
Broken in: 0.2804
Fixed in: (no value)



Subject: XS file deleted by perl Build realclean!
Download (untitled) / with headers
text/plain 455b
Another attempt at making a EU::MM + M::B compatible structure. As in cpan #20532, create a Foo module using: h2xs -n Foo --skip-autoloader and drop the attached Build.PL in place. This builds OK, as expected (even without an include_dirs setting, since the XS/C files are in the same directory as the files that they include), but when I run perl Build realclean it deletes Foo.xs! Clearly it shouldn't have deleted a file that it didn't generate.
Subject: Build.PL
Download Build.PL
text/x-perl 752b
use Module::Build; my $build = Module::Build->new( module_name => 'Foo', xs_files => { 'Foo.xs' => './Foo.xs' }, add_to_cleanup => ['const-c.inc', 'const-xs.inc'], ); $build->create_build_script(); if (eval {require ExtUtils::Constant; 1}) { my @names = (qw()); ExtUtils::Constant::WriteConstants( NAME => 'Foo', NAMES => \@names, DEFAULT_TYPE => 'IV', C_FILE => 'const-c.inc', XS_FILE => 'const-xs.inc' ); } else { use File::Copy; use File::Spec; foreach my $file ('const-c.inc', 'const-xs.inc') { my $fallback = File::Spec->catfile('fallback', $file); copy ($fallback, $file) or die "Can't copy $fallback to $file: $!"; } }
Download (untitled) / with headers
text/plain 511b
On Tue Jul 18 10:27:43 2006, SHAY wrote: Show quoted text
> xs_files => { 'Foo.xs' => './Foo.xs' },
Show quoted text
>...but when I run > > perl Build realclean > > it deletes Foo.xs! > > Clearly it shouldn't have deleted a file that it didn't generate.
It did generate that file. It copied Foo.xs to Foo.xs (as instructed), which causes it to be added to the cleanup list. The xs_files argument is "$have" => "$expected", where M::B expects your xs files to live in lib/. See also: http://rt.cpan.org/Ticket/Display.html?id=20532


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.