build:wafsamba: Remove samba_utils.runonce
authorThomas Nagy <tnagy@waf.io>
Thu, 5 Nov 2015 01:06:42 +0000 (02:06 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 6 Nov 2015 09:37:24 +0000 (10:37 +0100)
commit963ccff806cf58898cdc8808138453d95df41b01
treebebdc7816ef2d46c13d85b1a0dabf8c06c9213c1
parent1f4f081b7aa7cbb8c9f92f0c5e39a870a5c1c6a3
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>
buildtools/wafsamba/samba_autoconf.py
buildtools/wafsamba/samba_bundled.py
buildtools/wafsamba/samba_perl.py
buildtools/wafsamba/samba_utils.py
buildtools/wafsamba/wafsamba.py
buildtools/wafsamba/wscript
lib/replace/wscript