Skip to content
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

Update debuginfo for change in 1.71 #241

Merged
merged 1 commit into from Jul 19, 2023
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jul 19, 2023

There was an unanticipated change in 1.71 that added stringly-typed debuginfo in the profile struct. After discussing with the cargo team, we have decided to keep this change even though it has caused breakage. Fortunately this only affects projects which have opted-in to the string-based variants.

There isn't a clear alternative for how to represent this information (they can't be accurately mapped to numbers), and we don't have a way to version this JSON output (which would also be a breaking change if we changed the version). We currently don't have a good story for how to manage JSON compatibility of the compiler messages, which is something we should probably figure out at some time.

I decided to go ahead and map the values to their semantic meaning, with an escape hatch for unknown values that might be added in the future. Alternatively it could just be a two-variant enum (int/string), but adding the mapping wasn't too difficult. However, this means that the round-trip serialization isn't exact (null or missing gets mapped to 0). I don't expect that to be an issue, but I'm not sure why anyone would serialize these.

Fixes #240

Copy link
Collaborator

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been following the debuginfo zulip thread, and this solution looks great to me 👍

@oli-obk oli-obk merged commit 14a8b64 into oli-obk:main Jul 19, 2023
6 checks passed
@oxalica
Copy link

oxalica commented Jul 19, 2023

This affects many downstream crates. I just ran into an suspicious error with cargo-flamegraph and got here finally. Hope to have a new release soon.

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.

Non numerical values for debuginfo cannot be parsed from cargo messages
4 participants