When a target is a directory, and that target completes, any subtargets of that target should have their mtimes updated based on the task that created the directory. As a result this should effectively stop the subtargets from applying if they've been defined by the directory target.
The use case here is npm installs where there is the npm install operation and an npm install pkg@v operation, where the npm install target is node_modules and package-lock.json and the npm install pkg@v target is package-lock.json and node_modules/pkg. If the npm install is running and the npm install pkg@v depends on it, then the npm install pkg@v should be able to be preemptively stopped by the npm install task.
Another way to implement this might be to simply lazily compute mtimes after dependencies have finished processing.
When a target is a directory, and that target completes, any subtargets of that target should have their mtimes updated based on the task that created the directory. As a result this should effectively stop the subtargets from applying if they've been defined by the directory target.
The use case here is npm installs where there is the
npm install
operation and annpm install pkg@v
operation, where thenpm install
target isnode_modules
andpackage-lock.json
and thenpm install pkg@v
target ispackage-lock.json
andnode_modules/pkg
. If thenpm install
is running and thenpm install pkg@v
depends on it, then thenpm install pkg@v
should be able to be preemptively stopped by thenpm install
task.Another way to implement this might be to simply lazily compute mtimes after dependencies have finished processing.