Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: snaury [...] gmail.com
Cc:
AdminCc:

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



Subject: Module::Build fails to link version::vxs on Strawberry Perl (win32)
The problem is that version defines module_name to 'version' in Build.PL, however it also compiles xs from lib/version/vxs.xs. During compilation stage _infer_xs_spec correctly defines module_name to 'version::vxs', however in sub link_c we are suddenly using $self- Show quoted text
>module_name (which is always defined), along with a useless
$module_name ||= $spec->{module_name}; Now during link time we have module_name 'version' and when we generate .def file (and .exp from that) we are trying to export boot_version, which does not exist (generated vxs.c contains boot_version__vxs). The fix seems to be simple: just flip these over and use $spec-> {module_name} and fall back to $self->module_name (which is kind of useless, since $spec->{module_name} should always be defined, but just in case). The patch is attached, however I'm not sure if this could potentially break anything else. Theoretically, we should compile and link with the same module_name, so my patch should be correct. Any ideas?
Subject: Module-Build-0.2808-link_c.patch
diff -druN Module-Build-0.2808.orig/lib/Module/Build/Base.pm Module-Build-0.2808/lib/Module/Build/Base.pm --- Module-Build-0.2808.orig/lib/Module/Build/Base.pm 2007-04-28 21:50:55 +0400 +++ Module-Build-0.2808/lib/Module/Build/Base.pm 2008-07-31 13:34:33 +0400 @@ -3915,8 +3915,8 @@ if $self->up_to_date([$spec->{obj_file}, @$objects], $spec->{lib_file}); - my $module_name = $self->module_name; - $module_name ||= $spec->{module_name}; + my $module_name = $spec->{module_name}; + $module_name ||= $self->module_name; my $b = $self->_cbuilder or die "Module::Build is not configured with C_support";
On Thu Jul 31 05:40:33 2008, snaury wrote: Show quoted text
> The problem is that version defines module_name to 'version' in > Build.PL, however it also compiles xs from lib/version/vxs.xs. During > compilation stage _infer_xs_spec correctly defines module_name > to 'version::vxs', however in sub link_c we are suddenly using $self-
> >module_name (which is always defined), along with a useless
> $module_name ||= $spec->{module_name};
Hi, That sounds correct, but I cannot reproduce it. What was the version.pm version number? Please make sure you can still reproduce the problem with the new 0.30 release. If possible, a test to provide coverage here would be really helpful. Thanks, Eric
From: snaury [...] gmail.com
Вск. Сен. 28 06:24:11 2008, EWILHELM писал: Show quoted text
> Hi, > > That sounds correct, but I cannot reproduce it. What was the > version.pm version > number?
I just reproduced it with Module::Build 0.30 and version 0.76. Though this time this was all weird. Build fails building version::vxs silently and thinks that everything is all right, so it may *seem* like it succeeded, but these lines in console tell us it did not: lib\version\version.exp:fake:(.edata+0x38): undefined reference to `boot_version' lib\version\version.exp:fake:(.edata+0x3c): undefined reference to `boot_version' collect2: ld returned 1 exit status Next, if you already have version installed, then use version::vxs succeeds in Build test, which probably shouldn't (because xs part of local version::vxs was not actually built). To really reproduce it, please move away your local installed version if you already have it installed. I'm talking about these files/directories: C:\strawberry\perl\lib\auto\version C:\strawberry\perl\lib\version C:\strawberry\perl\lib\version.pm After moving these away Build test shows that use version doesn't work anymore. Show quoted text
> Please make sure you can still reproduce the problem with the new 0.30 > release. If > possible, a test to provide coverage here would be really helpful.
Unfortunately I can't do it right now, but I'll try looking into how to create xs tests for Module::Build some days later. The fact that link_c fails so silently is not very encouraging though... :-/
Sep 28 06:24:11 2008, EWILHELM wrote: Show quoted text
> On Thu Jul 31 05:40:33 2008, snaury wrote:
> > The problem is that version defines module_name to 'version' in > > Build.PL, however it also compiles xs from lib/version/vxs.xs.
Show quoted text
> Please make sure you can still reproduce the problem with the new 0.30 > release. If > possible, a test to provide coverage here would be really helpful.
Still same result (ld error and PASS) with Module::Build 0.33 and version 0.76. -- Alexandr Ciornii, http://chorny.net
fixed in repository trunk