Hi Christoph, Ch Lamprecht wrote:
I will wait until I hear some feedback here.
I tested your patch (with slight modifications) and these initial, rough, tests seem to show everything is okay. The patch comes with no tests, however. I think we should figure out a way to add at least a few simple tests.
To make all of this easier, I just created a Module::ScanDeps branch "caching" at Module-ScanDeps/tags/caching and the corresponding "caching" branch of PAR::Packer in PAR-Packer/tags/caching. I committed your patch there (including my small adjustments). Please just commit your changes to that branch at will and send a quick reminder to the list if you'd like review. When we (or more importantly you) think the feature is mature (, documented, and somewhat tested), we can just merge the changes over to trunk.
There are some things I can think of improving: - Adding some kind of locking to the cache file.
Yes, that would be nice. But in reality, I can see little reason to run multiple instances of Module::ScanDeps in parallel... except... can you imagine "pp -j3"? ;P
- Loading the required Modules (Digest::MD5 and Storable) at runtime to avoid having to add these to PAR-Packer Prerequisites.
Adding dependencies to PAR::Packer is not a problem, actually. It's a developer-only module. Digest::MD5 and Storable are actually core modules, too, so that's even less of a problem. On the other hand, adding dependencies to PAR(.pm) would be very bad. Adding dependencies to Module::ScanDeps is okay if they're not heavy-weight.
Don't take this as gospel, though. Just apply reason!
- Caching-code could go to a seperate module which would then be used by PAR-Packer - Using a system wide default dependency file. Then one could simply use it like pp --use_cache
I'm not sure I like this last point. The caching seems like something the user (developer!) should be aware of. Without caching, we *know* everything is going to work. If the user wonders about the slowness, there should be a friendly hint that --use-cache will fix it. That's just my gut feeling, though. I'm open for discussion.
Actually, one more thought: Couldn't a system-wide cache be a mechanism to inject arbitrary code from the system into the pp'd executable?
Cheers, Steffen
