Skip to content

Commit

Permalink
add note about caching granularity from PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Feb 16, 2019
1 parent e835b86 commit a96abfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ def _build_tool_pex(self, tool_subsystem, interpreter, pex_path):
pex_builder.freeze()

def _generate_fingerprinted_pex_path(self, tool_subsystem, interpreter):
# `tool_subsystem.get_requirement_specs()` is a list, but order shouldn't actually matter. This
# should probably be sorted, but it's possible a user could intentionally tweak order to work
# around a particular requirement resolution resolve-order issue. In practice the lists are
# expected to be mostly static, so we accept the risk of too-fine-grained caching creating lots
# of pexes in the cache dir.
specs_fingerprint = stable_json_sha1(tool_subsystem.get_requirement_specs())
return os.path.join(
get_pants_cachedir(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ def prepare(cls, options, round_manager):
super(ToolTask, cls).prepare(options, round_manager)
round_manager.require_data(ToolPrep.tool_instance_cls)

@classmethod
def product_types(cls):
return ['test_pex']

def execute(self):
tool_for_pex = self.context.products.get_data(ToolPrep.tool_instance_cls)
stdout, stderr, exit_code, _ = tool_for_pex.output(['--version'])
Expand Down

0 comments on commit a96abfd

Please sign in to comment.