Skip Menu |
 

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 98265
Status: resolved
Priority: 0/
Queue: CPAN

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

Bug Information
Severity: Critical
Broken in: 2.05
Fixed in: 2.10

Attachments
0001-Don-t-use-list-assignment-to-ENV-in-Distribution-mak.patch
0002-Fix-Makefile-Build-file-test-in-prereq_pm.patch



Subject: PATCH] 2 Distribution.pm breakages on VMS
7f2189107ab54144 added a list assignment to %ENV in CPAN::Distribution::make, which falls down hard on VMS, where list assignment to %ENV isn't safe and thus isn't allowed, even when %ENV is localizzed. There are no indications in the comments or commit message what problem this is trying to solve, so my first patch attached here makes a guess that there were uninitialized value warnings and changes the undefined values, if any, to empty strings in a localized slice of %ENV. e55b963a6b8c8 added a check to look for 'Makefile' or 'Build' in prereq_pm and stopped looking for prerequisites if those files don't exist. That means no prerequisite processing is done for any make tool or platform that doesn't use those specific filenames. The second patch here fixes the most common cases on VMS. Windows might still be broken (at least I think there used to be 'Build.bat' -- not sure if it's still done that way). Ideally these filenames would be obtained from ExtUtils::MakeMaker->{MAKEFILE} and Module::Build->{properties}{build_script} but those are obviously not readily accessible from Distribution.pm.
Subject: 0001-Don-t-use-list-assignment-to-ENV-in-Distribution-mak.patch
From 76d547885bbbceba836e4e0b18fc9ba9e5ae325d Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" <craigberry@mac.com> Date: Fri, 22 Aug 2014 14:22:38 -0500 Subject: [PATCH 1/2] Don't use list assignment to %ENV in Distribution::make. That doesn't work on VMS. We can avoid uninitialized value warnings by replacing undefined values with empty strings and then override only those values in %ENV rather than replacing the whole thing. --- lib/CPAN/Distribution.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CPAN/Distribution.pm b/lib/CPAN/Distribution.pm index b2602d4..e1df4b5 100644 --- a/lib/CPAN/Distribution.pm +++ b/lib/CPAN/Distribution.pm @@ -2123,10 +2123,10 @@ is part of the perl-%s distribution. To install that, you need to run my %env; while (my($k,$v) = each %ENV) { - next unless defined $v; - $env{$k} = $v; + next if defined $v; + $env{$k} = ''; } - local %ENV = %env; + local @ENV{keys %env} = values %env; my $satisfied = eval { $self->satisfy_requires }; return $self->goodbye($@) if $@; return unless $satisfied ; -- 1.8.4.2
Subject: 0002-Fix-Makefile-Build-file-test-in-prereq_pm.patch
From 2c464025b08c914f4dada03a35bb4dbab8e6ae72 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" <craigberry@mac.com> Date: Fri, 22 Aug 2014 14:33:32 -0500 Subject: [PATCH 2/2] Fix Makefile/Build file test in prereq_pm. e55b963a6b8c8 added a check to look for 'Makefile' or 'Build' and stopped looking for prerequisites if those files don't exist. That means no prerequisite processing is done for any make tool or platform that doesn't generate those specific filenames. So add at least a couple of the things that are missing. --- lib/CPAN/Distribution.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CPAN/Distribution.pm b/lib/CPAN/Distribution.pm index e1df4b5..8713d3c 100644 --- a/lib/CPAN/Distribution.pm +++ b/lib/CPAN/Distribution.pm @@ -3153,8 +3153,9 @@ sub prereq_pm { return; } # no Makefile/Build means configuration aborted, so don't look for prereqs - return unless -f File::Spec->catfile($self->{build_dir},'Makefile') - || -f File::Spec->catfile($self->{build_dir},'Build'); + my $makefile = File::Spec->catfile($self->{build_dir}, $^O eq 'VMS' ? 'descrip.mms' : 'Makefile'); + my $buildfile = File::Spec->catfile($self->{build_dir}, $^O eq 'VMS' ? 'Build.com' : 'Build'); + return unless -f $makefile || -f $buildfile; CPAN->debug(sprintf "writemakefile[%s]modulebuild[%s]", $self->{writemakefile}||"", $self->{modulebuild}||"", -- 1.8.4.2
Subject: Re: [rt.cpan.org #98265] PATCH] 2 Distribution.pm breakages on VMS
Date: Fri, 22 Aug 2014 17:17:43 -0400
To: bug-CPAN <bug-CPAN [...] rt.cpan.org>
From: David Golden <dagolden [...] cpan.org>
Download (untitled) / with headers
text/plain 195b
Thanks! I've forwarded your ticket to Matt Trout to look at the 0001 patch. The 0002 patch looks fine to me, though I'm not opposed to loading EUMM or MB if that helps with portability. David
CC: cberry [...] cpan.org
Subject: Re: [rt.cpan.org #98265] PATCH] 2 Distribution.pm breakages on VMS
Date: Sat, 21 Feb 2015 18:06:04 -0600
To: bug-CPAN [...] rt.cpan.org
From: "Craig A. Berry" <craigberry [...] mac.com>
Download (untitled) / with headers
text/plain 1.3k
Show quoted text
> On Aug 22, 2014, at 4:18 PM, David Golden via RT <bug-CPAN@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=98265 > > > Thanks! > > I've forwarded your ticket to Matt Trout to look at the 0001 patch. The > 0002 patch looks fine to me, though I'm not opposed to loading EUMM or MB > if that helps with portability.
Is there anything I can do to help move this ticket along? I just ran a test with an installed version of blead that now contains 5.09-TRIAL and it still falls down hard: . . . Configuring C/CB/CBERRY/VMS-Device-0_10.zip with Makefile.PL Checking if your kit is complete... Looks good Generating a MMK-style Descrip.MMS Writing Descrip.MMS for VMS::Device Writing MYMETA.yml and MYMETA.json CBERRY/VMS-Device-0_10.zip MDA0:[CRAIG.smoke.blead_ROOT.][000000]perl.exe;1 Makefile.PL -- OK Running make for C/CB/CBERRY/VMS-Device-0_10.zip Can't make list assignment to %ENV on this system at /perl_root/lib/CPAN/Distribution.pm line 2170. %SYSTEM-F-ABORT, abort I can maintain a customized version of CPAN for 5.22.x just as I did for 5.20.x, but I'd rather not if it's avoidable without inconveniencing anyone too much. Show quoted text
________________________________________ Craig A. Berry mailto:craigberry@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
It helps to poke a second time:) Sorry for the glitch. I'll upload 2.10-TRIAL in a few minutes
Subject: Re: [rt.cpan.org #98265] PATCH] 2 Distribution.pm breakages on VMS
Date: Sun, 22 Feb 2015 12:49:53 -0600
To: bug-CPAN [...] rt.cpan.org
From: "Craig A. Berry" <craigberry [...] mac.com>
Download (untitled) / with headers
text/plain 569b
Show quoted text
> On Feb 22, 2015, at 9:34 AM, Andreas Koenig via RT <bug-CPAN@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=98265 > > > It helps to poke a second time:) > > Sorry for the glitch. > > I'll upload 2.10-TRIAL in a few minutes
Thanks very much. Note that my name is spelled with a "C" at the beginning, not "G" (for any further updates to Changes). Show quoted text
________________________________________ Craig A. Berry mailto:craigberry@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
Subject: Re: [rt.cpan.org #98265] PATCH] 2 Distribution.pm breakages on VMS
Date: Sun, 01 Mar 2015 17:25:48 -0600
To: bug-CPAN [...] rt.cpan.org
From: "Craig A. Berry" <craigberry [...] mac.com>
Download (untitled) / with headers
text/plain 475b
Show quoted text
>
>> On Feb 22, 2015, at 9:34 AM, Andreas Koenig via RT <bug-CPAN@rt.cpan.org> wrote: >> >> I'll upload 2.10-TRIAL in a few minutes
>
I've tested this with blead and it solved my problem nicely. If we see a 5.10 final soonish I see no reason we can't get that into blead for 5.22. Show quoted text
________________________________________ Craig A. Berry mailto:craigberry@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
Subject: Re: [rt.cpan.org #98265] PATCH] 2 Distribution.pm breakages on VMS
Date: Mon, 02 Mar 2015 07:51:33 +0100
To: bug-CPAN [...] rt.cpan.org
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Download (untitled) / with headers
text/plain 407b
Show quoted text
>>>>> On Sun, 1 Mar 2015 18:26:27 -0500, "craigberry@mac.com via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> I've tested this with blead and it solved my problem nicely. If we > see a 5.10 final soonish I see no reason we can't get that into > blead for 5.22.
Great, thanks for confirmation, and indeed that's my plan. And cpantesters have sent 280 passes and no fail, I'll make it happen soon. -- andreas
Thanks everybody, resolving.


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.