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

Swap from FFJSON to easyjson #1322

Closed
wants to merge 4 commits into from
Closed

Swap from FFJSON to easyjson #1322

wants to merge 4 commits into from

Conversation

mheon
Copy link
Member

@mheon mheon commented Aug 22, 2018

FFJSON has serialization issues related to MarshalText/UnmarshalText that most notably affect serializing net.IP and cause incompatibility with containers created with DNS servers prior to FFJSON being re-added.

I investigated adding support for these to FFJSON, but didn't make much progress. Swapping to an alternative JSON generator seems like a better option.

Caveat: easyjson is newer and less mature, and potentially more buggy in other areas.

@mheon
Copy link
Member Author

mheon commented Aug 22, 2018

Should fix #1283

@rhatdan
Copy link
Member

rhatdan commented Aug 22, 2018

If we make this change we should also look at doing this in buildah and containers/storage?

@mheon
Copy link
Member Author

mheon commented Aug 22, 2018

Hm. It seems like we might need to vendor the easyjson repo (the generated files seem to be referring back to it).

@rhatdan It might be worth looking into, but it's not really a big real for c/storage and buildah because they've used FFJSON exclusively for a long time, and slight encoding/decoding differences vs encoding/json don't matter as much there. Here, we do need near-exact compatibility because we're transitioning an existing database created with encoding/json.

@mheon
Copy link
Member Author

mheon commented Aug 23, 2018

I'm not really sure why travis is showing as pending here - it's green when you actually click on it...

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably 63dd200) made this pull request unmergeable. Please resolve the merge conflicts.

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably 4c00dc6) made this pull request unmergeable. Please resolve the merge conflicts.

@rhatdan
Copy link
Member

rhatdan commented Aug 23, 2018

Sadly needs a rebase.

mheon added 3 commits August 23, 2018 15:14
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
FFJSON has serialization differences versus stock Go - namely, it
does not respect the MarshalText() and UnmarshalText() methods,
particularly on []byte, which causes incompatability with
pre-FFJSON containers which contained DNS servers.

EasyJSON does not have these issues, and might even be slightly
faster.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
To ensure we can build without easyjson installed, vendor the
easyjson repository as the generated files use the easyjson
library.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
@mheon
Copy link
Member Author

mheon commented Aug 23, 2018

Rebased

@rhatdan
Copy link
Member

rhatdan commented Aug 23, 2018

LGTM

@mheon
Copy link
Member Author

mheon commented Aug 24, 2018

bot, retest this please

@mheon
Copy link
Member Author

mheon commented Aug 24, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 367541e has been approved by mheon

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 367541e with merge 347e934...

rh-atomic-bot pushed a commit that referenced this pull request Aug 24, 2018
FFJSON has serialization differences versus stock Go - namely, it
does not respect the MarshalText() and UnmarshalText() methods,
particularly on []byte, which causes incompatability with
pre-FFJSON containers which contained DNS servers.

EasyJSON does not have these issues, and might even be slightly
faster.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1322
Approved by: mheon
rh-atomic-bot pushed a commit that referenced this pull request Aug 24, 2018
To ensure we can build without easyjson installed, vendor the
easyjson repository as the generated files use the easyjson
library.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1322
Approved by: mheon
rh-atomic-bot pushed a commit that referenced this pull request Aug 24, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1322
Approved by: mheon
@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: mheon
Pushing 347e934 to master...

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants