Skip to content

Commit 31a7278

Browse files
committed
[GR-27278] Fixes for bisection script
PullRequest: graalpython/1408
2 parents 7d51e57 + 4f76051 commit 31a7278

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

mx.graalpython/mx_graalpython_bisect.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def run_bisect_benchmark(suite, bad, good, callback, threshold=None):
122122
downstream_bad = get_commit(downstream_suite)
123123
subresults = {}
124124
if downstream_bad and downstream_good and downstream_bad != downstream_good:
125+
suite.vc.update_to_branch(suite.vc_dir, commits[good_index])
125126
subresult = run_bisect_benchmark(downstream_suite, downstream_bad, downstream_good, callback, threshold)
126127
subresults[bad_index] = subresult
127128
return BisectResult(suite, commits, values, good_index, bad_index, subresults)
@@ -142,17 +143,13 @@ def repo_name(self):
142143

143144
@property
144145
def good_commit(self):
145-
try:
146+
if 0 <= self.good_index < len(self.commits):
146147
return self.commits[self.good_index]
147-
except IndexError:
148-
return None
149148

150149
@property
151150
def bad_commit(self):
152-
try:
151+
if 0 <= self.bad_index < len(self.commits):
153152
return self.commits[self.bad_index]
154-
except IndexError:
155-
return None
156153

157154
def visualize(self, level=1):
158155
level_marker = '=' * level
@@ -212,15 +209,16 @@ def benchmark_callback(suite, commit):
212209
if fetched_enterprise[0]:
213210
checkout_args.append('--no-fetch')
214211
mx.run_mx(checkout_args, out=mx.OutputCapture())
212+
# Make sure vm is imported before vm-enterprise
213+
get_suite('/vm')
215214
mx.run_mx(['--env', 'ee', 'sforceimports'], suite=get_suite('/vm-enterprise'))
216215
fetched_enterprise[0] = True
217-
elif suite.name != 'vm':
218-
mx.run_mx(['--env', 'ce', 'sforceimports'], suite=get_suite('/vm'))
219216
suite.vc.update_to_branch(suite.vc_dir, commit)
220217
mx.run_mx(['sforceimports'], suite=suite)
218+
print("debug: graalpython={} graal={} graal-enterprise={}"
219+
.format(*(get_commit(get_suite(s)) for s in ('graalpython', '/vm', '/vm-enterprise'))))
221220
env = os.environ.copy()
222-
if 'CI' not in os.environ:
223-
env['MX_ALT_OUTPUT_ROOT'] = 'mxbuild-{}'.format(commit)
221+
env['MX_ALT_OUTPUT_ROOT'] = 'mxbuild-{}'.format(commit)
224222
retcode = mx.run(shlex.split(args.build_command), env=env, nonZeroIsFatal=False)
225223
if retcode:
226224
raise RuntimeError("Failed to execute the build command for {}".format(commit))

0 commit comments

Comments
 (0)