[SERVER-55259] build.ninja should always be left in a clean state by scons even if interrupted Created: 17/Mar/21  Updated: 29/Oct/23  Resolved: 18/Oct/21

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 5.2.0

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Ryan Egesdahl (Inactive)
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
Backport Requested:
v5.1, v5.0, v4.4
Sprint: Dev Platform 2021-09-06, Dev Platform 2021-09-20, Dev Platform 2021-10-04, Dev Platform 2021-10-18
Participants:

 Description   

Currently build.ninja is deleted by scons prior to rebuilding it. This means that if you interrupt it while it is being rebuilt, you can't just rerun ninja again, and instead must reinvoke scons, remembering any and all flags you previously passed it. Using SCons' Precious() helps here. In addition, you should write to a temporary file and rename on top of build.ninja when done writing to ensure that it is atomically replaced.



 Comments   
Comment by Githook User [ 15/Oct/21 ]

Author:

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

Message: SERVER-55259 Ensure build.ninja is always in a clean state
Branch: master
https://github.com/mongodb/mongo/commit/4a792c26c04f5c40698d9fb5e03f053e98b6fd38

Comment by Githook User [ 15/Oct/21 ]

Author:

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

Message: Revert "SERVER-55259 Ensure build.ninja is always in a clean state"

This reverts commit c12d02757ceb26e611a7bafcd30d78db99d8778f.
Branch: master
https://github.com/mongodb/mongo/commit/a9e2c89cae1be4235dee8321e0ff5511566772c1

Comment by Githook User [ 13/Oct/21 ]

Author:

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

Message: SERVER-55259 Ensure build.ninja is always in a clean state
Branch: master
https://github.com/mongodb/mongo/commit/c12d02757ceb26e611a7bafcd30d78db99d8778f

Comment by Githook User [ 12/Oct/21 ]

Author:

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

Message: Revert "SERVER-55259 Ensure build.ninja is always in a clean state"

This reverts commit 13f0ae71f634409f2e219616ac489b45057d56bb.
Branch: master
https://github.com/mongodb/mongo/commit/9b9183727da0b8f1bbe2e03146d167d5d65e4ea7

Comment by Githook User [ 11/Oct/21 ]

Author:

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

Message: SERVER-55259 Ensure build.ninja is always in a clean state
Branch: master
https://github.com/mongodb/mongo/commit/13f0ae71f634409f2e219616ac489b45057d56bb

Comment by Ryan Egesdahl (Inactive) [ 27/Aug/21 ]

I couldn't find an open ticket that referenced build.ninja, so I will just work from this one.

Comment by Andrew Morrow (Inactive) [ 17/Mar/21 ]

redbeard0531 - I think this was requested before somewhere, we will look for the ticket when we triage this. But I agree the target should be Precious at least, and we can definitely investigate doing the atomic replacement approach.

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