Closed miyagawa closed 7 years ago
As I mentioned in Berlin, we could also make IO::Compress itself optional and -- if not available (or XS Raw not available) -- mirror the uncompressed version of the index instead (or die for a compressed local package).
What about IO::Zlib? It's in core, uses XS code if it's available, and may fallback to external gzip if not.
I want to resolve this issue and to make CPAN::Common::Index fatpack friendly with perl 5.8.
Currently CPAN::Common::Index depends on 2 modules
To make CPAN::Common::Index fatpack friendly, we need to eliminate these 2 dependencies.
I'm happy to create a pull request for these, but before that, I would like your comments. @xdg @miyagawa @eserte What do you think?
Theoretically IO::Zlib could be made shell meta character safe by using open "-|"
list syntax, at least on platforms which supports this (sadly, on Windows this is still unsupported).
Someone could test Path::Tiny with older Digest and see what happens if Digest::SHA is unavailable.
I'm open to the possibility of not requiring a version of Digest/Digest::SHA that mandates 5.10 for fatpacking, but I'd want to think carefully about it. Note that the prereqs are not enforced in the code, only in the Makefile.PL.
@xdg Because CPAN::Common::Index::Mirror uses File::Spec and File::Basename directly, I think we can use File::Spec and File::Basename directly in CPAN::Common::Index::LocalPackage.
My thoughts about IO::Compress:
@xdg Thank you for clarifying your thoughts. I understand portability should come first here, and I agree that external commands aren't portable.
Now I would like to work on (option a1).
This might not be the best place to discuss the issue, but:
CPAN::Common::Index depends on IO::Compress, which dependencies contain XS (Compress::Raw::Bzip2 and Compress::Raw::Zlib) https://metacpan.org/source/PMQS/IO-Compress-2.068/META.json#L35
They're part of core as of 5.10.0, but as I want to integrate CPAN::Common::Index to cpanm, that cannot be fatpacked back to 5.8.x.
I suppose the possible workaround would be: