proposal : add an "auto transiant" flag
uohmak4fvpqe opened this issue · 0 comments
I think it would be neat to have a new flag, say ^T
, that either :
- behaves as
^o
by default, - behaves as
^t
if all the files depending on this one only have^T
or^t
dependencies, including this one
With this new flag, ^o
would only be desirable if the user positively wants to keep the file in and of itself, and all .o
object files for instance could be marked ^T
.
Indeed the only reason for not using ^t
against ^o
on stage-files is because deleting them would imply rebuilding them all even if only one would have changed. But because tup tracks and stores dependencies, it can detect this scenario.
This would help saving tons of space in some cases for making big builds in ramfs for instance.
A practical example is building the object files for the testing executables such as from doctest, and even the executables themselves if (as it should), they are also executed during the build. Another one is the object files for the creation of a large set of small libraries mostly based on a unique corresponding object file.
Currently:
- we can just mark every stage files as
^o
by default, potentially wasting lots of space, which may even actually be too much - we can manually set select files as
^t
, but that implies naming them by hand, which is unrealistic, and also forbids using a common macro as the command, which is even more unrealistic perhaps - we can duplicate the code so to have a transient version of the compiling rules/macros and so on, which is a maintenance issue.
I suspect it wouldn't be too hard to implement for the non-negligible benefits
What do you think ?