From 42622a6e523c71a47fbdc14f83797353b0812c71 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Mon, 7 Mar 2016 23:38:14 +0100 Subject: [PATCH] Do not cache Waf tools in configure --- ChangeLog | 2 +- TODO | 1 - waflib/Configure.py | 15 +++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94305611..02922ec6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ NEW IN WAF 1.9 - Change cflags in the beginning / cppflags at the end #1505 - Merge ${FOO}${BAR} flags in commands executed without a shell (no space added) - Interpret empty command-line defines as integer values #1704 + - Waf tools are not cached on "waf configure" by default anymore; pass conf.load(.., cache=True) * Performance highlights: - Reduce the key size in bld.task_sigs by adding bld.node_sigs and bld.imp_sigs @@ -27,4 +28,3 @@ NEW IN WAF 1.9 - Modify Utils.run_once so that it accepts a list of *args - Improve the task consumer in Runner.py - diff --git a/TODO b/TODO index 5b7b30b2..0580a562 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,6 @@ Waf 1.9 ------- -* Do not cache waf tool detection * Fix the vala detection * Better consistency between check_cfg and check_cc variables * Let more context commands depend on the configuration diff --git a/waflib/Configure.py b/waflib/Configure.py index e3c8d5cf..417bd4ae 100644 --- a/waflib/Configure.py +++ b/waflib/Configure.py @@ -228,7 +228,7 @@ class ConfigurationContext(Context.Context): tmpenv = self.all_envs[key] tmpenv.store(os.path.join(self.cachedir.abspath(), key + Build.CACHE_SUFFIX)) - def load(self, input, tooldir=None, funs=None, with_sys_path=True): + def load(self, input, tooldir=None, funs=None, with_sys_path=True, cache=False): """ Load Waf tools, which will be imported whenever a build is started. @@ -238,6 +238,8 @@ class ConfigurationContext(Context.Context): :type tooldir: list of string :param funs: functions to execute from the waf tools :type funs: list of string + :param cache: whether to prevent the tool from running twice + :type cache: bool """ tools = Utils.to_list(input) @@ -246,11 +248,12 @@ class ConfigurationContext(Context.Context): # avoid loading the same tool more than once with the same functions # used by composite projects - mag = (tool, id(self.env), tooldir, funs) - if mag in self.tool_cache: - self.to_log('(tool %s is already loaded, skipping)' % tool) - continue - self.tool_cache.append(mag) + if cache: + mag = (tool, id(self.env), tooldir, funs) + if mag in self.tool_cache: + self.to_log('(tool %s is already loaded, skipping)' % tool) + continue + self.tool_cache.append(mag) module = None try: