I feel like this error is specific enough that it ...
# general
c
I feel like this error is specific enough that it should work, but it doesn’t seem to do anything… I’m trying to do
pants repl ::
in
2.16.0
with a mypy tool lockfile and a default lockfile:
Copy code
Engine traceback:
  in `repl` goal

NoCompatibleResolveException: The input targets did not have a resolve in common.
Copy code
Targets used together must use the same resolve, set by the `resolve` field. For more information on 'resolves' (lockfiles), see <https://www.pantsbuild.org/v2.16/docs/python-third-party-dependencies#multiple-lockfiles>.

To work around this, choose which resolve you want to use from above. Then, run `pants peek :: | jq -r '.[] | select(.resolve == "example") | .["address"]' | xargs pants repl`, where you replace "example" with the resolve name, and possibly replace the specs `::` with what you were using before. If the resolve is the `[python].default_resolve`, use `select(.resolve == "example" or .resolve == null)`. These queries will result in opening a REPL with only targets using the desired resolve.
that JQ command with my pants.toml of:
Copy code
[python]
interpreter_constraints = ["CPython==3.9.*"]
enable_resolves = true
default_resolve = "python-default"
and
pants peek :: | jq -r '.[] | select(.resolve == "python-default") | .["address"]'
returns nothing
e
As a sanity check - do you have only 1 language handled by Pants in the repo? I'd expect
pants repl ::
to fail if you had, say, Python and Scala - which repl? run one randomly? Run one randomly 1st then, on exit run the second?
c
Hey John - I do only have one
e
If you temporarily disable the tool lockfile, try again and it works - sounds like a bug. Are you using the new tool lockfile feature where the tool lock can come from your main lock so there truly is exactly 1 lock? If not, that could be a workaround.