diff --git a/tests/nodes/wscript b/tests/nodes/wscript index 76fe2b8b..36302a5c 100644 --- a/tests/nodes/wscript +++ b/tests/nodes/wscript @@ -23,8 +23,12 @@ def build(bld): #print( 'path from srcnode', bld.path.find_or_declare('aaa').path_from(bld.bldnode) ) - bld.install_files('/tmp/bar', 'wscript') + # folders as nodes are best avoided + dnode = bld.path.get_bld().make_node('testdir') + bld(rule='mkdir -p ${TGT}', target=dnode) + bld(rule='touch ${TGT}', source=dnode, target=dnode.make_node('stuff'), cls_str=lambda x: 'stuff') + bld.install_files('/tmp/bar', 'wscript') bld(features='c cprogram', source='main.c', target='app') diff --git a/waflib/Node.py b/waflib/Node.py index 4a94249e..ea18938b 100644 --- a/waflib/Node.py +++ b/waflib/Node.py @@ -823,7 +823,16 @@ class Node(object): try: ret = cache[self] except KeyError: - ret = cache[self] = Utils.h_file(self.abspath()) + p = self.abspath() + try: + ret = cache[self] = Utils.h_file(p) + except EnvironmentError: + if os.path.isdir(p): + # allow folders as build nodes, do not use the creation time + st = os.stat(p) + ret = cache[self] = Utils.h_list([p, st.st_ino, st.st_mode]) + return ret + raise return ret # --------------------------------------------