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

ninja tool should not consider install files generated source

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.3.2, 5.0.9, 4.4.15
    • None
    • None
    • Fully Compatible
    • v5.3, v5.0, v4.4
    • Dev Platform 2022-04-04, Dev Platform 2022-04-18

    Description

      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
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: