diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py index f2b81a06e39fdd..ca3e0dd6101457 100644 --- a/src/coreclr/scripts/superpmi.py +++ b/src/coreclr/scripts/superpmi.py @@ -330,6 +330,8 @@ def add_core_root_arguments(parser, build_type_default, build_type_help): replay_common_parser = argparse.ArgumentParser(add_help=False) +# NOTE: When adding arguments here, also make sure that they are set when collect does its replay: +# see the "collect" case in setup_args. replay_common_parser.add_argument("-mch_files", metavar="MCH_FILE", nargs='+', help=replay_mch_files_help) replay_common_parser.add_argument("-filter", nargs='+', help=filter_help) replay_common_parser.add_argument("-product_location", help=product_location_help) @@ -4754,6 +4756,11 @@ def verify_base_diff_args(): lambda unused: True, "Unable to set produce_repro") + coreclr_args.verify(args, + "details", # The replay code checks this, so make sure it's set + lambda unused: True, + "Unable to set details") + coreclr_args.verify(args, "collection_command", lambda unused: True, diff --git a/src/coreclr/scripts/superpmi_benchmarks.py b/src/coreclr/scripts/superpmi_benchmarks.py index 117976ee00b021..ef0ca68a3dd9af 100644 --- a/src/coreclr/scripts/superpmi_benchmarks.py +++ b/src/coreclr/scripts/superpmi_benchmarks.py @@ -178,13 +178,17 @@ def build_and_run(coreclr_args, output_mch_name): # Start with a "dotnet --info" to see what we've got. run_command([dotnet_exe, "--info"]) - env_copy = os.environ.copy() + tfm = "net9.0" + os.environ["PERFLAB_TARGET_FRAMEWORKS"] = tfm + + env_for_restore = os.environ.copy() + if is_windows: # Try to work around problem with random NuGet failures in "dotnet restore": # error NU3037: Package 'System.Runtime 4.1.0' from source 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json': # The repository primary signature validity period has expired. [C:\h\w\A3B008C0\w\B581097F\u\performance\src\benchmarks\micro\MicroBenchmarks.csproj] # Using environment variable specified in https://github.com/NuGet/NuGet.Client/pull/4259. - env_copy["NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY"] = "9,2000" + env_for_restore["NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY"] = "9,2000" # If `dotnet restore` fails, retry. num_tries = 3 @@ -193,7 +197,7 @@ def build_and_run(coreclr_args, output_mch_name): exit_on_fail = try_num + 1 == num_tries (_, _, return_code) = run_command( [dotnet_exe, "restore", project_file, "--packages", artifacts_packages_directory], - _exit_on_fail=exit_on_fail, _env=env_copy) + _exit_on_fail=exit_on_fail, _env=env_for_restore) if return_code == 0: # It succeeded! break @@ -203,7 +207,7 @@ def build_and_run(coreclr_args, output_mch_name): run_command( [dotnet_exe, "build", project_file, "--configuration", "Release", - "--framework", "net9.0", "--no-restore", "/p:NuGetPackageRoot=" + artifacts_packages_directory, + "--framework", tfm, "--no-restore", "/p:NuGetPackageRoot=" + artifacts_packages_directory, "-o", artifacts_directory], _exit_on_fail=True) # This is specifically for PowerShell.Benchmarks. diff --git a/src/coreclr/scripts/superpmi_collect_setup.py b/src/coreclr/scripts/superpmi_collect_setup.py index 84fca091e6ddaa..e97704ed5824db 100644 --- a/src/coreclr/scripts/superpmi_collect_setup.py +++ b/src/coreclr/scripts/superpmi_collect_setup.py @@ -404,11 +404,8 @@ def setup_benchmark(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 9" in the script. run_command( - get_python_name() + [dotnet_install_script, "install", "--dotnet-versions", "9.0.100-rc.2.24474.11", "--architecture", arch, "--install-dir", + get_python_name() + [dotnet_install_script, "install", "--channels", "9.0", "--architecture", arch, "--install-dir", dotnet_directory, "--verbose"])