[cmake-developers] Toward a more deterministic ninja generator

Nicolas Desprès nicolas.despres at gmail.com
Fri Jun 17 05:40:29 EDT 2016


On Thu, Jun 16, 2016 at 7:14 PM, Brad King <brad.king at kitware.com> wrote:

> On 06/14/2016 11:18 AM, Nicolas Desprès wrote:
> > It makes the ninja generator more deterministic by sorting the
> > build edge's inputs/outputs. It does not introduce any
> > regression on my macbookpro.
> >
> > This could help to fix issue #15968.
>
> What examples of non-determinism have you observed after the changes
> already made for that issue?
>

The LINK_LIBRARIES list has not the same order for an executable target.  I
have that after the 79th generation using cmake 3.5.2. With cmake master
(d4283ca18b7) I did not reproduce it after 100 tries.


> >  + // We assume that commands using $in and $out varialbes do not care
> >  + // about the order of their inputs/outputs files, but commands that do
> >  + // not use them do care (like custom commands for instance).
>
> I'd prefer not to make this assumption.  CMake should order the
> inputs and outputs in a deterministic way before getting to the
> code in question.  If that is not happening then there may be
> a deeper problem.  Sorting this late is fixing the symptom.
>
>
Yes you are right.

I did not took enough time to read the issue history and I did not test
with master.

Sorry for the noise.

-- 
Nicolas Desprès
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160617/2d66ae30/attachment.html>


More information about the cmake-developers mailing list