Jobs scheduled in a different order than ninja
michaelforney opened this issue · comments
ninja schedules jobs based on the first item in a std::set<Edge *>
, which I think means edges with lower pointer values are started first.
https://github.com/ninja-build/ninja/blob/e0bc2e5fd9036a31d507881e1383adde3672aaef/src/build.cc#L405
samurai uses a singly-linked list, inserting at the front, so the most recently queued edge is started first.
Lines 95 to 104 in 854f648
I'm not interested in matching ninja's behavior here, since any problems that arise are due to buggy build graphs, and I don't think a binary tree is the right data structure for a queue.
We could possibly try to keep track of the end pointer and insert at the back instead, but not sure if that's worth the trouble.
Added a note about this in the README.