From efe586285488a4b2087631c54e14b5c07f6f7909 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 13 Jan 2016 16:20:00 -0800 Subject: Fix bug 2081: Better messaging for different actions for same target in two environments --- src/engine/SCons/Builder.py | 2 +- test/Builder/different-actions.py | 2 ++ test/Builder/multi/different-environments.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index b457d1e..80dcaca 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -299,7 +299,7 @@ def _node_errors(builder, env, tlist, slist): msg = "Two different environments were specified for target %s,\n\tbut they appear to have the same action: %s" % (t, action.genstring(tlist, slist, t.env)) SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg) else: - msg = "Two environments with different actions were specified for the same target: %s" % t + msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents,contents) raise UserError(msg) if builder.multi: if t.builder != builder: diff --git a/test/Builder/different-actions.py b/test/Builder/different-actions.py index 33a1363..d84a9f9 100644 --- a/test/Builder/different-actions.py +++ b/test/Builder/different-actions.py @@ -43,6 +43,8 @@ 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 +(action 1: echo 1 > out.txt) +(action 2: echo 2 > out.txt) """) + TestSCons.file_expr test.run(arguments='out.txt', status=2, stderr=expect) diff --git a/test/Builder/multi/different-environments.py b/test/Builder/multi/different-environments.py index ad5154a..68749cf 100644 --- a/test/Builder/multi/different-environments.py +++ b/test/Builder/multi/different-environments.py @@ -57,6 +57,8 @@ test.write('file03b.in', 'file03b.in\n') expect = TestSCons.re_escape(""" scons: *** Two environments with different actions were specified for the same target: file03.out +(action 1: /usr/bin/python build.py 1 file03.out file03b.in) +(action 2: /usr/bin/python build.py 2 file03.out file03b.in) """) + TestSCons.file_expr test.run(arguments='file03.out', status=2, stderr=expect) -- cgit v0.12