The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

perlall - build, test and do with all perls

SYNOPSIS

    perlall [opts] cmd [ what [ how ]]

    perlall build perl5.16.2
    perlall build bleadd-nt
    perlall build --allpatches perl5.14.2-nt
    perlall -v build -j4 bleadd-nt smoke-me/khw-tk
    perlall build perl5.15.5d-nt-blead-clang blead # or with --as
    perlall build --as perl5.15.5d-nt-blead-clang bleadd-nt
    perlall uninstall perl5.15.4d-nt@khw-tk

    perlall init perl5.15.4d-nt@blead DBI CPAN::SQLite $(cat ~/Perl/B-C/t/top100)
    perlall set perl5.16.2d

    perlall="5.1*" perlall do -MData::Dumper -e'my $a;$b={1=>\$a};$a=\$b;print Dumper($b)'
    perlall --older 5.12 make -Mblib t/0basic.t
    perlall=5.15.4  perlall maketest    # test with version as ENV
    perlall="5.14*" perlall makeinstall
    perlall cpan My::Module
    perlall cpanm More::Modules

    perlall -v maketest "5.*.d*" # test verbose with all debugging versions as option

    perlall testvm centos4 centos5 solaris10
    perlall initvm --all --max=6
    perlall testvm --all --fork -c=init # see testvm in .perlall
    perlall config
    perlall selfupgrade

