Commit 029a1540 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Julien Muchembled

in verbose mode, save .installed.cfg each time a part is installed.

parent 09ecce3c
...@@ -801,6 +801,9 @@ class Buildout(DictMixin): ...@@ -801,6 +801,9 @@ class Buildout(DictMixin):
' '.join(installed_parts)) ' '.join(installed_parts))
_check_for_unused_options_in_section(self, part) _check_for_unused_options_in_section(self, part)
if self._log_level < logging.INFO:
self._save_installed_options()
def _uninstall_part(self, part, installed_part_options): def _uninstall_part(self, part, installed_part_options):
# uninstall part # uninstall part
__doing__ = 'Uninstalling %s.', part __doing__ = 'Uninstalling %s.', part
......
  • @jm @kazuhiko what was the reason for this change ?

    The concern is that it reintroduces the O(n²) complexity on number of parts, but 09ecce3c was supposed to make it O(n).

    @yusei identified that the time to install a part was depending on the number of parts.

  • I don't remember the exact reason for this change but the trigger can be debug mode instead of verbose mode, i.e. SlapOS will not invoke buildout with debug mode. What do you think ?

        In debug mode, instead of verbose mode, save .installed.cfg each time a part is installed.
    
    diff --git a/src/zc/buildout/buildout.py b/src/zc/buildout/buildout.py
    index 84f9928..2b273fc 100644
    --- a/src/zc/buildout/buildout.py
    +++ b/src/zc/buildout/buildout.py
    @@ -230,6 +230,7 @@ _buildout_default_options = _annotate_section({
         'log-level': 'INFO',
         'newest': 'true',
         'offline': 'false',
    +    'debug': 'false',
         'dry-run': 'false',
         'check-signature': 'true',
         'parts-directory': 'parts',
    @@ -410,6 +411,7 @@ class Buildout(DictMixin):
             self.newest = ((not self.offline) and
                            bool_option(buildout_section, 'newest')
                            )
    +        self.debug = bool_option(buildout_section, 'debug')
             self.dry_run = (buildout_section['dry-run'] == 'true')
             self.check_signature = (buildout_section['check-signature'] == 'true')
     
    @@ -824,7 +826,7 @@ class Buildout(DictMixin):
                         ' '.join(installed_parts))
                     _check_for_unused_options_in_section(self, part)
     
    -            if self._log_level < logging.INFO:
    +            if self.debug:
                     self._save_installed_options()
     
         def _uninstall_part(self, part, installed_part_options):
    @@ -2171,6 +2173,7 @@ def main(args=None):
                         options.append(('buildout', 'newest', 'false'))
                     elif op[0] == 'D':
                         debug = True
    +                    options.append(('buildout', 'debug', 'true'))
                     else:
                         _help()
                     op = op[1:]
    
  • It's quite inconsistent to introduce buildout:debug but ignore it for the post_mortem part. The debug variable should either become global (and no buildout:debug) or removed.

  • According to @yusei , when slapos node instance runs buildout , this self._log_level < logging.INFO condition evaluate to false, so this is apparently not a problem in slapos node instance.

    In my test, if I run ./bin/buildout, condition is true and I had to run ./bin/buildout -q for that condition to be false, but I have not checked how slapos runs buildout.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment