Skip to content

Commit b4923b3

Browse files
authored
SPMI: Switch back to unpinned 9.0 SDK for micro benchmarks (#109992)
Also set PERFLAB_TARGET_FRAMEWORKS and fix superpmi.py when it replays during a collection.
1 parent 0170d78 commit b4923b3

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/coreclr/scripts/superpmi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ def add_core_root_arguments(parser, build_type_default, build_type_help):
330330

331331
replay_common_parser = argparse.ArgumentParser(add_help=False)
332332

333+
# NOTE: When adding arguments here, also make sure that they are set when collect does its replay:
334+
# see the "collect" case in setup_args.
333335
replay_common_parser.add_argument("-mch_files", metavar="MCH_FILE", nargs='+', help=replay_mch_files_help)
334336
replay_common_parser.add_argument("-filter", nargs='+', help=filter_help)
335337
replay_common_parser.add_argument("-product_location", help=product_location_help)
@@ -4759,6 +4761,11 @@ def verify_base_diff_args():
47594761
lambda unused: True,
47604762
"Unable to set produce_repro")
47614763

4764+
coreclr_args.verify(args,
4765+
"details", # The replay code checks this, so make sure it's set
4766+
lambda unused: True,
4767+
"Unable to set details")
4768+
47624769
coreclr_args.verify(args,
47634770
"collection_command",
47644771
lambda unused: True,

src/coreclr/scripts/superpmi_benchmarks.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,17 @@ def build_and_run(coreclr_args, output_mch_name):
178178
# Start with a "dotnet --info" to see what we've got.
179179
run_command([dotnet_exe, "--info"])
180180

181-
env_copy = os.environ.copy()
181+
tfm = "net9.0"
182+
os.environ["PERFLAB_TARGET_FRAMEWORKS"] = tfm
183+
184+
env_for_restore = os.environ.copy()
185+
182186
if is_windows:
183187
# Try to work around problem with random NuGet failures in "dotnet restore":
184188
# error NU3037: Package 'System.Runtime 4.1.0' from source 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json':
185189
# The repository primary signature validity period has expired. [C:\h\w\A3B008C0\w\B581097F\u\performance\src\benchmarks\micro\MicroBenchmarks.csproj]
186190
# Using environment variable specified in https://github.com/NuGet/NuGet.Client/pull/4259.
187-
env_copy["NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY"] = "9,2000"
191+
env_for_restore["NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY"] = "9,2000"
188192

189193
# If `dotnet restore` fails, retry.
190194
num_tries = 3
@@ -193,7 +197,7 @@ def build_and_run(coreclr_args, output_mch_name):
193197
exit_on_fail = try_num + 1 == num_tries
194198
(_, _, return_code) = run_command(
195199
[dotnet_exe, "restore", project_file, "--packages", artifacts_packages_directory],
196-
_exit_on_fail=exit_on_fail, _env=env_copy)
200+
_exit_on_fail=exit_on_fail, _env=env_for_restore)
197201
if return_code == 0:
198202
# It succeeded!
199203
break
@@ -203,7 +207,7 @@ def build_and_run(coreclr_args, output_mch_name):
203207

204208
run_command(
205209
[dotnet_exe, "build", project_file, "--configuration", "Release",
206-
"--framework", "net9.0", "--no-restore", "/p:NuGetPackageRoot=" + artifacts_packages_directory,
210+
"--framework", tfm, "--no-restore", "/p:NuGetPackageRoot=" + artifacts_packages_directory,
207211
"-o", artifacts_directory], _exit_on_fail=True)
208212

209213
# This is specifically for PowerShell.Benchmarks.

src/coreclr/scripts/superpmi_collect_setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,8 @@ def setup_benchmark(workitem_directory, arch):
404404
print("Missing " + dotnet_install_script)
405405
return
406406

407-
# Sometimes the dotnet version installed by the script is latest and expect certain versions of SDK that
408-
# have not published yet. As a result, we hit errors of "dotnet restore". As a workaround, hard code the
409-
# working version until we move to ".NET 9" in the script.
410407
run_command(
411-
get_python_name() + [dotnet_install_script, "install", "--dotnet-versions", "9.0.100-rc.2.24474.11", "--architecture", arch, "--install-dir",
408+
get_python_name() + [dotnet_install_script, "install", "--channels", "9.0", "--architecture", arch, "--install-dir",
412409
dotnet_directory, "--verbose"])
413410

414411

0 commit comments

Comments
 (0)