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

make AIB build only targets

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • 6.0 Desired
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Development Platform

      Sometimes a developer may just only want to build a component and is not interested in the installation step. AIB should support building all the components dependencies and not needing to wait through the install step for a complete build.

       

      Below is a possible solution:

      diff --git a/site_scons/site_tools/auto_install_binaries.py b/site_scons/site_tools/auto_install_binaries.py
      index 38427d8ef41..b5a955ec03d 100644
      --- a/site_scons/site_tools/auto_install_binaries.py
      +++ b/site_scons/site_tools/auto_install_binaries.py
      @@ -360,6 +360,19 @@ def auto_install_task(env, component, role):
           entry = get_alias_map_entry(env, component, role)
           return list(entry.files)
       
      +def build_component_task(env, component, role):
      +    """Auto install task."""
      +    entry = get_alias_map_entry(env, component, role)
      +    build_targets = []
      +    for file in list(entry.files):
      +        files =  [
      +            child
      +            for child in file.all_children()
      +            if not child.path.startswith(env.Dir("$DESTDIR").path)
      +        ]
      +        build_targets += files
      +
      +    return build_targets
       
       def auto_install_pseudobuilder(env, target, source, **kwargs):
           """Auto install pseudo-builder."""
      @@ -586,6 +599,7 @@ def generate(env):  # pylint: disable=too-many-statements
           env.AppendUnique(
               AIB_TASKS={
                   "install": auto_install_task,
      +            "build": (build_component_task, False)
               }
           )
       
      diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py
      index 5826be827f4..8b0d928a04a 100644
      --- a/site_scons/site_tools/ninja.py
      +++ b/site_scons/site_tools/ninja.py
      @@ -671,7 +671,7 @@ class NinjaState:
                   # returns True if it finds a header in any of the outputs,
                   # here we need to filter so we only have the headers and
                   # not the other outputs.
      -            if self.is_generated_source(output)
      +            if self.is_generated_source(output) and not build["rule"] == "INSTALL"
               })
       
               if generated_source_files:
      

            Assignee:
            backlog-server-devplatform [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
            Reporter:
            daniel.moody@mongodb.com Daniel Moody
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: