From ba20992924dd4c40f3986f02b66233a8a4ca5825 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Mon, 13 Sep 2004 21:41:40 +0000 Subject: [PATCH] Better error message when a target is built multiple ways. (Kevin Quick) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1063 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 3 +++ src/engine/SCons/Builder.py | 2 +- test/multi.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 33ef27a0..ec8ac36a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -51,6 +51,9 @@ RELEASE 0.97 - XXX $RPCGEN, $RPCGENFLAGS, $RPCGENCLIENTFLAGS, $RPCGENHEADERFLAGS, $RPCGENSERVICEFLAGS, $RPCGENXDRFLAGS. + - Provide more info in the error message when a user tries to build + a target multiple ways. + From Christoph Wiedemann: - Add an Environment.SetDefault() method that only sets values if diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 47c9ad25..1f3c60d5 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -311,7 +311,7 @@ def _init_nodes(builder, env, overrides, tlist, slist): elif isinstance(t.builder, ListBuilder) ^ isinstance(builder, ListBuilder): raise UserError, "Cannot build same target `%s' as singular and list"%str(t) elif t.sources != slist: - raise UserError, "Multiple ways to build the same target were specified for: %s" % str(t) + raise UserError, "Multiple ways to build the same target were specified for: %s (from %s and from %s)" % (str(t), map(str,t.sources), map(str,slist)) if builder.single_source: if len(slist) > 1: diff --git a/test/multi.py b/test/multi.py index bc5bc7d4..f7161a17 100644 --- a/test/multi.py +++ b/test/multi.py @@ -81,7 +81,7 @@ test.write('file2b.in', 'file2b.in\n') test.run(arguments='file2.out', status=2, stderr=""" -scons: *** Multiple ways to build the same target were specified for: file2.out +scons: *** Multiple ways to build the same target were specified for: file2.out (from ['file2a.in'] and from ['file2b.in']) File "SConstruct", line 10, in ? """) -- 2.26.2