Skip to content

Commit

Permalink
[internal] Do not cache lockfile generation (#12674)
Browse files Browse the repository at this point in the history
Closes #12591.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano authored Aug 27, 2021
1 parent fe9e48a commit d4ef1a6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/python/pants/backend/python/goals/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
Workspace,
)
from pants.engine.goal import Goal, GoalSubsystem
from pants.engine.process import ProcessResult
from pants.engine.process import ProcessCacheScope, ProcessResult
from pants.engine.rules import Get, MultiGet, collect_rules, goal_rule, rule
from pants.engine.unions import UnionMembership, union
from pants.python.python_setup import PythonSetup
Expand Down Expand Up @@ -126,6 +126,17 @@ async def generate_lockfile(
input_digest=pyproject_toml_digest,
output_files=("poetry.lock", "pyproject.toml"),
description=req.description,
# Instead of caching lockfile generation with LMDB, we instead use the invalidation
# scheme from `lockfile_metadata.py` to check for stale/invalid lockfiles. This is
# necessary so that our invalidation is resilient to deleting LMDB or running on a
# new machine.
#
# We disable caching with LMDB so that when you generate a lockfile, you always get
# the most up-to-date snapshot of the world. This is generally desirable and also
# necessary to avoid an awkward edge case where different developers generate different
# lockfiles even when generating at the same time. See
# https://github.com/pantsbuild/pants/issues/12591.
cache_scope=ProcessCacheScope.PER_SESSION,
),
)
poetry_export_result = await Get(
Expand Down

0 comments on commit d4ef1a6

Please sign in to comment.