37
37
38
38
import argparse
39
39
import os
40
+ import shutil
40
41
import stat
41
42
42
43
from coreclr_arguments import *
@@ -376,6 +377,11 @@ def setup_microbenchmark(workitem_directory, arch):
376
377
run_command (
377
378
["git" , "clone" , "--quiet" , "--depth" , "1" , "https://github.com/dotnet/performance" , performance_directory ])
378
379
380
+ try :
381
+ shutil .rmtree (os .path .join (performance_directory , ".git" ))
382
+ except Exception as ex :
383
+ print ("Warning: failed to remove directory \" %s\" : %s" , os .path .join (performance_directory , ".git" ), ex )
384
+
379
385
with ChangeDir (performance_directory ):
380
386
dotnet_directory = os .path .join (performance_directory , "tools" , "dotnet" , arch )
381
387
dotnet_install_script = os .path .join (performance_directory , "scripts" , "dotnet.py" )
@@ -384,8 +390,11 @@ def setup_microbenchmark(workitem_directory, arch):
384
390
print ("Missing " + dotnet_install_script )
385
391
return
386
392
393
+ # Sometimes the dotnet version installed by the script is latest and expect certain versions of SDK that
394
+ # have not published yet. As a result, we hit errors of "dotnet restore". As a workaround, hard code the
395
+ # working version until we move to ".NET 8" in the script.
387
396
run_command (
388
- get_python_name () + [dotnet_install_script , "install" , "--architecture" , arch , "--install-dir" ,
397
+ get_python_name () + [dotnet_install_script , "install" , "--dotnet-versions" , "7.0.100-rc.2.22458.3" , "-- architecture" , arch , "--install-dir" ,
389
398
dotnet_directory , "--verbose" ])
390
399
391
400
0 commit comments