Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal : add an "auto transiant" flag #462

Open
uohmak4fvpqe opened this issue Jun 10, 2022 · 0 comments
Open

proposal : add an "auto transiant" flag #462

uohmak4fvpqe opened this issue Jun 10, 2022 · 0 comments

Comments

@uohmak4fvpqe
Copy link

uohmak4fvpqe commented Jun 10, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant