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

Explicitly use "python" ijson backend #17787

Merged
merged 2 commits into from Dec 13, 2022

Conversation

jcrumb-u21
Copy link
Contributor

ijson provides a few backends with varying levels of compatibility and performance; which backend is chosen by ijson is system-dependent. Unfortunately the yajl2 backend does not play nicely with the JSON output by go list and throws an IncompleteJSONError when parsing.

As a workaround, we can explicitly use the pure Python backend which is able to parse Go's output correctly.

Closes #17778

ijson provides a few backends with varying levels of compatibility and
performance; which backend is chosen by ijson is system-dependent.
Unfortunately the yajl2 backend does not play nicely with the JSON
output by go list and throws an IncompleteJSONError when parsing.

As a workaround, we can explicitly use the pure Python backend which is
able to parse Go's output correctly.
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thank you for digging into this and submitting a patch!

@Eric-Arellano Eric-Arellano added needs-cherrypick category:bugfix Bug fixes for released features labels Dec 13, 2022
@Eric-Arellano Eric-Arellano added this to the 2.15.x milestone Dec 13, 2022
@Eric-Arellano Eric-Arellano enabled auto-merge (squash) December 13, 2022 00:47
@tdyas tdyas added the backend: Go Go backend-related issues label Dec 13, 2022
@benjyw
Copy link
Sponsor Contributor

benjyw commented Dec 13, 2022

Thanks for the fix! Looks like mypy is choking on missing type stubs for the backend. Hmm.

@Eric-Arellano
Copy link
Contributor

Thanks for the fix! Looks like mypy is choking on missing type stubs for the backend. Hmm.

Change this to end in .*:

"ijson",

Copy link
Sponsor Contributor

@benjyw benjyw left a comment

Choose a reason for hiding this comment

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

My suggested edits will fix the mypy failure in CI.

@benjyw
Copy link
Sponsor Contributor

benjyw commented Dec 13, 2022

My suggested edits will fix the mypy failure in CI.

Oh, or Eric's suggestion is even better.

auto-merge was automatically disabled December 13, 2022 16:39

Head branch was pushed to by a user without write access

@benjyw
Copy link
Sponsor Contributor

benjyw commented Dec 13, 2022

Thanks @jcrumb-u21 ! I will merge when CI goes green.

@jcrumb-u21
Copy link
Contributor Author

There's a test failure in there, but it looks unrelated to me @benjyw

@Eric-Arellano Eric-Arellano enabled auto-merge (squash) December 13, 2022 19:01
@Eric-Arellano Eric-Arellano merged commit beaa997 into pantsbuild:main Dec 13, 2022
@jcrumb-u21 jcrumb-u21 deleted the specify-ijson-backend branch December 13, 2022 20:41
jcrumb-u21 added a commit to jcrumb-u21/pants that referenced this pull request Jan 24, 2023
ijson provides a few backends with varying levels of compatibility and performance; which backend is chosen by ijson is system-dependent. Unfortunately the yajl2 backend does not play nicely with the JSON output by go list and throws an IncompleteJSONError when parsing.

As a workaround, we can explicitly use the pure Python backend which is able to parse Go's output correctly.

Closes pantsbuild#17778
benjyw pushed a commit that referenced this pull request Jan 24, 2023
ijson provides a few backends with varying levels of compatibility and performance; which backend is chosen by ijson is system-dependent. Unfortunately the yajl2 backend does not play nicely with the JSON output by go list and throws an IncompleteJSONError when parsing.

As a workaround, we can explicitly use the pure Python backend which is able to parse Go's output correctly.

Closes #17778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Go Go backend-related issues category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IncompleteJSONError when running any pants commands
4 participants