2012Q2: Grant Proposal: Easy installation of non-CPAN dependencies

5 Comments
Name:

Alexandr Ciornii (CHORNY)

Amount Requested:

$2000

Synopsis

Many CPAN modules depend on non-CPAN libraries (or programs). Installation of such module requires that library be installed before installing CPAN module. For beginners it is more confusing as library may be installed, but its headers may not. I'd like to automate this step and install corresponding Linux package as part of module install.

Currently main module of this project has codename CPAN::non, it will be renamed later after discussion in module-authors mailing list.

Benefits to the Perl Community

  • For any user installing CPAN modules, as it will become much simpler. It is especially important when installing many modules or in case of inexpirienced user.

  • Module authors, because module installation will become easier and they would not need to periodically explain that users need to install non-CPAN library.

  • CPAN/OS porters, because dependencies will be listed more clearly, in future it may be also automated.

  • Package tools like Shipwright or carton can use CPAN::non to install OS packages.

Deliverables (to CPAN)

New version of Linux::Distribution. XML::Parser will automatically install expat (of course if user agrees). Module for yum interaction. CPAN::non and Module::Install plugin will be released.

Project Details

CPAN modules that want to get rid of this problem usually bundle libraries either directly or as Alien:: CPAN distributions. This creates several problems:

More work for authors and OS package maintainers
Duplication
Necessity to update library if serious problem is found
Necessity to replicate additional patches for every OS

But it is easy to install such dependency with OS tools. CPAN module will have configuration file that will specify build and runtime dependencies. CPAN::non will be bundled with module, or installed using configure_requires in META.yml/json. In future OS vendors may include it into their versions of Perl.

CPAN::non will detect version of Linux, check if dependency and its headers are installed, find out which name has dependency and headers on this OS from configuration file, install it.

For yum there is no module CPAN, I plan to write module for it. Also there is no general module that would be dist-neutral, so I will write it too.

Module::Install plugin will be convenient as Module::Install allows automating bundling of run-time dependencies.

XML::Parser will be used as a first test for CPAN::non as I have comaint rights for it.

Inch-stones

1. Improve tests and release new version of Linux::Distribution.
2. Test Linux::APT. Write/submit patches if necessary.
3. Install CentOS and Fedora. Write a module for yum interaction
4. Write and test an OS-independent module for software package installation (apt and yum)
5. CPAN::non - prototype
6. CPAN::non - write code
7. CPAN::non - test
8. CPAN::non - documentation
9. Use it in XML::Parser for expat
10. Module::Install plugin
11. Blog about it, help CPAN authors use it, improve main module if necessary

Project Schedule

The project will take 2-3 months. I will start right after grant approval.

Completeness Criteria

  • New versions of Linux::Distribution and XML::Parser.

  • CPAN::non, Module::Install plugin and module for yum released.

Future

This project is a working solution, but after it will be adopted, more interesting things may be implemented, like support for FreeBSD, even Windows, support in tools for OS package generation, etc.

Bio

I maintain many CPAN modules and fixed bugs in many more. Participated in such projects as Strawberry Perl, Padre, ExtUtils::MakeMaker and others. Contributed to Module::Install. My CPAN account: http://search.cpan.org/~chorny/ and Ohloh: https://www.ohloh.net/accounts/chorny/positions.

For 9 years I was a lead programmer of credit card payment system InterCardPro. Currently work for kariera.md.

5 Comments

This seems fairly useful. I'd like to hear from people working on the Perl module toolchain to see if this fits their vision of how this sort of thing should work.

I can only reiterate what Dave said. Seems interesting and useful.

This seems useful, and see also Devel::CheckLib. A nice-to-have would be a way of installing by a non-root user, presumably by downloading and building C source. This would, conveniently, also let you support every other platform.

Why not use PackageKit instead of getting into the messy details of apt/yum/emerge/etc?

If you look at the "What software uses the PackageKit session API?" section of their website, you see that it's regularly used for installing missing dependencies in a distro-agnostic way.

(http://www.packagekit.org/pk-users.html)

@Rolsky: I have great respect for Chornii's many contributions, but as a toolchain person, I'm concerned that the proposed project -- while well intentioned -- is very narrow. It is Linux only. It seems unnecessarily tied to Module::Install and bundling instead of using configure_requires (supported in core Perl since Perl v5.10.1).

It also only benefits those distributions which are written/revised to use the CPAN::nom shim. I'd be more interested in a general solution that could be used as a common tool by CPAN clients, complemented by improvements in MYMETA to output library prerequisites. That would allow *any* external-library-using module to benefit (provided a user upgrades their CPAN client -- a classic tradefoff).

Overall, I'm neutral. More innovation along these lines would be great, but this isn't the way I'd go about it.

Leave a comment

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at www.perlfoundation.org.

Recent Comments

  • David Golden: @Rolsky: I have great respect for Chornii's many contributions, but read more
  • Dee Newcum: Why not use PackageKit instead of getting into the messy read more
  • David Cantrell: This seems useful, and see also Devel::CheckLib. A nice-to-have would read more
  • Jonathan Scott duff: I can only reiterate what Dave said. Seems interesting and read more
  • Dave Rolsky: This seems fairly useful. I'd like to hear from people read more

About this Entry

This page contains a single entry by Alberto Simões published on May 3, 2012 3:01 PM.

Grant Accepted: Improving Devel::Cover was the previous entry in this blog.

2012Q2: Grant Proposal: Perl module for Linked Data is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38