|
239 | 239 |
|
240 | 240 | # Add required arguments
|
241 | 241 | collect_parser.add_argument("collection_command", nargs='?', help=superpmi_collect_help)
|
242 |
| -collect_parser.add_argument("collection_args", nargs='?', help="Arguments to pass to the SuperPMI collect command.") |
| 242 | +collect_parser.add_argument("collection_args", nargs='?', help="Arguments to pass to the SuperPMI collect command. This is a single string; quote it if necessary if the arguments contain spaces.") |
243 | 243 |
|
244 | 244 | collect_parser.add_argument("--pmi", action="store_true", help="Run PMI on a set of directories or assemblies.")
|
245 | 245 | collect_parser.add_argument("--crossgen", action="store_true", help="Run crossgen on a set of directories or assemblies.")
|
@@ -2972,8 +2972,8 @@ def verify_replay_common_args():
|
2972 | 2972 |
|
2973 | 2973 | coreclr_args.verify(args,
|
2974 | 2974 | "collection_command",
|
2975 |
| - lambda command: command is None or os.path.isfile(command), |
2976 |
| - "Unable to find script.") |
| 2975 | + lambda unused: True, |
| 2976 | + "Unable to set collection_command.") |
2977 | 2977 |
|
2978 | 2978 | coreclr_args.verify(args,
|
2979 | 2979 | "collection_args",
|
@@ -3108,6 +3108,18 @@ def verify_replay_common_args():
|
3108 | 3108 | coreclr_args.temp_dir = os.path.abspath(coreclr_args.temp_dir)
|
3109 | 3109 | logging.debug("Using temp_dir %s", coreclr_args.temp_dir)
|
3110 | 3110 |
|
| 3111 | + if coreclr_args.collection_command is not None: |
| 3112 | + if os.path.isfile(coreclr_args.collection_command): |
| 3113 | + coreclr_args.collection_command = os.path.abspath(coreclr_args.collection_command) |
| 3114 | + else: |
| 3115 | + # Look on path and in Core_Root. Searching Core_Root is useful so you can just specify "corerun.exe" as the collection command in it can be found. |
| 3116 | + collection_tool_path = find_tool(coreclr_args, coreclr_args.collection_command, search_core_root=True, search_product_location=False, search_path=True, throw_on_not_found=False) |
| 3117 | + if collection_tool_path is None: |
| 3118 | + print("Couldn't find collection command \"{}\"".format(coreclr_args.collection_command)) |
| 3119 | + sys.exit(1) |
| 3120 | + coreclr_args.collection_command = collection_tool_path |
| 3121 | + logging.info("Using collection command from PATH: \"%s\"", coreclr_args.collection_command) |
| 3122 | + |
3111 | 3123 | elif coreclr_args.mode == "replay":
|
3112 | 3124 |
|
3113 | 3125 | verify_target_args()
|
|
0 commit comments