Planned Features

    perlall maketest --all
    perlall smoke -j4 bleadd-nt smoke-me/*
    perlall=5*[0-9]-nt perlall bench [ what  [ how ]]
    perlall cpan Devel::*Prof*

OPTIONS

General options before the command:

    --skip=s      skip versions (glob-style) or --skip=outdated
                  versions might be a glob-style regex.
                  E.g. --skip '5.1[024]d*'
    --newer=s     only newer and same versions (glob-style)
                  globs may include the special arch suffix.
                  E.g. perlall do --newer "5.10.?d-nt"
    --older=s     only older versions. glob-style as in --newer.
    --nogit       skip @ git versions
    --main|-m     same as --skip=outdated,
                  only 5.6.2 5.8.[4589] 5.10.1 5.12.4 5.14.2 5.15.5
    --reverse|-r  oldest first. default is sorted by newest first

    --quiet|-q    make perlall command quieter
    --verbose|v   make perlall command say more
    --dryrun!     do not execute commands, only print
    --nolog       skip writing log file(s)
    --debug|-d,   lots of internal debugging output
    --timeout=i   IPC::Cmd::run timeout in seconds, Default: 0
    --gittag=s    Internally set by testvm for the logfile
    --forked!     Internally set by testvm

    --list|-l     shortcut for command list
    --help|-h
    --version|-V

Specific options after the command (see also below)

build and smoke only:

    --D=s           Configure option
    --A=s           Configure option
    --U=s           Configure option
    -jn             parallel make
    --link          -Dmksymlinks with blead, otherwise copy
    --install       skip Configure && make, only do make install
    --allpatches    apply also compiler and asan patches
    --patches=name  apply Compiler or Asan patches (Devel::PatchPerl::Plugin)

build and makeinstall:

  --notest|-n   skip the test suite on build and makeinstall
  --force|-f    force install

testvm: see "testvm"

DESCRIPTION

perlall is like a better perlbrew with a lot of testing features. The perls are in the default /usr/local/bin/, and /usr/local/lib/perl5/VERSION paths, instead of locally, and . You need write access to the default PREFIX /usr/local, e.g. via sudo. It does not use local::lib, does not mangle PERL5LIB and builds and keeps sane global perl installations with special suffices, without the need to save and restore internal states. The suffices are used in postprocessing scripts.

The currently used perl together with more options is stored as alias p in ~/.perlall, which can be sourced by your .profile.

    alias p=perl5.15.4d-nt

Build and init perls:

Version numbers look like 5.xx.x and the perl suffix can be any of:

    C<d>    DEBUGGING
    C<-nt>  non-threaded, or
    C<-m>   multi (non-threaded)
    C<@xxxxxx> git ids / branch names

You want to switch to use the "thr" suffix, then the default is non-threaded. This behaviour is controlled via the config setting usethrsuffix=1. But be consistent to interpret the logfiles.

For older perls special patches are applied to successfully build them. archname and the archlibs are extended by -debug and special git suffices. The installed perl binary and on windows the perl.dll ditto.

Platforms

I use and support perlall on cygwin, linux (debian+centos), freebsd, openbsd and solaris, with bash, dash and ksh. Supporting other platforms besides VMS should not be hard. freebsd needs sudo from ports. mingw (strawberry) and msys (mingw cross) support is planned.

Log Files

Most commands always create a log file with the command, platform and version, like log.maketest-centos5-5.10.1d-nt or log.makeinstall-osx10.6.8-5.15.4, log.build-osx10.6.8-5.15.4d-nt@30cb48da.

In the B::C perl-compiler distribution there are some post-processing scripts status_upd, store_rpt, download-reports for such logfiles.

Windows

Note in cmd.exe you need different quoting rules.

You can try: perlall do -e"""print $^O"""

But easier is: perlall do '-e"print $^O"'

COMMANDS

build [OPTIONS] <version><suffix> [ branch|from ]

Build and install the given version of perl.

The optional 2nd argument from can be a git tag/commit/branch id, e.g. a smoke-me branch, or a file or url with the perl-*.tar.gz. The branchname or commit-id is added to the archname and dll suffix, such as @sproututf8 for sprout/utf8, the binary name is taken from the first argument. All unreleased git versions, like blead or smoke-me branches get a @gitid suffix. smoke-me/ is stripped from the suffix. The special version "blead" denotes the latest version. E.g. perlall build blead-nt builds latest non-threaded.

If the checkout from a bit branch is not a release, the suffix will be marked with @ and the sources are copied to the builddir.

More special perl suffix rules:

  d     -DDEBUGGING
  -nt   non-threaded
  -m    multiplicity
  -clang -Dcc=clang
  -asan  clang -fsanitize=address
  -tsan  clang -fsanitize=thread
  -msan  clang -fsanitize=memory
  -ubsan clang -fsanitize=undefined
  -isan  clang -fsanitize=integer
  -dflow clang -fsanitize=dataflow
  -sstack clang -fsanitize=safestack
  -cps   clang-cps -fcps
  -cpi   clang-cps -fcpi
  -cow  -DPERL_NEW_COPY_ON_WRITE
  -mad  -Dmad

-Dmksymlinks is used for blead, unless the option --link is specified.

On cygwin and windows the perl*.dll also gets the suffix, because they are stored globally.

The specified perl is taken from a perl git repo (version or tag or branch) (specified via perl-git in ~/.perlall), or downloaded via CPAN. (not yet)

man files are not installed. This is the job for the default /usr/local/bin/perl or /usr/bin/perl.

-Dusedevel -Uversiononly is always used to install versioned executables.

Special site-specific non-default config vars are taken from /usr/local/bin/perl, such as cf_email, perladmin, ccflags, cc, ldflags, ld, pager, libpth, incpth, useshrplib.

The builddir is under PERLALL_BUILDROOT (Default: "/usr/src/perl") as "build-<version><suffix>" The intermediate "make install DESTDIR" as "inst-<version><suffix>".

Specific Options:

  -D.. -U.. -A..  pass through switches to the perl Configure script.

    perlall build perl5.10.1-nt -Dusemymalloc -Uuselargefiles

    Certain special switches are merged from F</usr/local/bin/perl> or F</usr/bin/perl>

  --as name     Install a given perl under the given name. (not yet)

    perlall build perl5.6.2 -Dusemymalloc --as perl5.6.2-mymalloc
    perlall build blead-nt smoke-me/test --as perl5.15.4-test

  -jnum         Enable parallel make and test (if supported by the target perl)

                perlall build -j5 perl5.12.3

  --link        Force -Dmksymlinks to the srcdir for blead only.
                Otherwise releases from git are copied anew.
  -n|--notest   Skip the test suite
  -f|--force    Force installation if make test fails.
  --install     skip Configure, make, make test. make install only.
install [ perl<version><suffix> [ from ]]

Same as build

uninstall perl<version><suffix>

Uninstalls the given version(s).

smoke [OPTIONS] perl<version><suffix> [ branch|from ]

Same as build, but reports the testresults to the smokers mailing list.

from may be a wildcard for multiple smoke branches, as smoke-me/*.

Description and OPTIONS see "build".

bench [OPTIONS] <version><suffix> [ how ]

Runs a short perl-core benchmark, and optionally a third-party script, automatically until the benchmark statistically stabilizes.

Rejects statistical outliers, heavy load, and does the iterations up to 2 seconds on shorter scripts.

Tested are array access, hash access, s///, in a tak with recursion and tail-recursion without IO to prevent too many external influences, though perl typically shines on IO.

init [perl<version><suffix> [--deps] [<modules>...]]
perlall="5.*" init [<modules>...]

Installs and updates basic CPAN modules.

Default: init-modules in ~/.perlall YAML DBI DBD::SQLite CPAN::SQLite Devel::Platform::Info \ Params::Util Bundle::CPANReporter2 \ B::Flags Opcodes Math::Round Params::Classify `cat ~/Perl/B-C/t/top100` \ Bundle::CygwinVendor YAML::XS DBIx::Class SQL::Abstract Module::Find Mouse \ MouseX::Types Task::Kensho

Specific Options:

  --cpan=-MCPAN
    Default: C<cpan>=C<cpan> or C<cpanm> in F<.perlall>
  --deps    scan blib/lib and t for modules with ack
list [version*]

List all installed perls available for perlall. Note that options after list are ignored.

set version

Set alias p in .perlall

do [<version>] commands...

Execute commands with all perls.

Specific Options:

  --verbose|-v
  --quiet|-q
  --dryrun
  --forked
  --gittag="hex"

All other options and arguments are passed through to the perl.

For example, run a Hello program:

    perlall do -E'say "Hello from $]"'

is expanded to something like:

  for perl in /usr/local/bin/perl5*; do
    p=$perl
    echo $perl $*
    $perl $*
  done

Better restricts perls via ENV:

  perlall="5.14.*d*" perlall do -E'say "Hello from $]"'

is expanded to something like:

  for perl in /usr/local/bin/perl5.14.*d*; do
    p=$perl
    echo $p $*
    $p $*
  done

The output depends on your perl installations, and looks like this:

    perl5.12.2-nt -E'say "Hello from $]"'
    Hello from perl-5.012002

    perl5.12.3-m -E'say "Hello from $]"'
    Hello from perl-5.012003

    perl5.14.2 -E'say "Hello from $]"'
    Hello from perl-5.014002

    perl5.14.2d -E'say "Hello from $]"'
    Hello from perl-5.014002

    perl5.14.2d-nt -E'say "Hello from $]"'
    Hello from perl-5.014002

    perl5.8.9-nt -E'say "Hello from $]"'
    Unrecognized switch: -E  (-h will show valid options).

    perl5.6.2-nt -E'say "Hello from $]"'
    Unrecognized switch: -E  (-h will show valid options).

Notice that the commands are not executed in parallel.

cpan modules

like perlall do, but calls perl5.* -S cpan args... for all perls

cpanm modules

like perlall cpan, but uses cpanm.

Note: --sudo is very common argument passed trough.

make [commands...]

like perlall do, but prepends make -s clean; $p Makefile.PL; make before executing the arguments. $p is expanded to the currently run perl.

perlall is also Build.PL aware but prefers Makefile.PL.

    perlall make '-e1 && valgrind \$p -Mblib test.pl'

Specific Options:

  --verbose|-v
  --quiet|-q
  --dryrun
  --forked
  --gittag="hex"

All other options and arguments are passed through to the perl.

maketest [commands...]

like perlall make, but runs make test TEST_VERBOSE=1 after make. This is the most used command.

On --quiet or -q does not do TEST_VERBOSE=1

Specific Options:

  --verbose|-v
  --quiet|-q
  --dryrun
  --forked
  --gittag="hex"

All other options and arguments are passed through to the perl.

makeinstall [commands...]

like perlall maketest, but runs sudo make install after make test.

Specific Options:

  --force|-f
  --notest|-n
testvm [OPTIONS] [user@]hostname...

Does perlall maketest in parallel on remote machines. testvm is only usable within a perl core builddir/srcdir or in a module rootdir. It shells out to ssh account(s), copies the files in MANIFEST to the machine, runs perlall maketest there and copies the logfiles back.

Specific Options:

    --all|a    - all hosts defined in config C<testvm>
    --up       - only upload (files from local MANIFEST)
    --cmd|c=<remotecmd> any valid perlall command, like
               build, init, makeinstall, smoke. Default: maketest
    --option|o="" remaining remote perlall cmd options and args
    --max|j 4  - how many machines in parallel.
    --fork     - test in parallel and do not wait for the results,
                 just gather logfiles
    --prefix|p=Perl - remote basedir if different to local basedir

Config settings:

    testvm="[user@]hostnames..."
    testvm_prefix=Perl - relative remote basepath of your modules
          i.e. local basename = B-Generate => remote: vmhost:Perl/B-Generate
    testvm_max=4       - balancing, default for -j
    testvm_ctl=virsh   - type of vm ctl: virsh, xen-shell, vmrun, VBoXManage

VM Balancing:

    If the remote hosts are VM's on this machine, you can control how many
    VM's should run in parallel, and how they are started and stopped.

    Currently only C<virsh> is supported to resume a paused vm and start
    a stopped vm. C<--max> is yet ignored.

    If C<testvm_ctl> is not set, no balancing - start+shutdown - will be done,
    such as on physical hosts or enough VM power.
    See F<.perlall>
initvm [--all] user@[hostname]...

copies pubkey to host:.ssh/authorized_keys if not exists

copies perlall to host:bin/ (if perlbin is installed at /usr/local/bin/ then symlink to it)

ssh hostname perlall -v init App::Rad IO::Scalar Devel::Platform::Info Devel::PatchPerl

config (var (value))
selfupgrade [ --latest ]

This command upgrades perlall to its latest or stable version.

help

prints this help. With -v even more.

version

CONFIGURATION

Stored in ~/.perlall or /etc/perlall

This is shell-script syntax with ENV vars and aliases. alias p=$perlall is also written by perlall.

It is recommended to source this from your .profile for the handy aliases.

alias p=perl5.15.4d-nt

Save current perl in shell alias form.

This is stored after each perlall execution. Dependend on p there are several other handy p aliases, which are active if you source them from your ~/.profile See .perlall

alias perl-git="cd /usr/src/perl/blead/perl-git"

Directory with a perl5 git repo to avoid downloading perl-*.tar.gz from CPAN, in shell alias form.

perl-git stores the perl git workdir, and is also a handy alias to cd into it. =item alias cdcperl="cd /usr/src/perl/blead/cdcperl"

Directory with a cperl git repo in shell alias form.

cdcperl stores the cperl git workdir, and is also a handy alias to cd into it

PERLALL_PREFIX

Where perls are installed into. Default: /usr/local

PERLALL_BINDIR

Where perl5.* binaries are expected. Currently built into PERLALL_PREFIX/bin only.

Default: PREFIX/bin but can also be ~/perl5/perlbrew/bin

PERLALL_BUILDROOT

Where perls are built. Default: /usr/src/perl

cpan

For init only.

cpan or cpanm (-MCPAN not yet)

init-modules

List of CPAN module names for init

sudo

Default: "sudo". Or "" on cygwin|msys|MSWin32

testvm

See "testvm".

SEE ALSO

The bash scripts, which I used for some years: http://github.com/rurban/dot-bin/blob/master/perlall-makeinstall

App::perlbrew which is good for complete private unshared installations. It looked like my bash scripts and perlall, but cannot be used as easily.

App::SmokeBrew which also builds a lot of perls to smoke cpan releases with them.

COPYRIGHT

This software is copyright (c) 2011,2012 by cPanel Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.