<#20507 Support externally-managed caches in `adho...
# github-notifications
c
#20507 Support externally-managed caches in `adhoc_tool` Issue created by timoffex Is your feature request related to a problem? Please describe. Many modern languages include package managers or build systems that involve a cache, e.g.
go build
. When adding a not-yet-supported language to a repository that already uses Pants, it would help to be able to efficiently use these tools via
adhoc_tool
. Describe the solution you'd like
Copy code
adhoc_tool(
    name="go-example",
    runnable=":system_go_binary",

    # Note, the "-cover" functionality is not currently supported by Pants's Go
    # implementation, which is what made me look for a workaround.
    args=["build", "-cover", "-o", "compiled-binary", "main.go"],
    execution_dependencies=["**/*.go"],
    output_files=["compiled-binary"],

    # Add this!
    tool_cache=[".build/**"],
)
Describe alternatives you've considered I couldn't think of alternatives. Additional context The key part of a cache that doesn't fit into Pants's model, is that it's both an input and an output to a binary. pantsbuild/pants