Skip to content

Commit

Permalink
Fix -output_mch_path argument to superpmi.py (#44693)
Browse files Browse the repository at this point in the history
Convert the given path argument to an absolute path. Without this,
the `collect` command changes the current directory before doing its
work, so the file doesn't end up where you expeect it to.

Also, print the given argument in any error message.
  • Loading branch information
BruceForstall committed Nov 16, 2020
1 parent 630069d commit 162b33e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,8 @@ def verify_replay_common_args():
coreclr_args.verify(args,
"output_mch_path",
lambda output_mch_path: output_mch_path is None or (not os.path.isdir(os.path.abspath(output_mch_path)) and not os.path.isfile(os.path.abspath(output_mch_path))),
"Invalid output_mch_path; is it an existing directory or file?")
"Invalid output_mch_path \"{}\"; is it an existing directory or file?".format,
modify_arg=lambda output_mch_path: None if output_mch_path is None else os.path.abspath(output_mch_path))

coreclr_args.verify(args,
"merge_mch_files",
Expand Down Expand Up @@ -3003,7 +3004,8 @@ def verify_replay_common_args():
coreclr_args.verify(args,
"output_mch_path",
lambda output_mch_path: not os.path.isdir(os.path.abspath(output_mch_path)) and not os.path.isfile(os.path.abspath(output_mch_path)),
"Invalid output_mch_path; is it an existing directory or file?")
"Invalid output_mch_path \"{}\"; is it an existing directory or file?".format,
modify_arg=lambda output_mch_path: os.path.abspath(output_mch_path))

coreclr_args.verify(args,
"pattern",
Expand Down

0 comments on commit 162b33e

Please sign in to comment.