Skip to content

Commit

Permalink
Explicitly use "python" ijson backend (pantsbuild#17787)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jcrumb-u21 authored Dec 13, 2022
1 parent 131c118 commit beaa997
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module = [
"gnupg",
"hdrh",
"hdrh.histogram",
"ijson",
"ijson.*",
"pex.*",
"psutil",
"setproctitle",
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/go/util_rules/import_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from dataclasses import dataclass
from typing import ClassVar

import ijson
import ijson.backends.python as ijson

from pants.backend.go.util_rules.build_opts import GoBuildOptions
from pants.backend.go.util_rules.sdk import GoSdkProcess
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/go/util_rules/third_party_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from dataclasses import dataclass
from typing import Any

import ijson
import ijson.backends.python as ijson

from pants.backend.go.go_sources.load_go_binary import LoadedGoBinary, LoadedGoBinaryRequest
from pants.backend.go.util_rules import pkg_analyzer
Expand Down

0 comments on commit beaa997

Please sign in to comment.