-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[empath-split] Add --print-sources option #25386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[empath-split] Add --print-sources option #25386
Conversation
The 'paths' file should contain paths that match those of `sources` field in the source map, which can be hard to figure out because they can be relative to some build directory. This adds `--print-sources` option, which prints the contents of the `sources` field. You can just manually open source map files to obtain the same information, but they are usually hard to read without any newlines. You also can use a general JSON prettyprinting tool, but I think it wouldn't hurt to provide the same info handy here.
parser.add_argument('wasm', nargs='?', help='Path to the input wasm file') | ||
parser.add_argument('paths_file', nargs='?', help='Path to the input file containing paths') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These became optional because when you use --print-sources
these are not mandatory. (We manually check for their existence below when --print-sources
is not given)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. maybe another useful diagnostic functionality would be when actually doing a split, to print how many functions (and bytes of functions?) matched each split-module in the input patterns, which might tell you at a glance whether things worked approximately as expected.
When |
The 'paths' file should contain paths that match those of
sources
field in the source map, which can be hard to figure out because they can be relative to some build directory.This adds
--print-sources
option, which prints the contents of thesources
field. You can just manually open source map files to obtain the same information, but they are usually hard to read without any newlines. You also can use a general JSON prettyprinting tool, but I think it wouldn't hurt to provide the same info handy here.