From 9794cbe901096e0835bd4db0958826ec9ed316f4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 29 Sep 2015 15:20:11 -0700 Subject: Revised pull request #234 fixing bug 2840. Andrew Featherstone had code changes, but no test --- src/CHANGES.txt | 5 ++++ src/engine/SCons/Builder.py | 1 + test/Builder/different-actions.py | 56 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 test/Builder/different-actions.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 47a3f97..e27f978 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -18,6 +18,11 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Added new configure check, CheckProg, to check for existence of a program. + From Andrew Featherstone: + - Fix for issue #2840 - Fix for two environments specifying same target with different + actions not throwing hard error. Instead SCons was incorrectly issuing a warning + and continuing. + From Florian Miedniak: - Fixed tigris issue #3011: Glob() excludes didn't work when used with VariantDir(duplicate=0) diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 52a592b..c86012b 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -292,6 +292,7 @@ def _node_errors(builder, env, tlist, slist): if t.has_explicit_builder(): if not t.env is None and not t.env is env: action = t.builder.action + t_contents = t.builder.action.get_contents(tlist, slist, t.env) contents = builder.action.get_contents(tlist, slist, env) diff --git a/test/Builder/different-actions.py b/test/Builder/different-actions.py new file mode 100644 index 0000000..33a1363 --- /dev/null +++ b/test/Builder/different-actions.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Verify that two builders in two environments with different +actions generate an error. +""" + +import TestSCons + +test = TestSCons.TestSCons(match=TestSCons.match_re) + +test.write('SConstruct', """\ +e1 = Environment() +e2 = Environment() + +e1.Command('out.txt', [], 'echo 1 > $TARGET') +e2.Command('out.txt', [], 'echo 2 > $TARGET') +""") + +expect = TestSCons.re_escape(""" +scons: *** Two environments with different actions were specified for the same target: out.txt +""") + TestSCons.file_expr + +test.run(arguments='out.txt', status=2, stderr=expect) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12