While testing a recently released module I came across a mysterious and generally useless error message from the CPAN installer. Well, technically it came from the makeutility, but the CPAN installer was the one supposedly in charge.
As we all know, the steps for installing a module are as follows. All repeat after me:
wget some/url/of/the/module.tgz # or otherwise get tar xvzf module.tgz cd module perl Makefile.PL make make test sudo make install
At least, that's how I do it, when I have to do it "by hand", though I prefer to use the CPAN installer.
perl -MCPAN -eshell install Some::Module q
But actually, the CPAN installer does pretty much the same steps as you would if you installed it yourself. Now back to that error message:
==> Your Makefile has been rebuilt. <== ==> Please rerun the make command. <== false
Of course, no matter how often I reran the make command it always failed with the same error. This was confusing because I'd just successfully installed other modules. Was something wrong with this particular module? After examining it, I couldn't find anything wrong. It was pretty much the same as the other modules, except it had been released more recently, but surely that couldn't matter, could it?
Well, yes, that was the problem, I'd been testing on a little-used machine that happened to have it's system date incorrectly set. It was three days behind the actual time. And the "broken" makefile happened to be less than that many days old. The effect was that when makewent to generate a new makefile, it moved the "old" one out of the way, and then (for reasons unknown, bad reasons) checked that the new makefile was newer than the previous makefile. In this situation the old one seemed to be created at a future time, so makefell over, with the before-mentioned mysterious and useless error message.
The ultimate solution was miles from where I originally thought the problem was. I just had to reset the system time to the current, and correct time (in this example the 24th of June, at 11:00 PM).
sudo date 24062300
