diff options
author | Thomas Nagy <tnagy@waf.io> | 2015-11-05 02:06:42 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-11-06 10:37:24 +0100 |
commit | 963ccff806cf58898cdc8808138453d95df41b01 (patch) | |
tree | bebdc7816ef2d46c13d85b1a0dabf8c06c9213c1 /lib | |
parent | 1f4f081b7aa7cbb8c9f92f0c5e39a870a5c1c6a3 (diff) | |
download | samba-963ccff806cf58898cdc8808138453d95df41b01.tar.gz |
build:wafsamba: Remove samba_utils.runonce
The decorator order matters in the following:
"""
@runonce
@conf
function()
"""
First, the @conf decorator binds the function to the configuration context
and then returns the same function. The @runonce decorator then takes
the output function and replaces it by another that performs caching. This new
function remains in the current script and is never bound to the configuration
context, so caching never occurs.
The declaration would have been correct if written like this:
"""
@conf
@runonce
function()
"""
Yet the decorator @run_once does not keep the function name (__name__), so the
annotation with @conf would fail. The straightforward approach is to remove
all the incorrect @runonce occurrences.
Besides that, the function Utils.run_once is already present in the Waf library,
and is sufficient for the current needs of the Samba code (it caches only the
first argument). Therefore samba_utils.runonce can be safely replaced by
Utils.run_once, which is also present in Waf 1.8.
Note: at runtime, only SETUP_BUILD_GROUPS seems to actually use caching.
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/replace/wscript | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript index a1c2094a00b..7bfe7eec54a 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -14,7 +14,7 @@ while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5: sys.path.insert(0, srcdir + '/buildtools/wafsamba') import wafsamba, samba_dist -import Options +import Options, Utils samba_dist.DIST_DIRS('lib/replace buildtools:buildtools third_party/waf:third_party/waf') @@ -23,7 +23,7 @@ def set_options(opt): opt.PRIVATE_EXTENSION_DEFAULT('') opt.RECURSE('buildtools/wafsamba') -@wafsamba.runonce +@Utils.run_once def configure(conf): conf.RECURSE('buildtools/wafsamba') |