From 190555a8d631b387323e7d7d3771c56fa1884743 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Fri, 28 Jun 2019 08:47:33 +0200 Subject: [PATCH] Add a testcase for #2244: deadlock with cython+subst tasks --- playground/cython/c_lib/extra_dep.h.in | 2 ++ playground/cython/wscript | 30 +++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 playground/cython/c_lib/extra_dep.h.in diff --git a/playground/cython/c_lib/extra_dep.h.in b/playground/cython/c_lib/extra_dep.h.in new file mode 100644 index 00000000..acc41c53 --- /dev/null +++ b/playground/cython/c_lib/extra_dep.h.in @@ -0,0 +1,2 @@ + +#define bindir "@BINDIR@" diff --git a/playground/cython/wscript b/playground/cython/wscript index 1cdd8a41..eb2a5f7d 100644 --- a/playground/cython/wscript +++ b/playground/cython/wscript @@ -40,13 +40,13 @@ def build(ctx): target = 'cxx_lib', includes = 'cxx_lib') - # first try to build a C-based cython extension + # build a C-based cython extension ctx( features = 'c cshlib pyext', source = 'src/cy_ctest.pyx', target = 'cy_ctest', includes = 'c_lib', - use = 'c_lib') + use = 'c_lib') # then a C++-based one ctx( @@ -54,7 +54,7 @@ def build(ctx): source = 'src/cy_cxxtest.pyx', target = 'cy_cxxtest', includes = 'cxx_lib', - use = 'cxx_lib') + use = 'cxx_lib') # a C++ application which uses a C function from a cython module ctx( @@ -62,5 +62,25 @@ def build(ctx): source = 'cxx_lib/app.cxx', target = 'cy-app', includes = 'cxx_lib src', - use = 'cxx_lib' - ) + use = 'cxx_lib') + + # --------------------------------------------------------------- + # Testcase for #2244 below + + ctx.get_tgen_by_name('cy_ctest').features += ' subst_header_order' + + # a generated header for cy_ctest + ctx( + features = 'subst', + source = 'c_lib/extra_dep.h.in', + target = 'c_lib/extra_dep.h', + ) + + from waflib import TaskGen + @TaskGen.feature('subst_header_order') + @TaskGen.after('process_source') + def set_subst_before_cython_tasks(self): + tg = self.bld.get_tgen_by_name('c_lib/extra_dep.h') + tg.post() + for tsk in self.tasks: + tsk.run_after.add(tg.tasks[-1])