@@ -2409,9 +2409,12 @@ def write_pivot_section(row):
2409
2409
2410
2410
2411
2411
def determine_coredis_tools (coreclr_args ):
2412
- """ Determine the coredistools location. First, look in Core_Root. It will be there if
2413
- the setup-stress-dependencies.cmd/sh script has been run, which is typically only
2414
- if tests have been run. If unable to find coredistools, download it from a cached
2412
+ """ Determine the coredistools location in one of several locations:
2413
+ 1. First, look in Core_Root. It will be there if the setup-stress-dependencies.cmd/sh
2414
+ script has been run, which is typically only if tests have been run.
2415
+ 2. The build appears to restore it and put it in the R2RDump sub-directory. Look there.
2416
+ Copy it to the Core_Root directory if found.
2417
+ 3. If unable to find coredistools, download it from a cached
2415
2418
copy in the CLRJIT Azure Storage. (Ideally, we would instead download the NuGet
2416
2419
package and extract it using the same mechanism as setup-stress-dependencies
2417
2420
instead of having our own copy in Azure Storage).
@@ -2440,16 +2443,22 @@ def determine_coredis_tools(coreclr_args):
2440
2443
if os .path .isfile (coredistools_location ):
2441
2444
logging .info ("Using coredistools found at %s" , coredistools_location )
2442
2445
else :
2443
- # Often, Core_Root will already exist. However, you can do a product build without
2444
- # creating a Core_Root, and successfully run replay or asm diffs, if we just create Core_Root
2445
- # and copy coredistools there. Note that our replays all depend on Core_Root existing, as we
2446
- # set the current directory to Core_Root before running superpmi.
2447
- if not os .path .isdir (coreclr_args .core_root ):
2448
- logging .warning ("Warning: Core_Root does not exist at \" %s\" ; creating it now" , coreclr_args .core_root )
2449
- os .makedirs (coreclr_args .core_root )
2450
- coredistools_uri = az_blob_storage_superpmi_container_uri + "/libcoredistools/{}-{}/{}" .format (coreclr_args .host_os .lower (), coreclr_args .arch .lower (), coredistools_dll_name )
2451
- skip_progress = hasattr (coreclr_args , 'no_progress' ) and coreclr_args .no_progress
2452
- download_one_url (coredistools_uri , coredistools_location , is_azure_storage = True , display_progress = not skip_progress )
2446
+ coredistools_r2rdump_location = os .path .join (coreclr_args .core_root , "R2RDump" , coredistools_dll_name )
2447
+ if os .path .isfile (coredistools_r2rdump_location ):
2448
+ logging .info ("Using coredistools found at %s (copying to %s)" , coredistools_r2rdump_location , coredistools_location )
2449
+ logging .debug ("Copying %s -> %s" , coredistools_r2rdump_location , coredistools_location )
2450
+ shutil .copy2 (coredistools_r2rdump_location , coredistools_location )
2451
+ else :
2452
+ # Often, Core_Root will already exist. However, you can do a product build without
2453
+ # creating a Core_Root, and successfully run replay or asm diffs, if we just create Core_Root
2454
+ # and copy coredistools there. Note that our replays all depend on Core_Root existing, as we
2455
+ # set the current directory to Core_Root before running superpmi.
2456
+ if not os .path .isdir (coreclr_args .core_root ):
2457
+ logging .warning ("Warning: Core_Root does not exist at \" %s\" ; creating it now" , coreclr_args .core_root )
2458
+ os .makedirs (coreclr_args .core_root )
2459
+ coredistools_uri = az_blob_storage_superpmi_container_uri + "/libcoredistools/{}-{}/{}" .format (coreclr_args .host_os .lower (), coreclr_args .arch .lower (), coredistools_dll_name )
2460
+ skip_progress = hasattr (coreclr_args , 'no_progress' ) and coreclr_args .no_progress
2461
+ download_one_url (coredistools_uri , coredistools_location , is_azure_storage = True , display_progress = not skip_progress )
2453
2462
2454
2463
assert os .path .isfile (coredistools_location )
2455
2464
return coredistools_location
0 commit comments