Skip to content

Commit 7222a04

Browse files
author
Carl Masak
committed
added 'toqast' target
This time with correctness.
1 parent c03db41 commit 7222a04

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

build-scripts/rebuild-toqast.pl

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env perl
2+
use strict;
3+
use warnings;
4+
use File::Path qw(rmtree);
5+
use 5.010;
6+
use autodie;
7+
use Data::Dumper;
8+
9+
chdir glob '~';
10+
11+
my $home = glob('~') . '/';
12+
my @dirs = qw(toqast-inst1 toqast-inst2);
13+
my %swap = (@dirs, reverse(@dirs));
14+
15+
my $link = 'toqast-inst';
16+
17+
my $now = readlink $link;
18+
my $other = $swap{$now};
19+
20+
say "Other: '$other'";
21+
chdir "${home}toqast/nqp";
22+
system('git', 'pull');
23+
chdir "${home}toqast";
24+
system('git', 'pull');
25+
26+
my $revision_file = "$home$other/rakudo-revision";
27+
eval {
28+
open my $fh, '<', $revision_file or break;
29+
my $r = <$fh>;
30+
close $fh;
31+
32+
chomp $r;
33+
my $needs_rebuild = `git rev-parse HEAD | grep ^$r|wc -l`;
34+
chomp $needs_rebuild;
35+
if ($needs_rebuild) {
36+
say "Don't need to rebuild, we are on the newest revision anyway";
37+
exit;
38+
}
39+
};
40+
41+
chdir "${home}toqast/nqp";
42+
system($^X, 'Configure.pl', '--with-parrot=../parrot/parrot');
43+
system('make', 'install') and die $?;
44+
chdir "${home}toqast";
45+
system($^X, 'Configure.pl', "--gen-parrot");
46+
system('make', 'install') and die $?;
47+
system('cp', '-r', <install/*>, "$home$other");
48+
system("git rev-parse HEAD | cut -b 1,2,3,4,5,6 > $revision_file") and warn $?;
49+
50+
chdir $home;
51+
unlink $link;
52+
symlink $other, $link;
53+

evalbot.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ package Evalbot;
6262
perl6 => [qw/rakudo niecza/],
6363
rn => [qw/rakudo niecza/ ],
6464
nr => [qw/rakudo niecza/ ],
65+
t => 'toqast',
6566
);
6667
$aliases{$_} = [qw/rakudo niecza pugs/] for qw/rnp rpn nrp npr prn pnr/;
6768

@@ -137,6 +138,12 @@ package Evalbot;
137138
cmd_line => './bin/perl6 --setting=SAFE %program',
138139
revision => sub { get_revision_from_file("$home/star/version") },
139140
},
141+
toqast => {
142+
chdir => "$home",
143+
cmd_line => './toqast-inst/bin/perl6 --setting=RESTRICTED %program',
144+
nolock => 1,
145+
revision => sub { get_revision_from_file('~/toqast-inst/rakudo-revision')},
146+
},
140147
# alpha => {
141148
# chdir => "$home/rakudo-alpha/",
142149
# cmd_line => 'PERL6LIB=lib ../rakudo-alpha/perl6 %program',

0 commit comments

Comments
 (0)