develooper Front page | | Postings from June 2010

Tweak t/lib/ to work with ccache in core

Nicholas Clark
June 29, 2010 10:46
Tweak t/lib/ to work with ccache in core
Message ID:
I found I needed to make this change to t/lib/ to get it to work in
the perl core on machines using ccache.

Without it, $ENV{HOME} is set to a relative path, because at the time that the
BEGIN block runs to sets it, $cwd is not yet initialised, hence original_cwd()
returns a relative path, and then ccache gets upset and exits without
compiling, because it can't create $ENV{HOME}/.ccache

Nicholas Clark

----- Forwarded message from Nicholas Clark <> -----

Delivery-date: Tue, 29 Jun 2010 18:40:37 +0100
Mailing-List: contact; run by ezmlm
Delivered-To: mailing list
From: "Nicholas Clark" <>
Subject: [perl.git]  branch blead, updated. v5.13.2-103-ge812e1e
Reply-To: "Perl5 Porters" <>
Date: Tue, 29 Jun 2010 19:40:23 +0200

In perl.git, the branch blead has been updated


- Log -----------------------------------------------------------------
commit e812e1e8e98e6f2cf4362feff753023052129851
Author: Nicholas Clark <>
Date:   Tue Jun 29 18:25:29 2010 +0100

    When testing in core, ensure that the local $ENV{HOME} is absolute.
    Without this ppm.t and xs.t fail with ccache, because it can't create

Summary of changes:
 cpan/Module-Build/t/lib/ |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/cpan/Module-Build/t/lib/ b/cpan/Module-Build/t/lib/
index 005920f..bf3cebd 100644
--- a/cpan/Module-Build/t/lib/
+++ b/cpan/Module-Build/t/lib/
@@ -97,8 +97,12 @@ __PACKAGE__->export(scalar caller, @extra_exports);
 # always return to the current directory
-  my $cwd = File::Spec->rel2abs(Cwd::cwd);
+  my $cwd;
+  BEGIN {
+    $cwd = File::Spec->rel2abs(Cwd::cwd);
+  }
+  # This is called at BEGIN time below, so anything it uses must be initialised
   sub original_cwd { return $cwd }
   END {

Perl5 Master Repository

----- End forwarded message ----- Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About