in reply to Re^5: Why is it in some other popular languages fewer steps and potential issues when installing libraries no testing needed and no compilation of C/C++ code done
in thread Why are other popular languages very different from Perl when installing libraries, e.g. no testing needed and no compilation of C/C++ code done

Here's a wild thought -- isn't there a single, easy-to-use tool that will automatically download, test, and install Perl modules for a particular environment like App::Magpie does for Mageia Linux, but using something like local::lib?

Maybe you didn't see the synopsis for local::lib, but yes, there is such a tool, and its called cpan/cpanp/cpanm, local::lib isn't required or even necessary

You can then simply copy/rsync the lib to your target machines.

If you have rsync, compile install perl in your home directory, and simply rsync the entire perl tree

  • Comment on Re^6: Why is it in some other popular languages fewer steps and potential issues when installing libraries no testing needed and no compilation of C/C++ code done

Replies are listed 'Best First'.
Re^7: Why is it in some other popular languages fewer steps and potential issues when installing libraries no testing needed and no compilation of C/C++ code done
by InfiniteSilence (Curate) on Apr 12, 2011 at 13:13 UTC

    Maybe you didn't see the synopsis for local::lib, but yes, there is such a tool, and its called cpan/cpanp/cpanm, local::lib isn't required or even necessary ...

    Maybe I'm a little slow on the uptake or something but I don't see how an interactive cpan client this solves the problem. I was saying that a good solution would be something that would work automatically -- that is, without human intervention -- to download and compile some specified list of modules and log all errors on a particular target system.

    Lots of times I get excited about a particular module until I get a list of target systems and then try to compile all of the existing modules and their dependencies. Sure enough, one or more of the modules' dependencies fails tests, so I need to roll up my sleeves and figure out whether the features that do not work are even going to be used. If not, I'll then see if I can get away with a forced install. Otherwise, I have to blacklist that module version for all of my target machines until the problem is fixed or I get around to fixing it.

    What would help in this process is to have a 'helper' that runs off and compiles my modules in a safe directory and logs all errors in a nice format OR tells me that everything compiled cleanly. This should happen, I'm guessing, once per night and should check for the latest versions of all of my modules before it does this.

    Now, specifically, how could I accomplish that?

    Celebrate Intellectual Diversity

      Maybe I'm a little slow on the uptake or something but I don't see how an interactive cpan client this solves the problem. I was saying that a good solution would be something that would work automatically -- that is, without human intervention -- to download and compile some specified list of modules and log all errors on a particular target system.

      All you have to do is not run cpan/cpanp/cpanm in interactive mode :)

      Now, specifically, how could I accomplish that?

      You configure cpan/cpanp/cpanm to
      run non-interactive
      keep logs
      install modules in a certain perfix
      ...
      then you run it, something like this:
      set PERL_MM_USE_DEFAULT=1 set PERL5_CPANPLUS_TEST_VERBOSE=1 set TEST_VERBOSE=1 set PERL5LIB=/home/user/stuff/lib/perl5 set PERL_MB_OPT=--install_base /home/user/stuff set PERL_MM_OPT=INSTALL_BASE=/home/user/stuff set PERL_CPANM_HOME=/home/user/stuff/.cpanm cpan-outdated -p | cpanm cat /home/user/stuff/.cpanm/build.log

        Crud! You know what I just realized...we can't really trust the tests that come from CPAN modules in all cases. Take the following example from GoogleProvisioningAPI:

        Google-ProvisioningAPI-0.11/t/Google-ProvisioningAPI.t # Before `make install' is performed this script should be runnable wi +th # `make test'. After `make install' it should work as `perl Google-Pro +visioningA PI.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; BEGIN { use_ok('Google::ProvisioningAPI') }; ######################### # Insert your test code below, the Test::More module is use()ed here s +o read # its man page ( perldoc Test::More ) for help writing this test scrip +t.

        That's it. Given such scant testing it is impossible to determine whether updates or changes to the module will break existing code.

        Celebrate Intellectual Diversity