Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 70201
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

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

Bug Information
Severity: Wishlist
Broken in: 6.59
Fixed in: 6.73_09



Subject: [patch] replace -M with Time::HiRes::stat
Hi, The problem I'm trying to solve is when I build any module that contains EXE_FILES that are manified by ExtUtils::Command::MM::pod2man, which checks for timestamps for the resulting man page (and Makefile too). The logic it is using is correct, but modern machines are fast enough so takes less than a second to generate a pod, and the code using -M to check the file timestamp. Problem appears when after "make", which is run as a unprivileged user, I run then "sudo make install", -- but before installing, pod2man decides (wrongly!) that it needs to regenerate manpage, and does so - under root. Cleaning the distro then becomes impossible under normal user. Here I'm attaching a single patch that uses Time::HiRes::stat to fix this problem.
Subject: eumm.patch
--- MM.pm.0 2011-08-10 21:33:13.107912381 +0200 +++ MM.pm 2011-08-10 22:09:38.343916883 +0200 @@ -14,6 +14,8 @@ my $Is_VMS = $^O eq 'VMS'; +use Time::HiRes qw(stat); +sub mtime($) { (stat($_[0]))[9] } =head1 NAME @@ -131,8 +133,8 @@ my ($pod, $man) = splice(@ARGV, 0, 2); next if ((-e $man) && - (-M $man < -M $pod) && - (-M $man < -M "Makefile")); + (mtime $man > mtime $pod) && + (mtime $man > mtime "Makefile")); print "Manifying $man\n";
Thanks for the patch. I think it's a valid problem. Unfortunately using Time::HiRes is not that simple. Time::HiRes was introduced as a core module in 5.8.0. MakeMaker is backwards compatible to 5.6.0. Time::HiRes contains C code, so we cannot simply bundle it. So right now, MakeMaker cannot use Time::HiRes. One option is to use it if available and fallback to a normal stat() otherwise. Raising the minimum version to 5.8.1 is under serious consideration. I've added this ticket as an argument in favor. https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/5
Right, I wasn't sure if Time::HiRes is safe or not to use directly. Anyway, attached is the updated patch that can fall back to regular stat.
Subject: patch
Download patch
application/octet-stream 625b

Message body not shown because it is not plain text.

Hi, This has now been implemented in the EUMM code repository and will be available in a future stable CPAN release. Many thanks.
This is resolved with the 6.74 release to CPAN.