Skip to content

Conversation

@loewenheim
Copy link
Contributor

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).

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.

@loewenheim loewenheim requested a review from a team June 25, 2025 09:21
@loewenheim loewenheim force-pushed the sebastian/r8-headers branch from 24af606 to b6a814c Compare June 25, 2025 09:22
Base automatically changed from sebastian/clippy to master June 25, 2025 09:27
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).
@loewenheim loewenheim force-pushed the sebastian/r8-headers branch from b6a814c to 68a1e1f Compare June 25, 2025 09:37
Copy link
Member

@Dav1dde Dav1dde left a 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"# {") {
Copy link
Member

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?

Copy link
Contributor Author

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.

@loewenheim
Copy link
Contributor Author

Maybe makes sense to add some tests that make sure the conditional parsing works as expected.

Which conditional parsing do you mean?

@Dav1dde
Copy link
Member

Dav1dde commented Jun 25, 2025

Where you added another branch: parse_proguard_record

@loewenheim loewenheim merged commit 309d4c7 into master Jun 26, 2025
7 checks passed
@loewenheim loewenheim deleted the sebastian/r8-headers branch June 26, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants