guybedford / chomp

'JS Make' - parallel task runner for the frontend ecosystem with a JS extension system.
https://chompbuild.com
Apache License 2.0
143 stars 7 forks source link

-r flag not rerunning interpolation task #157

Open guybedford opened 2 years ago

guybedford commented 2 years ago

The -r flag is supposed to rerun the provided tasks without caching. That is, chomp build -r will rerun the build task even if the build is cached and would be skipped. -r is different to -f in that it will only rerun the top-level task, while still caching dependencies. Useful for debugging specific tasks without invalidating their dependencies.

Currently chomp build -r is not rerunning interpolation tasks though for an interpolation task like:

[[task]]
name = 'build'
dep = 'src/#'
target = 'lib/#'
run = '''
  echo "running build"
  cp $DEP $TARGET
'''

Where chomp build -r in the above will continue to use the cached run.

The reason for this is that interpolations form a list of tasks, and the main task itself is treated as a pointer task which depends on the interpolation dependencies internally. The -r logic would need to detect this specific interpolation structure to properly rerun interpolation tasks.