From 05f4c8b5b1e2675ea8d1e433e6db99bd7af5f503 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 3 Feb 2016 13:00:35 +0000 Subject: [PATCH] waf: ardupilotwaf: reset LAST_IDX on every build That is a workaround so that one can use `waf bin tests`, for example. In our context, the only restriction to the task generators creation is values defined during configuration. Thus, ideally, the recursion and task generators creation should be done only once for multiple build calls. We should do that in the future. --- Tools/ardupilotwaf/ardupilotwaf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index dc427c4f2e..9a1c864955 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -317,5 +317,10 @@ def options(opt): ) def build(bld): + global LAST_IDX + # FIXME: This is done to prevent same task generators being created with + # different idx when build() is called multiple times (e.g. waf bin tests). + # Ideally, task generators should be created just once. + LAST_IDX = 0 bld.add_pre_fun(_process_build_command) bld.add_pre_fun(_select_programs_from_group)