[SERVER-46519] Regenerating ninja does not require to rebuild the world Created: 02/Mar/20  Updated: 29/Oct/23  Resolved: 27/Apr/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0-rc4, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Mathew Robinson (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-47776 Promote ninja-next to stable Closed
Duplicate
is duplicated by SERVER-46748 The new native Ninja support doesn't ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Dev Platform 2020-03-09, Dev Platform 2020-04-20, Dev Platform 2020-05-04
Participants:

 Description   

@mathias.stearn pointed out on Slack that forcing the implicit dep on the ninja file is incorrect:

There are a few inaccuracies there. For one thing, ninja automatically makes command lines the equivalent of input edges so that if the command line changes, 
the target will be rebuilt (except for generator=1 targets, which should only be the build.ninja file itself). So we don't need to do anything special to make sure that
 things get rebuilt in that case. It also sorta-kinda makes everything that the build.ninja task depends on have an order-only edge on build.ninja implicitly 
(really, if the build.ninja needs to be updated, it will do that first and reparse (repeatedly) before scheduling anything that isn't on the path to regenerating build.ninja). 

We forced this edge before we started using generator=1 which is why we needed it then but no longer do. Meson does not behave this way either.



 Comments   
Comment by Githook User [ 29/Apr/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-46519 Do not force a global rebuild on ninja regeneration

(cherry picked from commit dc116507128f70cc2399bf6656764313aa7d7333)
Branch: v4.4
https://github.com/mongodb/mongo/commit/e350287d6bf433c509884916ff5ca998efebaced

Comment by Githook User [ 27/Apr/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-46519 Do not force a global rebuild on ninja regeneration
Branch: master
https://github.com/mongodb/mongo/commit/dc116507128f70cc2399bf6656764313aa7d7333

Comment by Mathew Robinson (Inactive) [ 06/Mar/20 ]

This is not quite as easy as just removing this implicit edge. For two reasons:

  • I tested this after removing the implicit edge then added white space to the SConstruct file. I would expect this to cause a regeneration and it did not. Not sure what we're missing here.
  • After forcefully regenerating to test a new version of this it caused a rebuild of the world even though the implicit dependency on the build.ninja was not there.
Generated at Thu Feb 08 05:11:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.