cool-easter-32542
04/29/2024, 10:14 PMpants tailor ::. It populates foo/BUILD with
package_json()
Run pants tailor :: again. You'll get
$ pants tailor ::
14:56:17.68 [ERROR] 1 Exception encountered:
Engine traceback:
in `tailor` goal
KeyError: 'name'
In a non minimal repo I had package_json() populate like package_json(name="foo0") since I had a python distribution with the same name. Given KeyError: 'name' it feels like tailor is writing an invalid target to the BUILD file. Also running pants help targets package_json doesn't enumerate a name field.
It took me some time to realize this had nothing to do with the BUILD file but instead that my package.json was missing a name.
Describe the solution you'd like
A more explicit message should be given to the caller that package.json needs to have a name the first time pants tailor (or any goal that consumes the file) is called.
Describe alternatives you've considered
Additional context
pantsbuild/pants