I feel like this should be obvious but I'm stumped...
# plugins
p
I feel like this should be obvious but I'm stumped. When adding a new
PythonToolBase
subsystem (in the pants repo), how do you generate the initial lockfile? I tried adding my new subsystem to
build_support/bin/generate_builtin_lockfiles.py
and then running
pants run build-support/bin/generate_builtin_lockfiles.py -- --debug elfdeps
(where elfdeps is the option scope of my new subsystem). But it complains that the lockfile can't be found (I know. That's why I asked to generate it.). Using
--keep-sandboxes
is not helpful because of the secondary sandbox that gets created by the
generate_builtin_lockfiles.py
script. Do I need to copy some other random lockfile and use it as a seed?
2
I finally got it to build by commenting out https://github.com/pantsbuild/pants/blob/91ba863c05254b3c5ac2fa6a73af8eced6eb02af/build-support/bin/generate_builtin_lockfiles.py#L285 so it doesn't try to load my new incomplete backend.
For a new, incomplete backend, setting the tool backend (the second
PythonTool
arg under
all_python_tools
) to something other than the WIP backend also works. Apparently pants can't load the backend until after I generate the file. 🤷
Once the lockfile is generated for the first time, I can replace the dummy
PythonTool
backend with the actual backend, because the backend is now loadable.