App-grindperl

 view release on metacpan or  search on metacpan

bin/grindperl  view on Meta::CPAN


These commands are intended to be run from within a clone of
the Perl git repository.

  # Configure && make && make test (in parallel)
  $ grindperl

  # Configure && make && make test_porting (in parallel)
  $ grindperl --porting

  # Same as first example, but without threads
  $ grindperl --no-threads

  # Configure/make/test and install
  $ grindperl --prefix=/opt/perl/blead --install

=head1 DESCRIPTION

Hacking on the Perl source tree requires one to regularly build and test.  The
C<< grindperl >> tool helps automate some common configuration, build and test
tasks.  Most Perl 5 porters have written something like this and I'm putting
mine on CPAN to help new (or less automated) contributors.

Instead of typing this:

  $ ./Configure -des -Dusedevel -Dcc='ccache=gcc' \
    -Dprefix=/tmp/blead-$(git describe) -DDEBUGGING \
    -Dusethreads
  $ make -j 9 test_prep
  $ TEST_JOBS=9 make test_harness

You can just type this:

  $ grindperl

If you want to run C<< make test_porting >> before committing or before
merging a submitted patch -- which is strongly encouraged -- that is
as easy as:

bin/grindperl  view on Meta::CPAN


depending on various options

=back

If anything fails along the way, C<< grindperl >> will stop with an error message.

=head1 OPTIONS

Any boolean options that default to true may be negated by prefixing their long
form with C<< no- >>, e.g. C<< --no-threads >>.

=head2 --config

Boolean flag.  When set, C<< grindperl >> will halt after running C<< Configure >>.
Default is false.

=head2 --jobs=N or -j N

Controls how many parallel make jobs to run.  Defaults to 9.

bin/grindperl  view on Meta::CPAN

=head2 --install_root

A base path for a generated default C<< --prefix >>. The default install root
is C<< /tmp >>.  This needs to be a directory for which you have write
permissions.

=head2 --debugging

Boolean flag.  Sets C<< -DDEBUGGING >>.  Default is true.

=head2 --threads

Boolean flag.  Sets C<< -Dusethreads >>.  Default is true.

=head2 --cache

Boolean flag.  When true, C<< grindperl >> will save your C<< config.sh >>
and C<< Policy.sh >> files to a hidden cache file.  If these files
exist, it will restore them and run C<< Configure >> with the C<< -r >> option.

Using cached config files from a different commit can break things
and is not recommended.

lib/App/grindperl.pm  view on Meta::CPAN

    unshift @ARGV, $self->read_config_file;
  }

  my $opt = Getopt::Lucid->getopt([
    Param("jobs|j")->default(9),
    Param("testjobs|t")->default(9),
    Param("output|o"),
    Param("install_root")->default(File::Spec->tmpdir),
    Param("prefix"),
    Switch("debugging")->default(1),
    Switch("threads")->default(1),
    Switch("32"),
    Switch("porting|p"),
    Switch("install"),
    Switch("config"),
    Switch("cache"),
    Switch("man"),
    Switch("edit"),
    Switch("verbose|v"),
    Keypair("additions|A"),
    Keypair("define|D"),

lib/App/grindperl.pm  view on Meta::CPAN

    return dir($root)->subdir("$perldir-" . time());
  }
}

sub configure_args {
  my ($self) = @_;
  my %defines = $self->opt->get_define;
  my @undefines = $self->opt->get_undefine;
  my %additions = $self->opt->get_additions;
  my @args = qw/-des -Dusedevel -Uversiononly/;
  push @args, "-Dusethreads" if $self->opt->get_threads;
  push @args, "-DDEBUGGING" if $self->opt->get_debugging;
  push @args, "-Accflags=-m32", "-Alddlflags=-m32", "-Aldflags=-m32",
    "-Uuse64bitint", "-Uuse64bitall", "-Uusemorebits"
    if $self->opt->get_32;
  push @args, "-r" if $self->opt->get_cache;
  if ( ! $self->opt->get_man ) {
    push @args, qw/-Dman1dir=none -Dman3dir=none/;
  }
  push @args, map { "-D$_=$defines{$_}" } keys %defines;
  push @args, map { "-U$_" } @undefines;



( run in 0.375 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )