bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60595] make doesn't always restart when a makefile is rebuilt


From: André Chalella
Subject: [bug #60595] make doesn't always restart when a makefile is rebuilt
Date: Tue, 1 Jun 2021 00:01:04 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

Follow-up Comment #5, bug #60595 (project make):

Thank you for all the information and for considering the issue in such
careful manner!

> I assume in your real makefile you've accounted for this and something does
build the target makefile (or maybe you include it with "-include").

No, when building the included makefile is skipped, touching the file is
skipped entirely (i.e this part of the recipe is basically "echo Skipping;
exit"). I haven't encountered any problems, that is, with regular "include"
(not "-include" or "sinclude"), it works fine without a single error or even a
warning: building the dependency makefile is skipped with just a custom
message, then make restarts, then it correctly builds said makefile, then make
restarts again, then it builds my project correctly.

I know the manual describes a failure mode like you said, but I haven't seen
it happen even once. Let me explain in more detail, quoting the manual:

> If an included makefile cannot be found in any of these directories, a
warning message is generated, but it is not an immediately fatal error;

I don't get any warning messages when the include files don't exist yet. Make
just carries on and tries to build them before restarting. It might be worth
mentioning that, in the "include" line, I specify the relative location of
each included file, like: "include dep/mod/helper.d dep/program.d".

> Once it has finished reading makefiles, make will try to remake any that are
out of date or don’t exist.

Yes, that happens just fine.

> Only after it has tried to find a way to remake a makefile and failed, will
make diagnose the missing makefile as a fatal error.

When making the makefile is skipped, there is no fatal error, like I said.
Maybe that's because the recipe terminates successfully ("exit") instead of
abnormally or with an error value?

With "make -d", when a makefile is skipped as described above, make outputs
"Reaping winning child" and "Successfully remade target file 'dep/program.d'",
even though the file still doesn't exist and will be created only in the next
restart (which occurs flawlessly). I thought this was simply because the
recipe exits without error, like I said above.

For all that, it never struck me as necessary preparing for the scenario you
described. Does it look like I'm doing something wrong?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60595>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]