Skip Menu |

This queue is for tickets about the Digest-SHA CPAN distribution.

Report information
The Basics
Id: 83800
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Digest-SHA

People
Owner: mshelor [...] cpan.org
Requestors: cberry [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.83
Fixed in: 5.84



Subject: [PATCH] portability for new dependency logic
Hard-coding forward slashes as the directory delimiter is not necessarily going to work across platforms, and in fact it broke the core build on VMS when 5.83 was integrated into blead. Luckily it's easy to do the portable thing with File::Spec; see the attached patch, which is against blead, so apply with -p3.
Subject: digest_sha_makefile.patch
--- cpan/Digest-SHA/Makefile.PL;-0 2013-03-05 10:47:21 -0600 +++ cpan/Digest-SHA/Makefile.PL 2013-03-06 07:31:46 -0600 @@ -4,6 +4,7 @@ use strict; use ExtUtils::MakeMaker; use Getopt::Std; use Config qw(%Config); +use File::Spec; my $PM = 'lib/Digest/SHA.pm'; @@ -33,8 +34,8 @@ if ($Config{archname} =~ /^i[3456]86/ && push(@extra, OPTIMIZE => '-O1 -fomit-frame-pointer'); } -my @srcs = map { "src/$_" } qw(sha.c sha64bit.c); -my @hdrs = map { "src/$_" } qw(sha.h sha64bit.h); +my @srcs = map { File::Spec->catfile('src', $_) } qw(sha.c sha64bit.c); +my @hdrs = map { File::Spec->catfile('src', $_) } qw(sha.h sha64bit.h); my $deps = join(' ', @srcs, @hdrs); my %att = (
Yes, File::Spec is the standard way of portably joining parts of a path, but that won't work here: Digest::SHA needs to be portable to Perl 5.3, and File::Spec didn't appear until 5.4. Python provides 'os.sep' to allow manual construction of portable paths, but I don't see an equivalent thing in Perl. Unfortunately %Config gives the path separator only. There are many ways to work around this, but I'll have to reflect a bit on the cleanest one.
Subject: Re: [rt.cpan.org #83800] [PATCH] portability for new dependency logic
Date: Thu, 07 Mar 2013 12:25:13 -0600
To: bug-Digest-SHA [...] rt.cpan.org
From: "Craig A. Berry" <craigberry [...] mac.com>
On Mar 7, 2013, at 11:47 AM, Mark Shelor via RT <bug-Digest-SHA@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83800 > > > Yes, File::Spec is the standard way of portably joining parts of a path, > but that won't work here: Digest::SHA needs to be portable to Perl 5.3, > and File::Spec didn't appear until 5.4. > > Python provides 'os.sep' to allow manual construction of portable paths, > but I don't see an equivalent thing in Perl. Unfortunately %Config > gives the path separator only. > > There are many ways to work around this, but I'll have to reflect a bit > on the cleanest one.
The Makefile.PL for Time::HiRes says: # Perls 5.002 and 5.003 did not have File::Spec, fake what we need. and implements the code to do it. So copying that would be one alternative. Show quoted text
________________________________________ Craig A. Berry mailto:craigberry@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
Thanks to Craig Berry for patch and workaround suggestions, but it's simply easier to remove the dependency information from Makefile.PL. The rationale for inserting it originally was to make it easier to hack header and source files without having to do a 'make clean' on the distribution. Since this kind of hacking is rare, and since rebuilding from scratch costs only a few extra seconds, the value of the dependency information is marginal. Also, to handle paths portably back to Perl 5.3, using the "fake it" style of Time::HiRes, would cause the size of Makefile.PL to expand by about 50%: clearly not worth it for such a marginal gain.