Skip to content

Commit

Permalink
fix for lockfiles which don't have resolve_to_artifacts entries
Browse files Browse the repository at this point in the history
  • Loading branch information
lilatomic committed Apr 1, 2024
1 parent 6b124bb commit 8b4f592
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/python/pants/jvm/goals/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)
Expand All @@ -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)

Expand Down

0 comments on commit 8b4f592

Please sign in to comment.