<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:10:13 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-45990] Ninja should not have to rebuild everything when build.ninja file is modified</title>
                <link>https://jira.mongodb.org/browse/SERVER-45990</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If my build.ninja file is modified at all, then ninja must perform a full rebuild of all 3k+ objects for the &lt;tt&gt;mongod&lt;/tt&gt; binary. This occurs most during git branch checkouts, which often modifies Scons dependencies. This makes branch checkouts, a commonly recommended server workflow, impractical.&lt;/p&gt;

&lt;p&gt;The old ninja module was able to determine which files actually required rebuilding. We should consider making a similar optimization for the new Ninja generator.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1130824">SERVER-45990</key>
            <summary>Ninja should not have to rebuild everything when build.ninja file is modified</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-devplatform">[DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP)</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Feb 2020 18:01:06 +0000</created>
                <updated>Tue, 6 Dec 2022 02:36:41 +0000</updated>
                            <resolved>Wed, 5 Feb 2020 19:17:42 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2785498" author="mathew.robinson" created="Wed, 5 Feb 2020 19:17:34 +0000"  >&lt;p&gt;I&apos;m pretty sure this cannot be true &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt; and at least if it was that was a bug in the old module.&lt;/p&gt;

&lt;p&gt;Here is where the generator rule for the build.ninja was created in the old module: &lt;a href=&quot;https://github.com/RedBeard0531/mongo_module_ninja/blob/master/build.py#L1238&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/RedBeard0531/mongo_module_ninja/blob/master/build.py#L1238&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which is the same as our rule except we don&apos;t track the dependencies in a depsfile and instead put them in the ninja file itself. This does explain why the old module was resilient to SConscript removals and we aren&apos;t though as &lt;a href=&quot;https://ninja-build.org/manual.html#ref_headers&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;per the ninja build manual depsfiles are resilient to files listed there being removed.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is where the write method is defined you can see that it unconditionally rewrites the ninja file: &lt;a href=&quot;https://github.com/RedBeard0531/mongo_module_ninja/blob/master/build.py#L1023&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/RedBeard0531/mongo_module_ninja/blob/master/build.py#L1023&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is where that method is called so there is no conditionals here: &lt;a href=&quot;https://github.com/RedBeard0531/mongo_module_ninja/blob/master/build.py#L73&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/RedBeard0531/mongo_module_ninja/blob/master/build.py#L73&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We did write a version of the new ninja generator which did this but it comes at a steep performance cost because you have to ensure all dependency, target, and build order listings are deterministic. (read: a lot of list sorting in loops) and chose to leave that out since with Icecream and ccache a full rebuild can happen very quickly.&lt;/p&gt;

&lt;p&gt;If you can set up this scenario with the old module on your machine where it doesn&apos;t rebuild the world when swapping branches I&apos;d be very interested to come see it so I can see how we can implement it on our side. But we conversed with some other ninja users in the office and it seems they always experienced full rebuilds after a regeneration. Additionally other build systems that specialize in ninja generation like Meson also work this way with explicit listings of build.ninja implicit dependencies and requiring full rebuilds after a ninja regeneration.&lt;/p&gt;

&lt;p&gt;Here is an in-depth explanation of why it works this way:&lt;/p&gt;

&lt;p&gt;All build targets in the ninja file depend on the Ninja file. This is for two reasons. One so that the ninja file is checked if it needs to be regenerated first thing in the build and two so that if it is regenerated all targets are rebuilt. Ninja works entirely off of timestamps to determine out-of-dateness as opposed to content signatures used by other build systems, like SCons. This has the benefit of being very fast, but at the cost of being simple. It means that we cannot do things like make a target depend only on it&apos;s CFLAGS. So if for instance we made the build.ninja file an order-only dependency of everything (so it would still be checked first thing in a build but not cause a full-rebuild) and we changed the SConstruct so that it adds a new required CFLAG to our build the ninja file would regenerate but no targets would rebuild with the new CFLAG. Because Ninja only operates on timestamps you never have the ability to tie that change of command line to the resulting target. So all ninja generators must enforce that all targets depend on the ninja file and rebuild if it changes.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25130"><![CDATA[Server Development Platform]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 5 Feb 2020 19:17:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 1 week ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 1 week ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-devplatform</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>mathew.robinson@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwnugv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwbutr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwngq7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>