[SERVER-48966] Ninja generator does not emit dependencies on template inputs Created: 18/Jun/20  Updated: 29/Oct/23  Resolved: 29/Jun/20

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.4.1, 4.7.0

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Steps To Reproduce:

Generate a ninja file, build libwiredtiger.so, then edit wiredtiger.in, and rebuild libwiredtiger.so. Ninja will report that the file is up to date, when in fact SCons should have been re-invoked to regenerate wiredtiger.h from wiredtiger.in.

Sprint: Dev Platform 2020-06-29
Participants:

 Description   

The Ninja Generator has logic to fall back to SCons to produce generated sources that are produced via "template" like mechanisms that are available only to SCons, most notable SubstFile.

The current ninja generator neglects to declare that these files depend on their inputs. As a result, if, say wiredtiger.h.in is itself updated, SCons will not be re-invoked by the generated Ninja file to produce an updated wiredtiger.h

The fix is to include the source files as dependencies of the generated templates.



 Comments   
Comment by Githook User [ 13/Oct/20 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-50363 Merge --build-tools=next into stable

Merging the following fixes into the stable version of the build tools
and migrate fully from --ninja=next to the --build-tools=next:

(cherry picked from commit 78bb3f3c8a658a5a9fec8d55864e426382f68bd0)
Branch: v4.4
https://github.com/mongodb/mongo/commit/e7f6696a96db5438a269c5e67a06ff9e05cb897a

Comment by Githook User [ 07/Oct/20 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-50363 Merge --build-tools=next into stable

Merging the following fixes into the stable version of the build tools
and migrate fully from --ninja=next to the --build-tools=next:

(cherry picked from commit 78bb3f3c8a658a5a9fec8d55864e426382f68bd0)
Branch: v4.4
https://github.com/mongodb/mongo/commit/7b93770e0835087c023ae3e3f36eeb46d204767f

Comment by Githook User [ 06/Oct/20 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-50363 Merge --build-tools=next into stable

Merging the following fixes into the stable version of the build tools
and migrate fully from --ninja=next to the --build-tools=next:

Comment by Githook User [ 06/Aug/20 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-48966 Added sources to the ninja tool for reinvokation targets, skip Python.Value nodes.

(cherry picked from commit 21075112a999e252a22e9c9bd64e403cec892df3)
Branch: v4.4
https://github.com/mongodb/mongo/commit/344d765b59512c4dd5defa135044e3617162a17c

Comment by Andrew Morrow (Inactive) [ 25/Jun/20 ]

We should backport this to v4.4 as well.

Comment by Githook User [ 25/Jun/20 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com'}

Message: SERVER-48966 Added sources to the ninja tool for reinvokation targets, skip Python.Value nodes.
Branch: master
https://github.com/mongodb/mongo/commit/21075112a999e252a22e9c9bd64e403cec892df3

Generated at Thu Feb 08 05:18:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.