From 20c8ae6457caa652a34fc42ff5f92b6728231039 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Tue, 20 Sep 2022 06:28:44 -0700 Subject: [PATCH] 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 1a6ae318ee6a1fadce7b662b36e9cf206f1acf43. --- src/coreclr/scripts/superpmi_collect_setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/coreclr/scripts/superpmi_collect_setup.py b/src/coreclr/scripts/superpmi_collect_setup.py index 815041c9768..b16220f4a24 100644 --- a/src/coreclr/scripts/superpmi_collect_setup.py +++ b/src/coreclr/scripts/superpmi_collect_setup.py @@ -37,6 +37,7 @@ import argparse import os +import shutil import stat from coreclr_arguments import * @@ -376,6 +377,11 @@ def setup_microbenchmark(workitem_directory, arch): run_command( ["git", "clone", "--quiet", "--depth", "1", "https://github.com/dotnet/performance", performance_directory]) + try: + shutil.rmtree(os.path.join(performance_directory, ".git")) + except Exception as ex: + print("Warning: failed to remove directory \"%s\": %s", os.path.join(performance_directory, ".git"), ex) + with ChangeDir(performance_directory): dotnet_directory = os.path.join(performance_directory, "tools", "dotnet", arch) dotnet_install_script = os.path.join(performance_directory, "scripts", "dotnet.py") @@ -384,8 +390,11 @@ def setup_microbenchmark(workitem_directory, arch): print("Missing " + dotnet_install_script) return + # Sometimes the dotnet version installed by the script is latest and expect certain versions of SDK that + # have not published yet. As a result, we hit errors of "dotnet restore". As a workaround, hard code the + # working version until we move to ".NET 8" in the script. run_command( - get_python_name() + [dotnet_install_script, "install", "--architecture", arch, "--install-dir", + get_python_name() + [dotnet_install_script, "install", "--dotnet-versions", "7.0.100-rc.2.22458.3", "--architecture", arch, "--install-dir", dotnet_directory, "--verbose"]) -- GitLab