#953 Using recursive rm in makefile fails

component_package
closed
non-mingw (19)
2006-06-30
2006-06-29
Dave Silvia
No

I haven't included a Category as, although it's a
binutil, it's happening from within a make. I'm
including the text from the readme.txt in the
attached zip file below:

***** begin inclusion *****

This is a bug I found when using rm.exe from the GNU-
Win32 distribution. I
then switched to Msys and found the bug still present
(not surprising!;).

Included is a zip file of a small test make
directory. It builds a copyright
object for including in a product and instantiates a
directory hierarchy for
that same product.

In the makefile there is a fairly standard "clean"
target. It simply
removes the product directory hierarchy and the .o
and .exe files in the
copyright directory. It uses rm -rf to do this
normally. For illustrative
purposes I've added the -v switch. Also for
illustrative purposes I've added
a MinGWversions target and "which <utilname>"
and "<utilname> --version"
commands at relevant places. None of this is present
in the "normal" makefile,
but does not influence the outcome. I've added this
info in an attempt to be
compliant with the guidelines for submission stated
at:

http://www.mingw.org/bugs.shtml

In the same directory as the makefile is a
make_all.txt and a make_clean.txt.
These files are a capture of the command prompt
output on my system. As you
can see in the make_clean.txt file, rm fails to
delete a subdirectory, obj,
with a "permission denied" reason. If "mingw32-make
clean" is executed again,
the directory and its parent are then removed as
should be.

Is there something I'm doing wrong? I do not get the
same result if I just
execute rm -rvf from the command line (always).

thx,
Dave S.
<dsilvia@mchsi.com>

***** end inclusion *****

Discussion

  • Dave Silvia

    Dave Silvia - 2006-06-29

    Zip file of an example MinGW make hierarchy

     
  • Earnie Boyd

    Earnie Boyd - 2006-06-30
    • labels: --> non-mingw
    • milestone: --> component_package
    • assigned_to: nobody --> earnie
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2006-06-30

    Logged In: YES
    user_id=15438

    Firstly, make-3.80 is outdated.

    I would like at this further if you test and supply the
    results from make-3.81 which build OOB with MSYS and MinGW
    or with VB your choice. However, I'm thinking that the
    files in your directories are not being removed because they
    are still open. Windows doesn't allow a file to be removed
    while in use.

     
  • Dave Silvia

    Dave Silvia - 2006-06-30

    Logged In: YES
    user_id=1061988

    Okay, "Firstly", according to your website, 3.80 is
    current. Secondly, I spent a good deal of time putting
    together a simple illustration of the problem I was
    having. It duplicates itself quite readily. There are no
    files in the directories. Nothing is accessing the
    directories. Simply run make, then run make clean and the
    problem pops up. Thirdly, if you cannot be bothered with
    spending 5 minutes running a simple, sample make, I can't
    be bothered wasting my time reporting any problems I
    have. I realize it's the end of the week (and probably a
    long, hard one for you), but I'm not an idiot and I've
    tried many ways to get the thing to work and it hasn't.

    Pardon me for wasting both of our time. Mine in spending
    it to put together the most clear, easy example of the
    problem I could come up with. Your's by asking you to
    spend some of your valuable resources to listen to me!

    Have a nice day:-)

     
  • Dave Silvia

    Dave Silvia - 2006-06-30
    • status: pending --> open
     
  • Earnie Boyd

    Earnie Boyd - 2006-06-30

    Logged In: YES
    user_id=15438

    3.80 is the make package that we currently distribute, yes,
    but since then make has released a new and better version.
    I was being kind in looking at your problem and made a
    suggestion that *you* first try the newest version of make.
    Make is not maintained by the MinGW set of developers but
    we might if we have time help with an issue here or there.
    If make-3.81 doesn't resolve the issue my next course of
    action would have been to submit your test case for you to
    the GNU Make bug system. But, if you get your feelings hurt
    too easily because I asked you to take the initiative to use
    the most current version of make by building it yourself
    then I can't help further. Good luck in trying to solve
    your problem. 3.80 is known to be buggy on windows.

     
  • Earnie Boyd

    Earnie Boyd - 2006-06-30
    • status: open --> closed
     
  • Dave Silvia

    Dave Silvia - 2006-06-30

    Logged In: YES
    user_id=1061988

    Do you realize that what you are saying is people are
    better off not bothering with MinGW (since it's so buggy
    for Windows!) and they should just go directly to
    GNU.org? The whole point, supposedly, of MinGW is to
    supply Windows users with the best most current, most
    stable gnu software suitablly tailored for Windows. I
    dare say over 90% of what people use MinGW for is make and
    the compiler and your saying it's a favor to look at any
    problems.

    And it's not a matter of getting feelings hurt. It's a
    matter of professional courtesy that you seem to direly
    lack!

    Well, just do me a favor and don't do me any favors.
    Thanks for the tip that I'm better off with gnu and your
    just passing time at MinGW.

     
  • Dave Silvia

    Dave Silvia - 2006-06-30

    Logged In: YES
    user_id=1061988

    FYI 3.81 doesn't work either. Nor does 3.79 ('make.exe' in
    msys distribution)

     
  • Earnie Boyd

    Earnie Boyd - 2006-07-01

    Logged In: YES
    user_id=15438

    I might take a look at your makefile case and find *your*
    bug; but rm -rf in make does work or we would have heard
    about it before now. But as for this being bug with make
    itself, I don't think so. I especially believe this because
    you state that the "bug" exists in the MSYS version as well.

    I'll state again that windows will not allow the deletion of
    files (a directory is a file btw) when the file is in use.
    So if you've changed to a directory then the directory file
    is in use and trying to delete it will give a permission
    denied error. Same if a file is open by some program.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks