cool-easter-32542
01/26/2024, 12:39 PMpants peek decides to end the array and start the new one:
$ pants list :: | xargs pants peek | head -n 70255 | tail
],
"tags": null
}
]
[
{
"address": "weatherfx/files/overlay/lga/BUILD:conf",
"target_type": "file",
"dependencies": [],
"dependencies_raw": null,
$ pants list :: | xargs pants peek | yq -p json length
2445
36
Pants version
pants_version = "2.19.0rc2"
OS
Ubuntu 22.04
Additional info
We're parsing pants peek output in python:
# pants peek | python run.py
targets = json.load(sys.stdin)
So starting a new array at the middle of the output breaks this code.
Suggested fix: add the [peek].json_lines flag that will write a json representation of a target per line, so that people could do this:
# pants peek | python run.py
for line in sys.stdin:
target = json.loads(line)
pantsbuild/pantscool-easter-32542
01/26/2024, 4:52 PM