From: stevenknight Date: Wed, 5 Jun 2002 04:24:06 +0000 (+0000) Subject: Print an error message if a file can't be unlinked before being built, rather than... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a9c1313d734eefcb8745b3626433ffdab028b283;p=scons.git Print an error message if a file can't be unlinked before being built, rather than just silently terminating the build. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@382 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0d8e4750..fbe895b1 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -24,6 +24,10 @@ RELEASE 0.08 - - Updated README instructions and setup.py code to catch an installation failure from not having distutils installed. + From Jeff Petkau: + + - Fix --implicit-cache if the scanner returns an empty list. + From Anthony Roach: - Add a "multi" keyword argument to Builder creation that specifies @@ -54,9 +58,8 @@ RELEASE 0.08 - - Added a --debug=time option to print SCons execution times. - From Jeff Petkau: - - - Fix --implicit-cache if the scanner returns an empty list. + - Print an error message if a file can't be unlinked before being + built, rather than just silently terminating the build. From Zed Shaw: diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index e58d2d02..c42a700d 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -92,6 +92,9 @@ class BuildTask(SCons.Taskmaster.Task): traceback.print_exception(e.args[0], e.args[1], e.args[2]) raise + except: + sys.stderr.write("scons: *** %s\n" % sys.exc_value) + raise def executed(self): SCons.Taskmaster.Task.executed(self) diff --git a/test/Install.py b/test/Install.py index d80be110..3a3c2bc5 100644 --- a/test/Install.py +++ b/test/Install.py @@ -31,8 +31,10 @@ import TestSCons if sys.platform == 'win32': _exe = '.exe' + _obj = '.obj' else: _exe = '' + _obj = '.o' test = TestSCons.TestSCons() @@ -93,4 +95,20 @@ test.run(arguments = '.') test.fail_test(oldtime1 == os.path.getmtime(foo1)) test.fail_test(oldtime2 != os.path.getmtime(foo2)) +# Verify that scons prints an error message if a target can not be unlinked before +# building it: +test.write('f1.c', r""" +#include + +int main(void) +{ + printf("f1.c again again\n"); + return 0; +} +""") + +os.chmod(test.workpath('.'), 0555) + +test.run(arguments = foo1, stderr="scons: *** [Errno 13] Permission denied: 'f1%s'\n"%_obj, status=2) + test.pass_test()