Bug 455583 - make doesnt use RM macro to remove intermediate files
make doesnt use RM macro to remove intermediate files
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: make (Show other bugs)
10
All Linux
low Severity high
: ---
: ---
Assigned To: Petr Machata
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-16 09:09 EDT by JW
Modified: 2015-05-04 21:34 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-27 06:00:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description JW 2008-07-16 09:09:54 EDT
Description of problem:
Intermediate files specified with .INTERMEDIATE rule are removed using
unlink(2)rather than invoking whatever the RM macro is currently set to.  Make
misleadingly echoes the blatant lie "rm ..." when the unlink is performed.  It
does not invoke 'rm'.

Version-Release number of selected component (if applicable):
make-3.81-10

How reproducible:
Always

Steps to Reproduce:
1. Create Makefile viz:

RM=rm -i
.INTERMEDIATE: a
all: a
a:
    touch $@

2. make -n
  
Actual results:
touch a
rm a


Expected results:
touch a
rm -i a

Additional info:
Comment 1 Petr Machata 2008-09-15 15:25:57 EDT
I'm not sure make is supposed to do that.  The goal is to remove the file, not to launch $(RM); at least I don't see anything to the effect in the manual.  The "rm a" that appears is in my opinion more of a hint, default value of $(RM) is "rm -f", not "rm".  I'm inclined to NOTABUG this.
Comment 2 Bug Zapper 2008-11-26 06:00:25 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Petr Machata 2008-11-26 08:32:15 EST
My point from Comment #1 still stands.  The goal is to remove intermediate files, not to run arbitrary user-defined commands.  I'm notabuging this.
Comment 4 JW 2008-11-26 08:45:24 EST
I think you need to understand the circumstances which might require control over the actual 'rm'. Some unix variants have a 'rm' command that will by default remove a single file without prompting but which will, by default, not remove multiple files without prompting (this is in the absence of -i or -f options).

The intent is not to invoke arbitrary commands.

The intent is to allow the user to control the way in which commands are performed.

Every other action which physically alters a filesystem is controllable in ones Makefile.

I am therefore of the opinion that you are completely wrong in your judgement. And I am therefore reopening this bug.
Comment 5 Petr Machata 2008-11-26 09:31:20 EST
make uses unlink syscall to remove files.  Configuring the way files should be removed seems redundant to me, and actually running the $(RM) process for each file you need deleted is a waste of resources.

This issue is beyond me as a package maintainer.  I'll have to ask you to take it upstream.  If they decide it's a good idea, I'll happily include the patch in Fedora.
Comment 6 JW 2008-11-26 09:40:06 EST
(In reply to comment #5)
> ... and actually running the $(RM) process for each
> file you need deleted is a waste of resources.

Really?  So perhaps 'make' is a 'waste of resources' because anyone can type the commands on their command-line and thereby save resources.  Or perhaps all compilers are a 'waste of resources' because anyone could hand-code the assembler instructions.

Are you really so bereft of ideas that you have to conjure up such lame reasoning to (lazily) eradicate a bug?
Comment 7 Petr Machata 2008-11-26 09:47:14 EST
Launching separate process to delete a file is a waste of resources compared to mere unlink, yes.  I'm eagerly awaiting your upstream patches that will prove that it actually /does/ make sense to do that.
Comment 8 JW 2008-11-26 21:47:53 EST
(In reply to comment #7)
> Launching separate process to delete a file is a waste of resources compared to
> mere unlink, yes.

Please explain, then, why the RM macro exists and why it defaults to "rm -f" and why it is used sometimes and not other times.

If, as you claim, it is all about a "waste of resources", then why is it ok for the resources to be wasted when the RM macro is actually used, and not at other times?

I find it hard to believe and apparently intelligent person (and a Algol/Java developer at that) can actually think that executing rm is a waste of resources.  You cannot possibly be serious.
Comment 9 Petr Machata 2008-11-27 06:00:35 EST
The reason $(RM) exists is the same why there is default for $(CC), $(CXX), etc.  It's for portable use in actual make rules, should you need to delete a file.  In scripts, there's no other way.  make, however, can afford to remove intermediate files by unlinking them.

Also don't get too attached to my wasted resources line of reasoning.  It's true all right, but not the only reason I don't want to implement what you ask.  (Even though I would have spent less time actually writing the patch than I already spent bickering about this feature request.)

Note You need to log in before you can comment on or make changes to this bug.