Perl-Toolchain-Gang / CPAN-Common-Index

Common library for searching CPAN indexes
8 stars 10 forks source link

IO::Compress is not fatpack friendly #16

Closed miyagawa closed 7 years ago

miyagawa commented 9 years ago

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:

dagolden commented 9 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).

eserte commented 9 years ago

What about IO::Zlib? It's in core, uses XS code if it's available, and may fallback to external gzip if not.

skaji commented 7 years ago

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.

As for IO::Compress

As for Path::Tiny

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?

eserte commented 7 years ago

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).

xdg commented 7 years ago

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.

skaji commented 7 years ago

@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.

xdg commented 7 years ago

My thoughts about IO::Compress:

skaji commented 7 years ago

@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).