Make run:once work for dependencies shared amongst included taskfiles #852
Labels
area: fingerprinting
Changes related to checksums and caching.
type: bug
Something not working as intended.
I'm currently working in a mono-repo of sorts and each of our services/libraries has a Taskfile with a "build" task.
When a service depends on a library we use "includes" and "deps" to make sure the library is built before the service is built.
We also have a root Taskfile that includes all service Taskfiles and calls their build task in a deps array.
This works really well but we've found that when a library is referenced by multiple services it will be built multiple times by the root Taskfile.
We also found that the "sources" feature doesn't work for tasks shared between included Taskfiles.
Here's the dry run from the root Taskfile showing the library getting built twice:
and here's what a service Taskfile looks like
and the library Taskfile
It seems like the include namespacing causes
task
to treat every task as a unique one when multiple Taskfiles include a shared task.We also noticed that if we run a "task build" in service-a and then service-b that the
.task/
checksum cache is not shared and so the library is built twice. The same applies for any order of builds, i.e. building the library then the services.Ideally the includes form a directed acyclic graph (DAG) and
task
will run the dependencies in order and only once (when run:once is set), with the task's checksum cache being considered.Is this something in scope for improvement in taskfile v3?
The text was updated successfully, but these errors were encountered: