-
-
Notifications
You must be signed in to change notification settings - Fork 8
ref: Robustly parse R8 headers #50
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
Conversation
24af606 to
b6a814c
Compare
R8 headers have a different format from "normal" ProGuard headers. This splits the parsing of the two header formats apart and uses `serde` for R8 headers (they are specified to be in JSON format).
b6a814c to
68a1e1f
Compare
Dav1dde
left a comment
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.
Maybe makes sense to add some tests that make sure the conditional parsing works as expected.
src/mapping.rs
Outdated
| let bytes = consume_leading_newlines(bytes); | ||
|
|
||
| let result = if bytes.starts_with(b"#") { | ||
| let result = if bytes.starts_with(b"# {") { |
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.
Is there always a space or is it optional in the spec?
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.
Unfortunately the spec isn't that detailed or explicit. In all examples I've seen there's a space, but it would probably make sense to be more careful here.
Which conditional parsing do you mean? |
|
Where you added another branch: |
R8 headers have a different format from "normal" ProGuard headers. This splits the parsing of the two header formats apart and uses
serdefor R8 headers (they are specified to be in JSON format).See https://r8.googlesource.com/r8/+/refs/heads/main/doc/retrace.md#additional-information-appended-as-comments-to-the-file for R8 headers.
Ref #48. Ref RUSTPRO-3.