[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Intermediate file removal ... considered harmful??
From: |
Paul Smith |
Subject: |
Intermediate file removal ... considered harmful?? |
Date: |
Wed, 31 Mar 2021 17:38:22 -0400 |
User-agent: |
Evolution 3.36.4-0ubuntu1 |
I've been thinking about this for a while and Dmitry's recent Savannah
proposal caused me to decide to post it.
Is there any point, these days, in automatically removing intermediate
files in GNU make?
Back in the day when disk was expensive I suppose I can see where
automatically removing unnecessary files was helpful but these days I'm
not sure I see any point. Especially because it only applies in very
limited situations: you have to have something like ar which can
reconstruct a target from a previous instance of the target plus just
the changed files.
On the other hand, it causes problems. First there are problems due to
confusion on the part of users searching their makefiles for where that
weird "rm ..." command came from. Second, we have requests asking for
ways to customize this command (although actually GNU make doesn't exec
rm, it just runs unlink(2)--which of course doesn't work on
directories!) Third, there's not a flexible way to disable
intermediate files: .SECONDARY is intended to do this but it's annoying
in that it doesn't apply to patterns only explicit files, which is kind
of useless (if you know the explicit files you can just create some
random target that lists the files as prerequisites and get the same
result). Also, the name is confusing / not obvious.
I think it is still useful to keep intermediate files as a concept,
where if an intermediate file in a chain of implicit rules doesn't
exist but the mod time of the source end of the chain is newer than the
target end of the chain, we don't bother to rebuild the chain.
But, is there a good reason for make to pro-actively delete
intermediate files? I'm not sure I see it.
Leaving aside backward-compat issues, is there a current use-case for
the auto-delete feature of intermediate files?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Intermediate file removal ... considered harmful??,
Paul Smith <=