cool-easter-32542
02/07/2024, 11:28 PMgo 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
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