Skip to content

Commit b25938d

Browse files
msimacektimfel
authored andcommitted
Improve logic of choosing graal-enterprise version when bisecting
1 parent 2ef8c34 commit b25938d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

mx.graalpython/mx_graalpython_bisect.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ def _bisect_benchmark(argv, bisect_id, email_to):
266266
primary_suite = mx.primary_suite()
267267

268268
def checkout_enterprise():
269+
# First try to get the revision we explicitly specify in ci-overlays. If that doesn't match with graal, then we
270+
# fall back on mx checkout-downstream
269271
suite = get_suite('graalpython')
272+
ce_suite = get_suite('/vm')
273+
ce_rev = ce_suite.vc.tip(ce_suite.vc_dir).strip()
270274
ee_suite = get_suite('/vm-enterprise')
271275
overlays = '../ci-overlays'
272276
if not os.path.isdir(overlays):
@@ -278,13 +282,20 @@ def checkout_enterprise():
278282
with open(constants_file) as f:
279283
ee_rev = json.load(f)['GRAAL_ENTERPRISE_REVISION']
280284
ee_suite.vc.update_to_branch(ee_suite.vc_dir, ee_rev)
285+
mx.run_mx(['sforceimports'], suite=ee_suite)
286+
if ce_suite.vc.tip(ce_suite.vc_dir).strip() != ce_rev:
287+
# The enterprise rev specified in ci-overlays imports newer graal than graalpython does. Fall back to
288+
# mx checkout-downstream to find older compatible enterprise rev
289+
ce_suite.vc.update_to_branch(ce_suite.vc_dir, ce_rev)
290+
mx.run_mx(['checkout-downstream', 'vm', 'vm-enterprise', '--no-fetch'], suite=ee_suite)
281291

282292
def checkout_suite(suite, commit):
283293
suite.vc.update_to_branch(suite.vc_dir, commit)
284294
mx.run_mx(['sforceimports'], suite=suite)
285295
mx.run_mx(['--env', 'ce', 'sforceimports'], suite=get_suite('/vm'))
286-
if args.enterprise and suite.name != 'vm-enterprise':
287-
checkout_enterprise()
296+
if args.enterprise:
297+
if suite.name != 'vm-enterprise':
298+
checkout_enterprise()
288299
# Make sure vm is imported before vm-enterprise
289300
get_suite('/vm')
290301
mx.run_mx(['--env', 'ee', 'sforceimports'], suite=get_suite('/vm-enterprise'))

0 commit comments

Comments
 (0)