On Sat Jun 13 15:54:10 2009, FREQUENCY wrote:
Show quoted text> If you subclass Module::Build and change directories, then notes fail to
> be written to disk. Granted, this is more of an issue with my usage of
> the module, but it would have been nice (and saved me a bit of time) if
> Module::Build croaked when trying to set notes outside of the initial
> working directory, or if an absolute path is passed to
> Module::Build::Notes so that notes can be written per normal.
All of the serialization stuff in Module::Build assumes that you won't
change directories, or that you'll change back to the original directory
before it writes stuff out. The test suite actually works pretty hard to
enforce this, actually, so that things don't get screwed up. I can see
how mention of this in the docs would be useful. How's this?
Index: Authoring.pod
===================================================================
--- Authoring.pod (revision 12873)
+++ Authoring.pod (working copy)
@@ -102,7 +102,10 @@
C<create_build_script()> method will ensure that the current value of
C<@INC> (including the C</nonstandard/library/path>) is propogated to
the Build script, so that My::Builder can be found when running build
-actions.
+actions. If you find that you need to C<chdir> into different directories
+in your subclass methods or actions, be sure to always return to the
original
+directory (available via the C<base_dir()> method) before returning control
+to the parent class. This is important to avoid data serialization
problems.
For very small additions, Module::Build provides a C<subclass()>
method that lets you subclass Module::Build more conveniently, without
Best,
David