Skip to content
This repository was archived by the owner on May 10, 2022. It is now read-only.

Commit c978185

Browse files
committed
Add --no-build option
1 parent 2a94e24 commit c978185

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ toasting results for each of the toasted module, and each of the given commits.
8888
perl6 bin/toaster-perl6 2017.03 2017.05 some-branch master 64e898f9baa159e2019
8989
```
9090

91+
The binary supports `--no-build` command line flag, which will avoid compiling the compiler. This
92+
option is handy to use when a previous toasting sessions was interrupted for some reason. You can
93+
restart the toast using the already-built compiler.
94+
9195
# Viewing
9296

9397
## Perl Mojolicious

bin/toaster-perl6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use lib <lib>;
33
use Toaster;
44
use WhereList;
55

6-
sub MAIN (*@commits where all-items(Str, *.so)) {
6+
sub MAIN (*@commits where all-items(Str, *.so), Bool :$no-build) {
77
@commits ||= 'master';
8-
Toaster.new.toast-all: $_ for @commits;
8+
Toaster.new.toast-all: $_, :$no-build for @commits;
99
}

lib/Toaster.pm6

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ my $batch = floor 1.3 * do with run 'lscpu', :out, :!err {
4040
} || 8;
4141

4242

43-
method toast-all ($commit = 'master') {
43+
method toast-all ($commit = 'master', Bool :$no-build) {
4444
my @modules = jget(ECO_API)<dists>.map(*.<name>).sort
4545
.grep: *.match: BANNED_MODULES.none;
4646
say "About to toast {+@modules} modules";
4747
self.toast: @modules, $commit;
4848
}
49-
method toast (@modules, $commit = 'master') {
49+
method toast (@modules, $commit = 'master', Bool :$no-build) {
5050
temp %*ENV;
51-
%*ENV<PATH> = self.build-rakudo: $commit;
51+
%*ENV<PATH> = self.build-rakudo: $commit, :$no-build;
5252
%*ENV<ALL_TESTING NETWORK_TESTING ONLINE_TESTING> = 1, 1, 1;
5353
say "Toasting with path %*ENV<PATH>";
5454
my $ver = shell(:out, :!err,
@@ -83,23 +83,28 @@ method toast (@modules, $commit = 'master') {
8383
toast-it toast-it @modules;
8484
}
8585

86-
method build-rakudo (Str:D $commit = 'master') {
87-
say "Starting to build rakudo $commit";
86+
method build-rakudo (Str:D $commit = 'master', Bool :$no-build) {
87+
say $no-build ?? "Trying to use exisitng build for rakudo $commit"
88+
!! "Starting to build rakudo $commit";
8889
indir RAKUDO_BUILD_DIR, {
8990
my $com-dir = $commit.subst: :g, /\W/, '_';
90-
$ = run «rm -fr "$com-dir"»;
91-
run «git clone "{RAKUDO_REPO}" "$com-dir"»;
91+
unless $no-build {
92+
$ = run «rm -fr "$com-dir"»;
93+
run «git clone "{RAKUDO_REPO}" "$com-dir"»;
94+
}
9295
indir $*CWD.add($com-dir), {
93-
run «git checkout "$commit"»;
94-
say "Checkout done";
95-
run «perl Configure.pl --gen-moar --gen-nqp --backends=moar»;
96-
run «make»;
97-
run «make install»;
98-
run «git clone "{ZEF_REPO}"»;
96+
unless $no-build {
97+
run «git checkout "$commit"»;
98+
say "Checkout done";
99+
run «perl Configure.pl --gen-moar --gen-nqp --backends=moar»;
100+
run «make»;
101+
run «make install»;
102+
run «git clone "{ZEF_REPO}"»;
103+
}
99104

100105
temp %*ENV;
101106
%*ENV<PATH> = $*CWD.add('install/bin').absolute ~ ":%*ENV<PATH>";
102-
indir $*CWD.add('zef'), { run «perl6 -Ilib bin/zef install . » }
107+
$no-build || indir $*CWD.add('zef'), { run «perl6 -Ilib bin/zef install . » }
103108
%*ENV<PATH> = $*CWD.add('install/share/perl6/site/bin')
104109
.absolute ~ ":%*ENV<PATH>";
105110

0 commit comments

Comments
 (0)