pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.19k stars 613 forks source link

Add "workspace invalidation" sources support for shell / adhoc backends (Cherry pick of #21051) #21075

Closed tdyas closed 1 week ago

tdyas commented 2 weeks ago

Add support for "workspace invalidation" sources for the adhoc_tool and shell_command target types. This supports allows those targets to depend on the content of files in the repository without materializing those sources in the execution sandbox. This support is intended to be used in conjunction with the workspace environment where execution does not take place in a sandbox.

The new field workspace_invalidation_sources on both target types is list of globs into the repository. The digest of the referenced files will be inserted as an environment variable in the process executed (which makes it part of the process's cache key).

huonw commented 2 weeks ago

I'll let @benjyw confirm this (since he's 2.22 release manager).

benjyw commented 2 weeks ago

I'll let @benjyw confirm this (since he's 2.22 release manager).

Fine to pull this in to 2.22 in principle, but I still have a correctness concern (See #21051).

tdyas commented 1 week ago

Closing since I decided to not backport the workspace_invalidation_sources support to this branch.