Skip to content

Commit 5c42ad3

Browse files
committed
Fetch exact JDK when bisecting
1 parent 5a42a53 commit 5c42ad3

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

mx.graalpython/mx_graalpython_bisect.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,17 +265,15 @@ def _bisect_benchmark(argv, bisect_id, email_to):
265265
parser.add_argument('--no-clean', action='store_true', help="Do not run 'mx clean' between runs")
266266
args = parser.parse_args(argv)
267267

268-
def checkout_enterprise():
269-
mx.run_mx(['checkout-downstream', 'vm', 'vm-enterprise', '--no-fetch'], suite=str(VM_ENTERPRISE_DIR))
270-
271268
def checkout(repo_path: Path, commit):
272269
GIT.update_to_branch(repo_path, commit)
273270
suite_dir = SUITE_MAPPING.get(repo_path, repo_path)
274271
mx.run_mx(['sforceimports'], suite=str(suite_dir))
275272
mx.run_mx(['--env', 'ce', 'sforceimports'], suite=str(VM_DIR))
276273
if args.enterprise:
277274
if repo_path.name != 'graal-enterprise':
278-
checkout_enterprise()
275+
mx.run_mx(['--quiet', 'checkout-downstream', 'vm', 'vm-enterprise', '--no-fetch'],
276+
suite=str(VM_ENTERPRISE_DIR))
279277
mx.run_mx(['--env', 'ee', 'sforceimports'], suite=str(VM_ENTERPRISE_DIR))
280278
GIT.update_to_branch(repo_path, commit)
281279
mx.run_mx(['sforceimports'], suite=str(suite_dir))
@@ -284,8 +282,32 @@ def checkout(repo_path: Path, commit):
284282
debug_str += f" graal-enterprise={get_commit(GRAAL_ENTERPRISE_DIR)}"
285283
print(debug_str)
286284

285+
def fetch_jdk():
286+
import mx_fetchjdk
287+
if args.enterprise:
288+
fetch_args = [
289+
'--configuration', str(GRAAL_ENTERPRISE_DIR / 'common.json'),
290+
'--jdk-binaries', str(GRAAL_ENTERPRISE_DIR / 'ci' / 'jdk-binaries.json'),
291+
'labsjdk-ee-latest',
292+
]
293+
else:
294+
fetch_args = [
295+
'--configuration', str(GRAAL_DIR / 'common.json'),
296+
'labsjdk-ce-latest',
297+
]
298+
# Awkward way to suppress the confirmation prompt
299+
ci = 'CI' in os.environ
300+
if not ci:
301+
os.environ['CI'] = '1'
302+
try:
303+
return mx_fetchjdk.fetch_jdk(fetch_args)
304+
finally:
305+
if not ci:
306+
del os.environ['CI']
307+
287308
def checkout_and_build(repo_path, commit):
288309
checkout(repo_path, commit)
310+
os.environ['JAVA_HOME'] = fetch_jdk()
289311
build_command = shlex.split(args.build_command)
290312
if not args.no_clean:
291313
try:

0 commit comments

Comments
 (0)