On 10/30/2017 02:22 PM, Paul Smith wrote:
On Tue, 2017-10-31 at 07:39 +1100, NeilBrown wrote:
On Mon, Oct 30 2017, Tim Murphy wrote:

For my money -j is always a top-level setting.   To have it per makefile
and then let makefiles depend on that behaviour would open the door to lots
of scary bugs.

I don't see what scary bugs we might have; I've seen issues where
makefiles not intended to be used with -j will not work properly with
-j, but I'm not sure I've ever seen an issue with a makefile intended
to work with -j that fails when run without it, or with a different
value.

Here's a trivial example that shows how a build could fail if -j is not specified, but work if -j is specified (with any value, in this case), assuming "output" does not exist to start:


        all: reader writer
        
        reader:
                sleep 2
                cat output
        
        writer:
                echo PASS > output

Of course "work" is used somewhat loosely here, as the build might appear to work but in fact pick up stale data if "output" happens to exist prior to the start of the run (eg, in an incremental build).

It's not a common scenario, to be sure, but I have encountered this "in the wild". Just last week I worked with a large commercial build which exhibited this behavior, due to a missing dependency between the reader and writer jobs.


Regards,

Eric Melski
Chief Architect
Electric Cloud, Inc.


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to