Skip to content

Commit

Permalink
Remove deprecated run --cleanup option. (pantsbuild#17647)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois authored Nov 27, 2022
1 parent e6c7042 commit a597859
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions src/python/pants/core/goals/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
TargetRootsToFieldSetsRequest,
)
from pants.engine.unions import UnionMembership, union
from pants.option.global_options import GlobalOptions, KeepSandboxes
from pants.option.global_options import GlobalOptions
from pants.option.option_types import ArgsListOption, BoolOption
from pants.util.frozendict import FrozenDict
from pants.util.meta import frozen_after_init
Expand Down Expand Up @@ -117,22 +117,6 @@ def activated(cls, union_membership: UnionMembership) -> bool:
tool_name="the executed target",
passthrough=True,
)
cleanup = BoolOption(
default=True,
deprecation_start_version="2.15.0.dev1",
removal_version="2.16.0.dev1",
removal_hint="Use the global `keep_sandboxes` option instead.",
help=softwrap(
"""
Whether to clean up the temporary directory in which the binary is chrooted.
Set this to false to retain the directory, e.g., for debugging.
Note that setting the global --keep-sandboxes option may also conserve this directory,
along with those of all other processes that Pants executes. This option is more
selective and controls just the target binary's directory.
"""
),
)
# See also `test.py`'s same option
debug_adapter = BoolOption(
default=False,
Expand Down Expand Up @@ -237,12 +221,6 @@ async def run(
else Get(RunDebugAdapterRequest, RunFieldSet, field_set)
)
restartable = target.get(RestartableField).value
keep_sandboxes = (
global_options.keep_sandboxes
if run_subsystem.options.is_default("cleanup")
else (KeepSandboxes.never if run_subsystem.cleanup else KeepSandboxes.always)
)

if run_subsystem.debug_adapter:
logger.info(
softwrap(
Expand All @@ -261,7 +239,7 @@ async def run(
input_digest=request.digest,
run_in_workspace=True,
restartable=restartable,
keep_sandboxes=keep_sandboxes,
keep_sandboxes=global_options.keep_sandboxes,
immutable_input_digests=request.immutable_input_digests,
append_only_caches=request.append_only_caches,
),
Expand Down

0 comments on commit a597859

Please sign in to comment.