not doing what i want
This commit is contained in:
parent
c021dd0ccc
commit
7075769a59
1 changed files with 98 additions and 0 deletions
98
build.pl
Executable file
98
build.pl
Executable file
|
@ -0,0 +1,98 @@
|
||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use v5.30;
|
||||||
|
|
||||||
|
use IO::Async;
|
||||||
|
use IO::Async::Function;
|
||||||
|
use IO::Async::Loop::Epoll;
|
||||||
|
use Getopt::Long;
|
||||||
|
use Future;
|
||||||
|
use Capture::Tiny qw(tee_merged);
|
||||||
|
use Path::Tiny;
|
||||||
|
|
||||||
|
|
||||||
|
my @bases = qw/bullseye-backports bookworm-backports/;
|
||||||
|
my @options = ("main", "main-threaded", "main-longdouble", "main-quadmath", "main-debugging", "main-longdouble-threaded", "main-quadmath-threaded", "main-debugging-threaded", "main-debugging-longdouble-threaded", "main-debugging-quadmath-threaded", "main-debugging-longdouble", "main-debugging-quadmath");
|
||||||
|
my @versions = ("5.20.3", "5.22.4", "5.24.4", "5.26.3", "5.28.3", "5.30.3", "5.32.1", "5.34.0", "5.34.1", "5.36.0");
|
||||||
|
my $max_workers = 8;
|
||||||
|
my $verbose = 1;
|
||||||
|
|
||||||
|
GetOptions('verbose' => \$verbose,
|
||||||
|
'quiet' => sub {$verbose = 0},
|
||||||
|
'workers=i' => \$max_workers,
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
my $loop = IO::Async::Loop::Epoll->new();
|
||||||
|
|
||||||
|
my $builder = IO::Async::Function->new(
|
||||||
|
code => sub {
|
||||||
|
my ( $version, $options, $os_base ) = @_;
|
||||||
|
|
||||||
|
my $expanded_version = $version =~ s/(?<major>5)\.(?<minor>\d+)\.(?<patch>\d+)/sprintf "%d.%03d.%03d", $+{major}, $+{minor}, $+{patch}/er;
|
||||||
|
|
||||||
|
my $tags = ["$version-$options-$os_base", "$expanded_version-$options-$os_base"];
|
||||||
|
|
||||||
|
my ($output, $return) = tee_merged sub {
|
||||||
|
my $workdir = path("output/perls")->child("$expanded_version-$options-$os_base");
|
||||||
|
|
||||||
|
if ($workdir->exists()) {
|
||||||
|
|
||||||
|
chdir($workdir);
|
||||||
|
#print "$workdir\n";
|
||||||
|
#system("ls");
|
||||||
|
} else {
|
||||||
|
print "Failed to find $workdir\n";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
},
|
||||||
|
|
||||||
|
max_workers => $max_workers,
|
||||||
|
min_workers => 1,
|
||||||
|
model => "fork",
|
||||||
|
);
|
||||||
|
|
||||||
|
$loop->add($builder);
|
||||||
|
$builder->start();
|
||||||
|
|
||||||
|
my %calls;
|
||||||
|
|
||||||
|
for my $version (@versions) {
|
||||||
|
for my $option (@options) {
|
||||||
|
for my $base (@bases) {
|
||||||
|
my $rend = "$version-$option-$base";
|
||||||
|
my $future = $builder->call(args => [$version, $option, $base])->on_ready(sub {
|
||||||
|
delete $calls{$rend};
|
||||||
|
});
|
||||||
|
$calls{$rend} = $future;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my $full_future = Future->wait_all( values %calls );
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
print "Is ready? ", $full_future->is_ready()?"yes":"no", "\n";
|
||||||
|
|
||||||
|
my @pending = $full_future->pending_futures;
|
||||||
|
|
||||||
|
print "Pending: ", 0+@pending, "\n";
|
||||||
|
print join(", ", keys %calls), "\n";
|
||||||
|
|
||||||
|
print "workers: ", $builder->workers, ", ", $builder->workers_idle, ", ", $builder->workers_busy, "\n";
|
||||||
|
|
||||||
|
$loop->delay_future(after => 1)->get();
|
||||||
|
|
||||||
|
if (@pending < 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my @result = $full_future->get();
|
||||||
|
|
||||||
|
use Data::Dumper;
|
||||||
|
print Dumper(\@result);
|
Loading…
Add table
Reference in a new issue