code: def start_building (self, main_target_instance):
          
          assert isinstance(main_target_instance, MainTarget)
          if id(main_target_instance) in self.targets_being_built_:
              names = []
              for t in self.targets_being_built_.values() + [main_target_instance]:
                  names.append (t.full_name())
  
              get_manager().errors()("Recursion in main target references\n")
  
          self.targets_being_built_[id(main_target_instance)] = main_target_instance
docs: Helper rules to detect cycles in main target references.