@@ -265,17 +265,15 @@ def _bisect_benchmark(argv, bisect_id, email_to):
265
265
parser .add_argument ('--no-clean' , action = 'store_true' , help = "Do not run 'mx clean' between runs" )
266
266
args = parser .parse_args (argv )
267
267
268
- def checkout_enterprise ():
269
- mx .run_mx (['checkout-downstream' , 'vm' , 'vm-enterprise' , '--no-fetch' ], suite = str (VM_ENTERPRISE_DIR ))
270
-
271
268
def checkout (repo_path : Path , commit ):
272
269
GIT .update_to_branch (repo_path , commit )
273
270
suite_dir = SUITE_MAPPING .get (repo_path , repo_path )
274
271
mx .run_mx (['sforceimports' ], suite = str (suite_dir ))
275
272
mx .run_mx (['--env' , 'ce' , 'sforceimports' ], suite = str (VM_DIR ))
276
273
if args .enterprise :
277
274
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 ))
279
277
mx .run_mx (['--env' , 'ee' , 'sforceimports' ], suite = str (VM_ENTERPRISE_DIR ))
280
278
GIT .update_to_branch (repo_path , commit )
281
279
mx .run_mx (['sforceimports' ], suite = str (suite_dir ))
@@ -284,8 +282,32 @@ def checkout(repo_path: Path, commit):
284
282
debug_str += f" graal-enterprise={ get_commit (GRAAL_ENTERPRISE_DIR )} "
285
283
print (debug_str )
286
284
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
+
287
308
def checkout_and_build (repo_path , commit ):
288
309
checkout (repo_path , commit )
310
+ os .environ ['JAVA_HOME' ] = fetch_jdk ()
289
311
build_command = shlex .split (args .build_command )
290
312
if not args .no_clean :
291
313
try :
0 commit comments