Skip to content

Commit 20c8ae6

Browse files
authored
Use fixed version of dotnet for Spmi benchmark (#75888)
* fixed dotnet version * comment everything except benchmarks * Add comment * Revert "comment everything except benchmarks" This reverts commit 1a6ae31.
1 parent 482049a commit 20c8ae6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/coreclr/scripts/superpmi_collect_setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
import argparse
3939
import os
40+
import shutil
4041
import stat
4142

4243
from coreclr_arguments import *
@@ -376,6 +377,11 @@ def setup_microbenchmark(workitem_directory, arch):
376377
run_command(
377378
["git", "clone", "--quiet", "--depth", "1", "https://github.com/dotnet/performance", performance_directory])
378379

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+
379385
with ChangeDir(performance_directory):
380386
dotnet_directory = os.path.join(performance_directory, "tools", "dotnet", arch)
381387
dotnet_install_script = os.path.join(performance_directory, "scripts", "dotnet.py")
@@ -384,8 +390,11 @@ def setup_microbenchmark(workitem_directory, arch):
384390
print("Missing " + dotnet_install_script)
385391
return
386392

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.
387396
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",
389398
dotnet_directory, "--verbose"])
390399

391400

0 commit comments

Comments
 (0)