You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit includes a lot of changes to how problematic cases are handled.
The basic idea is that first the code snippet is tested on good and bad
revisions (git is not doing that by default), and further behavior is adapted
according to that.
Also, 2015.12 is now used instead of v6.c.
my ($result, $exit_status) = get_output('git', 'rev-list', '-1', $str);
52
+
returnif$exit_status != 0;
53
+
return$result;
54
+
}
34
55
35
56
subsaid {
36
57
my ($self, $message) = @_;
37
58
if ($message->{body} =~ /^bisect:
38
59
(?:
39
-
(?: \s+ good (?: \s+ | \s*=\s*) ([\w\d.-]+) )
40
-
(?: \s+ bad (?: \s+ | \s*=\s*) ([\w\d.-]+) )?
60
+
(?: \s+ good (?: \s*=\s* | \s+) ([^\s]+) )
61
+
(?: \s+ bad (?: \s*=\s* | \s+) ([^\s]+) )?
41
62
|
42
-
(?: \s+ bad (?: \s+ | \s*=\s*) ([\w\d.-]+) )?
43
-
(?: \s+ good (?: \s+ | \s*=\s*) ([\w\d.-]+) )?
63
+
(?: \s+ bad (?: \s*=\s* | \s+) ([^\s]+) )?
64
+
(?: \s+ good (?: \s*=\s* | \s+) ([^\s]+) )?
44
65
)
45
66
(*PRUNE)
46
67
\s+ (.+)
47
68
/xu) {
48
69
if (defined$message->{address}) {
49
70
return'Sorry, it is too private here';
50
71
}
51
-
my$good = $1 // $4 // 'v6.c';
72
+
my$good = $1 // $4 // '2015.12';
52
73
my$bad = $2 // $3 // 'HEAD';
53
74
my$code = $5;
54
75
@@ -57,18 +78,70 @@ sub said {
57
78
print$fh$code;
58
79
close$fh;
59
80
60
-
my$dir = tempdir(CLEANUP=> 1);
61
81
# TODO use --no-checkout ?
62
-
system('git', 'clone', $rakudo, $dir);
63
82
my$oldDir = cwd;
83
+
84
+
# convert to real ids so we can look up the builds
85
+
chdir($rakudo);
86
+
$good = to_commit($good);
87
+
chdir($oldDir);
88
+
return"$message->{who}: cannot find such “good” revision"unlessdefined$good;
89
+
return"$message->{who}: no build for such “good” revision"if ! -e"$builds/$good/bin/perl6";
90
+
chdir($rakudo);
91
+
$bad = to_commit($bad);
92
+
chdir($oldDir);
93
+
return"$message->{who}: cannot find such “bad” revision"unlessdefined$bad;
94
+
if (! -e"$builds/$bad/bin/perl6"and-e$build_lock) {
95
+
# TODO fix the problem when it is building new commits
96
+
return"$message->{who}: no build for such “bad” revision. Right now the build process is in action, please try again later or specify some older “bad” commit (e.g. bad=HEAD~40)";
97
+
}
98
+
return"$message->{who}: no build for such “bad” revision"if ! -e"$builds/$bad/bin/perl6";
99
+
100
+
my ($out_good, $exit_good) = get_output("$builds/$good/bin/perl6", $filename);
101
+
my ($out_bad, $exit_bad) = get_output("$builds/$bad/bin/perl6", $filename);
102
+
if ($exit_good == $exit_badand$out_goodeq$out_bad) {
103
+
return"$message->{who}: on both starting points the exit code is $exit_bad and the output is identical as well";
104
+
}
105
+
my$output_file = '';
106
+
if ($exit_good == $exit_bad) {
107
+
$self->say(
108
+
channel=>$message->{channel},
109
+
body=>"$message->{who}: exit code is $exit_bad on both starting points, bisecting by using the output",
110
+
);
111
+
(my$fh, $output_file) = tempfile(UNLINK=> 1);
112
+
print$fh$out_good;
113
+
close$fh;
114
+
}
115
+
if ($exit_good != $exit_badand$exit_good != 0) {
116
+
$self->say(
117
+
channel=>$message->{channel},
118
+
body=>"$message->{who}: exit code on a “good” revision is $exit_good (which is bad), bisecting with inverted logic",
0 commit comments