From c71794e951807d142909c90deaebefd0efa88388 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 14 Apr 2003 05:51:06 +0000 Subject: [PATCH] Bugfix: don't create duplicate virtual targets for searched lib with the same properties. Thanks to Andre Hentz for finding this bug and providing the test case. * new/builtin.jam (searched-lib-generator.run): Pass the result through 'virtual-target.register'. * test/searched_lib.py: Add new test. [SVN r18247] --- new/builtin.jam | 2 +- test/searched_lib.py | 19 +++++++++++++++++++ v2/test/searched_lib.py | 19 +++++++++++++++++++ v2/tools/builtin.jam | 2 +- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/new/builtin.jam b/new/builtin.jam index ff2a4619b..af484d295 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -430,7 +430,7 @@ rule searched-lib-generator ( ) # attach an action and properties to the target a = [ new null-action $(t) : $(property-set) ] ; $(t).action $(a) ; - return $(t) ; + return [ virtual-target.register $(t) ] ; } } } diff --git a/test/searched_lib.py b/test/searched_lib.py index 8cc2eccb3..390f00345 100644 --- a/test/searched_lib.py +++ b/test/searched_lib.py @@ -80,4 +80,23 @@ lib l : : l_r release ; t.run_build_system("-n") +# A regression test. Two virtual target with the same properties +# were created for 'l' target, which caused and error to be reported +# when actualizing targets. The final error is correct, but we should +# not create two duplicated targets. Thanks to Andre Hentz +# for finding this bug. +t.write("project-root.jam", "") + +t.write("a.cpp", "") + +t.write("Jamfile", """ +project a : requirements static ; + +lib a : a.cpp l ; +lib l : : l_f ; +""") + +t.run_build_system("-n") + + t.cleanup() diff --git a/v2/test/searched_lib.py b/v2/test/searched_lib.py index 8cc2eccb3..390f00345 100644 --- a/v2/test/searched_lib.py +++ b/v2/test/searched_lib.py @@ -80,4 +80,23 @@ lib l : : l_r release ; t.run_build_system("-n") +# A regression test. Two virtual target with the same properties +# were created for 'l' target, which caused and error to be reported +# when actualizing targets. The final error is correct, but we should +# not create two duplicated targets. Thanks to Andre Hentz +# for finding this bug. +t.write("project-root.jam", "") + +t.write("a.cpp", "") + +t.write("Jamfile", """ +project a : requirements static ; + +lib a : a.cpp l ; +lib l : : l_f ; +""") + +t.run_build_system("-n") + + t.cleanup() diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index ff2a4619b..af484d295 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -430,7 +430,7 @@ rule searched-lib-generator ( ) # attach an action and properties to the target a = [ new null-action $(t) : $(property-set) ] ; $(t).action $(a) ; - return $(t) ; + return [ virtual-target.register $(t) ] ; } } }