summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-09-13 21:41:40 (GMT)
committerSteven Knight <knight@baldmt.com>2004-09-13 21:41:40 (GMT)
commit85a62e89d40cb4b0f53ee13f4758af6251696b2e (patch)
tree75e23b7c5fd6ecaa015d5f98e2e271e8eda08dbd
parent374c668222a12df79a792b37ffaec7bd3a7aa221 (diff)
downloadSCons-85a62e89d40cb4b0f53ee13f4758af6251696b2e.zip
SCons-85a62e89d40cb4b0f53ee13f4758af6251696b2e.tar.gz
SCons-85a62e89d40cb4b0f53ee13f4758af6251696b2e.tar.bz2
Better error message when a target is built multiple ways. (Kevin Quick)
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Builder.py2
-rw-r--r--test/multi.py2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 33ef27a..ec8ac36 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 47c9ad2..1f3c60d 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 bc5bc7d..f7161a1 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 ?
""")