https://pantsbuild.org/ logo
#general
Title
# general
n

nice-florist-55958

07/21/2022, 6:07 PM
We have some BUILD files that are generated dynamically (by using the contents of other text files which are updated instead). For example, the `python_distribution`o targets peek at a VERSION file in every library project to get the version. Another example is lists of requirements are split into logical categories (a file for each), and then the BUILD file concats them into a single file dynamically to feed to
python_requirements
. With pants*d* these changes are not detected of course (and I guess this demonstrates
open
or other builtin functions are no exception to the rationale for prohibiting imports in BUILD files as they can "easily break Pant's cacheing mechanisms"). I haven't messed with macros yet, but would these two use cases be solved by them? Or is there a way to manually invalidate a file pattern when invoking pants w/ pantsd enabled?
Another example: read a list of blessed resolves for a certain project type (e.g., everything under
proj/lib
) so whenever one is added, the
python_source
targets don't need to all be updated.
4 Views