App-perlall
view release on metacpan or search on metacpan
script/perlall view on Meta::CPAN
$cmd = substr($cmd,3);
}
$c->_log('',"perl -i~ -ne'$cmd'",join(" ",@_)) if $inplace;
return if $c->options->{dryrun};
my $catch = '';
while (my $f = shift @_) {
next unless -f $f;
my $b = $f;
if ($inplace) {
$b .= "~";
unlink $b if -e $b; # does this work on windows?
rename($f, $b);
open($out, ">", $f);
select $out;
} else {
$out = IO::Scalar->new(\$catch);
select $out;
}
open(IN, "<", $b);
LINE: while (<IN>) {
eval $cmd;
}
close IN;
close $out;
}
select(STDOUT);
$catch;
}
# takes path to file and applies all os patches from HEAD up to blead
sub _patch {
my ($c, $file) = @_;
$c->_system("git show HEAD..blead $file | patch -N -p1")
and warn("patch HEAD..blead $file had some errors\n");
}
# like Porting/bisect-runner.pl apply_commit
sub _apply_commit {
my ($c, $commit, @files) = @_;
$c->_system("git show $commit @files | patch -N -p1")
and warn("cannot apply commit $commit".(@files ? " to @files":"")."\n");
}
sub _teardown {
my $c = shift;
close $c->stash->{log_fh} if $c->stash->{log_fh};
""
}
sub _fail {
my $c = shift;
if ($c->options->{verbose}) {
warn $c->{output}," at perlall line @{[(caller(0))[2]]}\n";
}
die "@_\n";
}
sub _glob_git {
my $c = shift;
my $git = shift;
return qw(smoke-me/scream smoke-me/taint.t ) if $c->options->{dryrun};
my $srcdir = $c->config->{'perl-git'};
my $cwd = Cwd::getcwd;
chdir "$srcdir/.git/refs/heads" or die;
# XXX expand subdirs with glob. smoke-me/s*: smoke-me/s/r => smoke-me/s
# => File::Find
my @git = glob $git;
chdir "../remotes/origin" or die;
push @git, glob $git;
chdir "../../tags" or die;
push @git, glob $git;
chdir $cwd or die;
return @git;
}
=head2 COMMANDS
=over
=item B<build> [OPTIONS] <version><suffix> [ branch|from ]
Build and install the given version of perl.
The optional 2nd argument C<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
C<@sproututf8> for C<sprout/utf8>, the binary name is taken from the
first argument. All unreleased git versions, like C<blead> or C<smoke-me>
branches get a C<@gitid> suffix. C<smoke-me/> is stripped from the
suffix. The special version "blead" denotes the latest version.
E.g. C<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 C<@> 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
C<-Dmksymlinks> is used for blead, unless the option C<--link> is
specified.
On cygwin and windows the F<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)
( run in 3.069 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )