bug-make
[Top][All Lists]
Advanced

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

Re: Are prerequisites made in deterministic order when parallelism is di


From: Kyle Rose
Subject: Re: Are prerequisites made in deterministic order when parallelism is disabled?
Date: Wed, 14 Jun 2017 11:25:35 -0400

The right answer is always to write your makefiles so the rules execute in the required order whether run in parallel or not. Relying on whichever arbitrary ordering GNU make employs, even if that behavior is stable (either historically or by design), is likely to result in sadness at some point, such as when someone calls into your makefile recursively from their own -j build.

Tl;dr: underspecified dependencies create hidden technical debt.

Kyle

On Tue, Jun 13, 2017 at 11:33 AM, Brett Stahlman <address@hidden> wrote:
I don't see anything in the Make docs that guarantees prerequisites
will be processed in left to right order. Opinions on the web seems to
be split into 2 camps:

1. Make always builds dependencies in left to right order, but a
well-designed Makefile won't rely upon it.
2. Make is free to build dependencies in any order it likes, provided
it respects the stated dependencies.

My own recent experience suggests #2 is the correct statement, but I
can't rule out the possibility that a bug in my Makefile is producing
the apparent non-determinism I'm observing. At any rate, can anyone
point me to a definitive source on this?

Thanks,
Brett S.

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


reply via email to

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