Skip Menu |

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

Report information
The Basics
Id: 21515
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: ed [...] membled.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.2805
Fixed in: (no value)



Subject: C compilation support should be explicity labelled for dependencies
When you install Module::Build it checks for ExtUtils::CBuilder among other modules. If CBuilder is installed then Module::Build configures itself with C support. If CBuilder isn't there then you get a version of Module::Build that doesn't support modules with C code. This causes problems when trying to install modules automatically using a package manager that follows dependencies, for example 'perl -MCPAN -e shell'. You might try to 'install Data::Bind', for example, and that pulls down Module::Build as it should, but unless CBuilder happens to be there as well, you'll get a Module::Build that doesn't support C code and the final installation will fail. I don't know if there is a way for Data::Bind to specify in its dependencies that not only does it require Module::Build, it requires a Module::Build capable of building C code. In any case, the CPAN shell doesn't realize this. I don't know the right way to fix this: perhaps you could add a dummy package Module::Build::CSupport which Data::Bind and similar modules could explicitly require; then there would need to be some way to say that Module::Build::CSupport depends on ExtUtils::CBuilder and is installed by building the normal Module::Build package. I think some fix is needed, otherwise the CPAN shell ends up being broken for any package that uses Module::Build and includes XS code. % perl -v This is perl, v5.8.7 built for cygwin-thread-multi-64int (with 1 registered patch, see perl -V for more detail) Copyright 1987-2005, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
On Fri Sep 15 09:44:21 2006, ed@membled.com wrote: Show quoted text
> When you install Module::Build it checks for ExtUtils::CBuilder
among Show quoted text
> other modules. If CBuilder is installed then Module::Build
configures Show quoted text
> itself with C support.
Module::Build (at least since 0.280x) detects C support on-the-fly. Modules with xs code need to declare ExtUtils::CBuilder as a prereq in build_requires.
On Mon Oct 01 05:14:41 2007, EWILHELM wrote: Show quoted text
> On Fri Sep 15 09:44:21 2006, ed@membled.com wrote:
> > When you install Module::Build it checks for ExtUtils::CBuilder
> among
> > other modules. If CBuilder is installed then Module::Build
> configures
> > itself with C support.
> > Module::Build (at least since 0.280x) detects C support on-the-fly. > > Modules with xs code need to declare ExtUtils::CBuilder as a prereq in > build_requires.
Perhaps Module::Build should just do that for you? It knows you're doing C compilation and it knows what's needed.
I've also noticed that nowhere is that you have to require ExtUtils::CBuilder when shipping XS code documented.
From: EDAVIS [...] cpan.org
If I understand you correctly, you're saying that it isn't necessary for ExtUtils::CBuilder to be installed at the time Module::Build is installed, only that CBuilder be available at the time Module::Build is used. Therefore it will be enough to specify it as a build_requires in any module that uses Module::Build and XS code. Accordingly I have filed a bug report #29764 against Data::Bind, which has XS code but is missing the build_requires line. I agree with Michael Schwern that this requirement should be explicitly documented. (The Module::Build pod documentation does not mention CBuilder at all.)
Subject: C compilation support should be implicitly detected
RT-Send-CC: module-build [...] perl.org
On Mon Oct 01 19:26:12 2007, MSCHWERN wrote: Show quoted text
> On Mon Oct 01 05:14:41 2007, EWILHELM wrote:
>> Modules with xs code need to declare ExtUtils::CBuilder >>as a prereq in build_requires.
> > Perhaps Module::Build should just do that for you? It knows you're > doing C compilation and it knows what's needed.
The presence of XS files isn't the right trigger in some cases. See e.g. version.pm, where compiling the C code is optional. http://search.cpan.org/~jpeacock/version-0.73/ The idea of making this implicit probably needs a new wishlist ticket.
Subject: C compilation support documentation
On Thu Oct 04 06:27:18 2007, EDAVIS wrote: Show quoted text
> If I understand you correctly, you're saying that it isn't > necessary for ExtUtils::CBuilder to be installed at the time > Module::Build is installed, only that CBuilder be available > at the time Module::Build is used. Therefore it will be enough > to specify it as a build_requires in any module that uses > Module::Build and XS code.
That's correct. There might have been a time when we weren't looking for CBuilder at runtime, but I think that was at least a year ago. Show quoted text
> I agree with Michael Schwern that this requirement should be > explicitly documented. (The Module::Build pod documentation > does not mention CBuilder at all.)
Documentation added to Module::Build::Authoring in svn r10052. I'm going to close this as a documentation bug with the note that it may have been a functionality bug at the time of the original report (but if so, I believe that was resolved by auto_features support in ConfigData in 0.26 in 2004.) As for the wishlist aspect of auto-detection, let's put that in a new ticket: http://rt.cpan.org/Ticket/Display.html?id=29774 Thanks, Eric