Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-64664

ninja tool should not consider install files generated source

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.2, 5.0.9, 4.4.15
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v5.3, v5.0, v4.4
    • Dev Platform 2022-04-04, Dev Platform 2022-04-18

      The ninja tool looks at any output with a header file as generated source. However install edges have outputs with header files, and they get labeled as generated source. This can cause circular dependencies in a few edge cases, and should be a general improvement.

      Possible fix is just checking for the "INSTALL" rule when determining if a file is generated source:

      diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py
      index 5826be827f4..d621bb3ada0 100644
      --- a/site_scons/site_tools/ninja.py
      +++ b/site_scons/site_tools/ninja.py
      @@ -664,7 +664,7 @@ class NinjaState:
                   output
                   # First find builds which have header files in their outputs.
                   for build in self.builds.values()
      -            if self.has_generated_sources(build["outputs"])
      +            if build['rule'] != 'INSTALL' and self.has_generated_sources(build["outputs"])
                   for output in build["outputs"]
                   # Collect only the header files from the builds with them
                   # in their output. We do this because is_generated_source
      

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            daniel.moody@mongodb.com Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: