From 8b4f5922d2591f04363e69cdac9d1b3c7a4e3dd1 Mon Sep 17 00:00:00 2001 From: Daniel Goldman Date: Sun, 31 Mar 2024 21:45:58 -0400 Subject: [PATCH] fix for lockfiles which don't have resolve_to_artifacts entries --- src/python/pants/jvm/goals/lockfile.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/python/pants/jvm/goals/lockfile.py b/src/python/pants/jvm/goals/lockfile.py index 4dbf8f0218a4..1811eecd5323 100644 --- a/src/python/pants/jvm/goals/lockfile.py +++ b/src/python/pants/jvm/goals/lockfile.py @@ -176,12 +176,12 @@ async def setup_user_lockfile_requests( # validate the proposed set of artifact requirements for each resolve. gets = [] for resolve in requested: - if resolve in resolve_to_artifacts: + if resolve in resolve_to_artifacts or resolve not in tools: gets.append( Get( GenerateJvmLockfile, _ValidateJvmArtifactsRequest( - artifacts=ArtifactRequirements(resolve_to_artifacts.get(resolve, ())), + artifacts=ArtifactRequirements(resolve_to_artifacts[resolve]), resolve_name=resolve, ), ) @@ -197,6 +197,16 @@ async def setup_user_lockfile_requests( GenerateJvmLockfileFromTool.create(tool), ) ) + else: + gets.append( + Get( + GenerateJvmLockfile, + _ValidateJvmArtifactsRequest( + artifacts=ArtifactRequirements(()), + resolve_name=resolve, + ), + ) + ) jvm_lockfile_requests = await MultiGet(*gets)