Open stuhood opened 1 year ago
The reproducible scenario is where the lock file exists, but it is empty.
❯ cat pants.toml
[GLOBAL]
pants_version = "2.14.0"
backend_packages = [
"pants.backend.python",
"pants.backend.docker",
"pants.backend.shell",
'pants.backend.python.lint.black',
'pants.backend.python.lint.isort',
# antlr compiler
"pants.backend.experimental.java",
]
[python]
# This will become the default in Pants 2.15.
tailor_pex_binary_targets = false
[jvm]
jdk = "temurin:1.17"
[jvm.resolves]
jvm-default = "lib/3rdparty/jvm/default.lock"
❯ echo > lib/3rdparty/jvm/default.lock
❯ ./pants run path/to-something/with/jar/dependency
10:26:46.04 [ERROR] 1 Exception encountered:
KeyError: 'entries'
the other scenario is where the lockfile does not exist, as per the original issue description. my "activities" were
lib/3rdparty/jvm/default.lock
mkdir -p ib/3rdparty/jvm
echo > lib/3rdparty/jvm/default.lock
- run pants and it errored that the file did not exist (see issue description)
Which command did you run, in particular?
@stuhood - these steps - https://github.com/pantsbuild/pants/issues/17521#issuecomment-1309536599
To create a lockfile for the JVM, you need to run
./pants generate-lockfiles
. But if you haven't done that, and have redefined the lockfile location, you will get a unmatched globs warning instead:Rather than an unmatched glob, we should instead detect the missing file at a higher level, and explain how to create the lockfile. It looks like we already attempt to do that (in some cases): https://github.com/pantsbuild/pants/blob/c1514b73a6248a366228549c95bc1cc00fc2d93c/src/python/pants/jvm/resolve/coursier_fetch.py#L761-L767
... but apparently not in others.